Aurora API: Order Return
The Order Returns API method allows you to create or list order returns for items on an order.
This article provides an example request, along with a response, to get you started.
Order Return
Using this controller you can create or list Order Returns.
Add
Deferred: No
Example Request:
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Order>
<Return>
<Add>
<OrderID>12345</OrderID>
<StoreReference>A0123</StoreReference>
<ReasonCode>ABC</ReasonCode>
<Authorised>1</Authorised>
<Items>
<Item>
<OrderItemID>67891</OrderItemID>
<ReasonCode>ABCD</ReasonCode>
<Quantity>1</Quantity>
<Price>10</Price>
<Restock>yes</Restock>
</Item>
<Item>
<OrderItemID>67892</OrderItemID>
<ReasonCode>ABCE</ReasonCode>
<Quantity>2</Quantity>
<Price>20</Price>
<Restock>no</Restock>
<Confirmed>0</Confirmed>
<ExchangeItems>
<ExchangeItem>
<VariationReference>48381</VariationReference>
<Quantity>1</Quantity>
</ExchangeItem>
</ExchangeItems>
</Item>
</Items>
</Add>
</Return>
</Order>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example Response:
<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
<Header>
<Summary>
<Ack>OK</Ack>
<RequestsProcessed>1</RequestsProcessed>
<RequestsSucceeded>1</RequestsSucceeded>
<RequestErrors>0</RequestErrors>
</Summary>
</Header>
<Responses>
<Response>
<RequestID>1</RequestID>
<Ack>OK</Ack>
<Data>
<ReturnID>123</ReturnID>
<Items>
<ItemID>456</ItemID>
<ItemID>457</ItemID>
</Items>
</Data>
</Response>
</Responses>
</AuroraResponseEnvelope>
Add Method - Request Fields
Field | Values | API Version | Description | Required |
---|---|---|---|---|
OrderID | Integer | 1.4+ | The order within in which to create a new return. | Yes |
StoreReference | Integer | 1.4+ | The Internal Store Reference as detailed within Orders > Shipping > Stores > Edit Store of the store to which the order was returned. | No |
ReasonCode | String | 1.4+ | The Reason Code as detailed within Orders > Returns > Return Reasons for the required reason. | No |
Authorised | Integer > 1 or 0 | 1.4+ | Marks the return as either Authorised or Not Authorised; defaults to Not Authorised | No |
Items | Container | 1.4+ | Yes | |
Items.Item | Container | 1.4+ | One per returned item. | Yes |
Items.Item.OrderItemID | Integer | 1.4+ | The order Item ID as returned by the Order API for the item to be returned. Optional if IsShipping = 1 | Yes |
Items.Item.ReasonCode | String | 1.4+ | The Reason Code as detailed within Orders > Returns > Return Reasons for the required reason; defaults to return level ReasonCode above if not provided. | No |
Items.Item.Quantity | Integer | 1.4+ | The item quantity to be returned; defaults to the order item quantity if not provided. | No |
Items.Item.Price | Float | 1.4+ | The price of the returned item. Defaults (if not provided) to the order item paid price (i.e. accounts for discounts) or order shipping (dependant on “IsShipping=1”). | No |
Items.Item.Restock | yes or no | 1.4+ | Should the product and attribute variation stock levels be updated to account for the returned quantity? | No |
Items.Item.IsShipping | Integer > 1 or 0 | 1.5+ | If item is shipping. | No |
Items.Item.Confirmed | Integer > 1 or 0 | 1.5+ | Confirm the return item and update the quantity returned on the referenced order item. | No |
Items.Item.ExchangeItems | Container | 1.5+ | No | |
Items.Item.ExchangeItems.ExchangeItem | Container | 1.5+ | One per exchanged item item. | |
Items.Item.ExchangeItems.ExchangeItem.ProductID | Integer | 1.5+ | Must be a valid product that hasn't any variations. Conditional: one of ProductID or ProductReference or VariationReference required Specifying a top level product that has variations will cause an API error. | Yes |
Items.Item.ExchangeItems.ExchangeItem.ProductReference | String | 1.5+ | Must be a valid product reference that hasn't any variations. Conditional: one of ProductID or ProductReference or VariationReference required Specifying a product reference that has variations will cause an API error. | Yes |
Items.Item.ExchangeItems.ExchangeItem.VariationReference | String | 1.5+ | Must be a valid variation reference. Conditional: one of ProductID or ProductReference or VariationReference required | Yes |
Items.Item.ExchangeItems.ExchangeItem.Quantity | Integer | 1.5+ | Quantity of exchanged item. | Yes |
Items.Item.ExchangeItems.ExchangeItem.ItemDestination | String | 1.5+ | Use pre-defined list: existing - use the specified “PartOrderID” for assigning exchange order items. new - create a new part dispatch order to assign exchange order items. In this case part dispatches are only created if the order already is already using part dispatches. If an order is not using part dispatches the api request will fail, update the order to use a part dispatch for existing items before to resolve this. Default = new If the setting “Disable order splitting” (see Aurora Backend > Store > Settings > Aurora > Orders) and the “ItemDestination” has been requested then this will cause an API error. | No |
Items.Item.ExchangeItems.ExchangeItem.PartOrderID | Integer | 1.5+ | Must be a valid Part Order ID. Conditional: required only if ItemDestination = existing | No |
Get
Deferred: No
Example request
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Order>
<Return>
<Get tracking="automatic">
<OrderIDs>
<OrderID>123</OrderID>
</OrderIDs>
<ReturnIDs>
<ReturnID>1</ReturnID>
<ReturnID>2</ReturnID>
</ReturnIDs>
<DateStart date="created">2016-01-01</DateStart>
<DateEnd date="created">2017-01-01</DateEnd>
<StoreReference>A0123</StoreReference>
<ReasonCode>ABC</ReasonCode>
<ReturnReference>20130101-abc</ReturnReference>
<Authorised>0</Authorised>
<Tracking>changed</Tracking>
<Paging>
<Token>d874ba9d70a2e21e73b39a4729f0fb52892</Token>
<Limit>1</Limit>
<Page>2</Page>
</Paging>
</Get>
</Return>
</Order>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example Response
<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
<Header>
<Version>head</Version>
<Timestamp>2017-06-09T11:28:37+01:00</Timestamp>
<RequestDetails></RequestDetails>
<Summary>
<Ack>OK</Ack>
<RequestsProcessed>1</RequestsProcessed>
<RequestsSucceeded>1</RequestsSucceeded>
<RequestErrors>0</RequestErrors>
</Summary>
</Header>
<Responses>
<Response>
<RequestID>1</RequestID>
<Ack>OK</Ack>
<Paging>
<Token>d874ba9d70a2e21e73b39a4729f0fb52892</Token>
</Paging>
<Data>
<Return>
<ReturnID>9991</ReturnID>
<OrderID>889472</OrderID>
<StoreReference>S001</StoreReference>
<ReasonCode>UTF</ReasonCode>
<Authorised>1</Authorised>
<DateAuthorised>2012-10-23 13:37:37</DateAuthorised>
<DateCreated>2012-10-23 13:37:37</DateCreated>
<ReturnReference>20121023-a2ba</ReturnReference>
<Comments>Test comment</Comments>
<Items>
<OrderItemID>2549875</OrderItemID>
<ReasonCode></ReasonCode>
<Quantity>1</Quantity>
<Price>11.99</Price>
<IsShipping>0</IsShipping>
<Confirmed>1</Confirmed>
<ExchangeItems>
<OrderItemID>123</OrderItemID>
<Quantity>1</Quantity>
</ExchangeItems>
</Items>
<Items>
<OrderItemID>2549877</OrderItemID>
<ReasonCode></ReasonCode>
<Quantity>2</Quantity>
<Price>3.99</Price>
<IsShipping>0</IsShipping>
<Confirmed>1</Confirmed>
<ExchangeItems></ExchangeItems>
</Items>
</Return>
</Data>
</Response>
</Responses>
</AuroraResponseEnvelope>
Get Method - Request Fields
Field | Value | API version | Description | Required |
---|---|---|---|---|
tracking | RecordAsSent | 1.5+ | Attribute used to denote whether the returned records should be marked as sent for the API user. In that case the value must be set as "automatic". | No |
ReturnIDs | ID List | 1.5+ | Search for specific list of Return ID's | No |
ReturnIDs.ReturnID | Integer | 1.5+ | ID of the return to filter. You can add this node multiple times with different ID's you want to filter. | Yes (when ReturnIDs is present) |
OrderIDs | OrderID List | 1.5+ | Search for specific list of Order ID's | No |
OrderIDs.OrderID | Integer | 1.5+ | ID of the order to filter. You can add this node multiple times with different ID's you want to filter. | Yes (when OrderIDs is present) |
DateStart | DateCreatedOrModifiedType | 1.5+ | Search for return records where the date is >= than the date specified You must supply "date" attribute to this node, which can have one of the following values: both: filters returns based on date created or date the return was authorised created: filters returns based on date created * modified: filters returns based on date the return was authorised | No |
DateEnd | DateCreatedOrModifiedType | 1.5+ | Search for return records where date is <= than the date specified You must supply "date" attribute to this node, which can have one of the following values: both: filters returns based on date created or date the return was authorised created: filters returns based on date created * modified: filters returns based on date the return was authorised | No |
StoreReference | StoreReferenceType | 1.5+ | Search by specified store reference | No |
ReasonCode | ReturnReasonType | 1.5+ | Search by specified reason code | No |
Authorised | ToggleInt | 1.5+ | Filter returns based on that if they are Authorised or not | No |
ReturnReference | String | 1.5+ | Filter by return reference | No |
Tracking | TrackingFilter | 1.5+ | Possible values are: sent: filter records that have previously been sent to this API user unsent: filter records that have previously not been sent to this API user * changed: filter records that have changed (date which they were authorised changed) since they were sent to this API user OR records that have not been previously sent. Read more | No |
Limit | Integer | 1.5+ | Limit the maximum number of results in the result set | No |
Paging | PagingType | 1.5+ | Use this parameter if you want to paginate the results | No |
Paging.Limit | Integer | 1.5+ | How many records to show per page | No |
Paging.Page | Integer | 1.5+ | Page number you want to fetch | No |
Paging.Token | String | 1.5+ | The pagination token sent in the previous paginated response | No |
Updated over 2 years ago