Website logo

Refund a Pay Now payment

Refunds a Pay Now payment where the authenticated user is the seller.

Note that this API currently only works if the auction closed less than 45 days ago. If you need a refund for an auction that is older than this, please contact cusomter support.

URL: https://api.trademe.co.nz/v1/MyTradeMe/PayNowRefund.{file_format}
HTTP Method: POST
Requires Authentication? Yes
Permission Required: MyTradeMeWrite: Maintain your watchlist, answer questions and post comments.
Supported Formats: XML, JSON
Rate Limited? Yes

URL parameters

file_format Enumeration (required) The format of the response.
xml Serialize responses into XML.
json Serialize responses into JSON.

POST Data

<PayNowRefundRequest>

ListingId Long Integer (optional)

The ID of the listing to refund.

This field is retained for backwards compatibility; please use PurchaseId instead.

OfferId Integer (optional)

The ID of the fixed price offer. Defaults to zero (i.e. no fixed price offer).

This field is retained for backwards compatibility; please use PurchaseId instead.

RefundAmount Number (optional)

The dollar value to refund, up to the original value of the auction. Defaults to refunding the full value of the original purchase.

PurchaseId Integer (optional)

The ID of the purchase to refund. If this is provided, ListingId and OfferId must not be present.

Returns

<PayNowRefundResponse>

Details on whether the operation was successful.

Success Boolean

Indicates whether the operation was successful.

Description String or null

The description of the error, if the operation failed.

StatusCode Enumeration

The status code indicating what went wrong if the operation failed.

Success 0

OK

Failed 1

Generic failure.

InvalidAmount 2

The refund amount was too large or too small.

InvalidAuctionId 3

The auction ID is invalid.

PaymentIsFrozen 4

The payment is being investigated.

NotTheSeller 5

The caller is not the seller of the auction.

NotBoughtUsingPayNow 6

The auction did not use PayNow.

AlreadyChargedBack 7

The payment has already been charged back.

AlreadyRefunded 8

The payment has already been refunded.

RefundDeclined 9

The refund was declined by the payment provider.

RefundFailed 10

There was a failure while processing the refund.

Example XML Request (switch to JSON)

<PayNowRefundRequest xmlns="http://api.trademe.co.nz/v1">
  <ListingId>123</ListingId>
  <OfferId>123</OfferId>
  <RefundAmount>123.0</RefundAmount>
  <PurchaseId>123</PurchaseId>
</PayNowRefundRequest>

Example JSON Request (switch to XML)

{
  "ListingId": 123,
  "OfferId": 123,
  "RefundAmount": 123.0,
  "PurchaseId": 123
}

Example XML Response (switch to JSON)

<PayNowRefundResponse xmlns="http://api.trademe.co.nz/v1">
  <Success>false</Success>
  <Description>ABC</Description>
  <StatusCode>Success</StatusCode>
</PayNowRefundResponse>

Example JSON Response (switch to XML)

{
  "Success": false,
  "Description": "ABC",
  "StatusCode": 0
}