Website logo

Make a refund for a purchase

Performs full or partial refunds against a Ping purchase. Can be called multiple times for partial amounts.

URL: https://api.trademe.co.nz/v1/Ping/Transactions/Refunds.{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

<RefundRequest>

PurchaseId Integer (required)

The ID of the purchase to refund.

Amount Number (required)

The dollar value to refund. Must be larger than zero and up to the total value of the purchase.

Returns

<RefundResponse>

Success Boolean

Indicates whether the operation was successful.

Description String or null

The description of the error, if the operation failed.

Example XML Request (switch to JSON)

<RefundRequest xmlns="http://api.trademe.co.nz/v1">
  <PurchaseId>123</PurchaseId>
  <Amount>123.0</Amount>
</RefundRequest>

Example JSON Request (switch to XML)

{
  "PurchaseId": 123,
  "Amount": 123.0
}

Example XML Response (switch to JSON)

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

Example JSON Response (switch to XML)

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