Website logo

Get in trade reasons

Returns a list of reasons for changing the in trade status. This is used in conjunction with the set in trade status API.

URL: https://api.trademe.co.nz/v1/InTradeReasons.{file_format}
HTTP Method: GET
Requires Authentication? Yes
Permission Required: None
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.

Returns

Collection of <InTradeReason>

List of in trade reasons

ReasonId Integer

The reason id to use in set in trade status API.

Description String or null

The display description.

IsOptInReason Boolean

Determines whether this reason can be used to set the in trade status to true.

IsOptOutReason Boolean

Determines whether this reason can be used to set the in trade status to false.

NeedsComment Boolean

Determines whether this reason needs an additional comment when using in set in trade status API.

Example XML Response (switch to JSON)

<InTradeReasonCollection xmlns="http://api.trademe.co.nz/v1">
  <InTradeReason>
    <ReasonId>123</ReasonId>
    <Description>ABC</Description>
    <IsOptInReason>false</IsOptInReason>
    <IsOptOutReason>false</IsOptOutReason>
    <NeedsComment>false</NeedsComment>
  </InTradeReason>
  <InTradeReason>
    <ReasonId>123</ReasonId>
    <Description>ABC</Description>
    <IsOptInReason>false</IsOptInReason>
    <IsOptOutReason>false</IsOptOutReason>
    <NeedsComment>false</NeedsComment>
  </InTradeReason>
</InTradeReasonCollection>

Example JSON Response (switch to XML)

[
  {
    "ReasonId": 123,
    "Description": "ABC",
    "IsOptInReason": false,
    "IsOptOutReason": false,
    "NeedsComment": false
  },
  {
    "ReasonId": 123,
    "Description": "ABC",
    "IsOptInReason": false,
    "IsOptOutReason": false,
    "NeedsComment": false
  }
]