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

FieldValuesAPI VersionDescriptionRequired
OrderIDInteger1.4+The order within in which to create a new return.Yes
StoreReferenceInteger1.4+The Internal Store Reference as detailed within Orders > Shipping > Stores > Edit Store of the store to which the order was returned.No
ReasonCodeString1.4+The Reason Code as detailed within Orders > Returns > Return Reasons for the required reason.No
AuthorisedInteger > 1 or 01.4+Marks the return as either Authorised or Not Authorised; defaults to Not AuthorisedNo
ItemsContainer1.4+Yes
Items.ItemContainer1.4+One per returned item.Yes
Items.Item.OrderItemIDInteger1.4+The order Item ID as returned by the Order API for the item to be returned.

Optional if IsShipping = 1
Yes
Items.Item.ReasonCodeString1.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.QuantityInteger1.4+The item quantity to be returned; defaults to the order item quantity if not provided.No
Items.Item.PriceFloat1.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.Restockyes or no1.4+Should the product and attribute variation stock levels be updated to account for the returned quantity?No
Items.Item.IsShippingInteger > 1 or 01.5+If item is shipping.No
Items.Item.ConfirmedInteger > 1 or 01.5+Confirm the return item and update the quantity returned on the referenced order item.No
Items.Item.ExchangeItemsContainer1.5+No
Items.Item.ExchangeItems.ExchangeItemContainer1.5+One per exchanged item item.
Items.Item.ExchangeItems.ExchangeItem.ProductIDInteger1.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.ProductReferenceString1.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.VariationReferenceString1.5+Must be a valid variation reference.

Conditional: one of ProductID or ProductReference or VariationReference required
Yes
Items.Item.ExchangeItems.ExchangeItem.QuantityInteger1.5+Quantity of exchanged item.Yes
Items.Item.ExchangeItems.ExchangeItem.ItemDestinationString1.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.PartOrderIDInteger1.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

FieldValueAPI versionDescriptionRequired
trackingRecordAsSent1.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
ReturnIDsID List1.5+Search for specific list of Return ID'sNo
ReturnIDs.ReturnIDInteger1.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)
OrderIDsOrderID List1.5+Search for specific list of Order ID'sNo
OrderIDs.OrderIDInteger1.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)
DateStartDateCreatedOrModifiedType1.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
DateEndDateCreatedOrModifiedType1.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
StoreReferenceStoreReferenceType1.5+Search by specified store referenceNo
ReasonCodeReturnReasonType1.5+Search by specified reason codeNo
AuthorisedToggleInt1.5+Filter returns based on that if they are Authorised or notNo
ReturnReferenceString1.5+Filter by return referenceNo
TrackingTrackingFilter1.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
LimitInteger1.5+Limit the maximum number of results in the result setNo
PagingPagingType1.5+Use this parameter if you want to paginate the resultsNo
Paging.LimitInteger1.5+How many records to show per pageNo
Paging.PageInteger1.5+Page number you want to fetchNo
Paging.TokenString1.5+The pagination token sent in the previous paginated responseNo