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 Integer (optional) ListingId

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

OfferId Integer (optional) OfferId

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

RefundAmount Number (optional) RefundAmount
PurchaseId Integer (optional) PurchaseId

Returns

<PayNowRefundResponse>

Details on whether the operation was successful.

Success Boolean Success
Description String or null Description
StatusCode Enumeration StatusCode
Success 0 Success
Failed 1 Failed
InvalidAmount 2 InvalidAmount
InvalidAuctionId 3 InvalidAuctionId
PaymentIsFrozen 4 PaymentIsFrozen
NotTheSeller 5 NotTheSeller
NotBoughtUsingPayNow 6 NotBoughtUsingPayNow
AlreadyChargedBack 7 AlreadyChargedBack
AlreadyRefunded 8 AlreadyRefunded
RefundDeclined 9 RefundDeclined
RefundFailed 10 RefundFailed

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
}