Aurora API: Order Refund

The Order Refunds API method allows you to list order refunds.

This article provides an example request, along with a response, to get you started.

Order Refund

Using this controller you can list Order Refunds.

Add

Deferred: No

Example Request

<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
  <Header>
    <AuthToken>...</AuthToken>
  </Header>
  <Requests>
    <Request>
      <Order>
        <Refund>
          <Add>
            <OrderID>123</OrderID>
			<RefundReason>Refund reason text</RefundReason>
			<RefundAmount>20.35</RefundAmount>
			<VatRate>20.00</VatRate>
            <EmailCustomer>1</EmailCustomer>
            <ShowInReports>1</ShowInReports>
			<ReturnID>321</ReturnID>
            <TriggerRefundPayment>1</TriggerRefundPayment>
			<PaymentTransactions>
				<TransactionId>789</TransactionId>
			</PaymentTransactions>
          </Add>
        </Refund>
      </Order>
    </Request>
  </Requests>
</AuroraRequestEnvelope>

Example Response

<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
	<Header>
		<Version>head</Version>
		<Timestamp>2017-08-18T07:46:56+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>
			<Data>
				<RefundIds>
					<RefundId>1</RefundId>
				</RefundIds>
			</Data>
		</Response>
	</Responses>
</AuroraResponseEnvelope>

Request Fields

FieldValueAPI VersionDescriptionRequired
OrderIDInteger1.5+The order within which to create a new refund.Yes
RefundReasonText1.5+Textural description of the refund for Admin usersYes
RefundAmountFloat1.5+If omitted the RefundAmount will be derived from the value of items associated to the ReturnId

The RefundAmount cannot be less or equals to 0.
No
VatRateFloat1.5+If omitted the VatRate will be obtained from the returned items vat rate.
If no items specified then order vat rate will be used.
No
EmailCustomerInteger = 1 or 01.5+Determines whether to send a refund email to the customer.No
ShowInReportsInteger = 1 or 01.5+Determines whether this refund should be used in Aurora reporting.No
ReturnIDInteger1.5+Requires the creation of a return (refer to OrderReturnAdd Aurora API Method) even if product not “returned” to the store i.e. return reasons should be created to define when a product is lost in post.

The order return must be “Authorised=1”.
Yes
TriggerRefundPaymentInteger = 11.5+The fixed value always forces triggering of refunds and makes it clear this is the action that will be taken.

Supported refund payment types:

Payment Plugin (Paypal Express, Realex)
Credit Card: Sagepay
Channel Advisor

Unsupported refund payment types:

Intu
“customRefundProcessor” (legacy)
Credit Note
Amazon Marketplace
other payment types not explicitly listed

Note some refund processing may require queued/postponed processing. In this case the status of the refund transaction must be tracked via the Order Get API.
Errors occurring during postponed processing will be available via the Aurora Backend Error Logs.
Yes
PaymentTransactionsContainer1.5+The transactions to use for the refund.

When Automatic Refunds are enabled in the Aurora Back-end, if this element is omitted, the refunds are applied across all transactions for the order, in accordance with the rules prescribed in the Automatic Refund Guide. If included, then the provided transactions are used to apply the refunds.

If Automatic Refunds are not enabled, when this element is omitted, a refund will be triggered against the first eligible payment transaction associated to the order that has a value equal to or greater than the RefundAmount.

The refund amount cannot exceed the available transaction amounts (minus any refunds already made against the transactions).
No
PaymentTransactions.TransactionIdInteger1.5+Must be a valid transaction.Yes

Get

Deferred: No

Example Request

Example Request

<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
  <Header>
    <AuthToken>...</AuthToken>
  </Header>
  <Requests>
    <Request>
      <Order>
        <Refund>
          <Get tracking="automatic">
            <OrderIDs>
				<OrderID>123</OrderID>
			</OrderIDs>
			<RefundIDs>
				<RefundID>1</RefundID>
				<RefundID>2</RefundID>
			</RefundIDs>
			<ReturnIDs>
				<ReturnID>111</ReturnID>
				<ReturnID>222</ReturnID>
			</ReturnIDs>
			<DateStart date="created">2016-01-01</DateStart>
            <DateEnd date="created">2017-01-01</DateEnd>
			<Tracking>changed</Tracking>
            <Paging>
                <Token>d874ba9d70a2e21e73b39a4729f0fb52892</Token>
                <Limit>1</Limit>
                <Page>2</Page>
            </Paging>
          </Get>
        </Refund>
      </Order>
    </Request>
  </Requests>
</AuroraRequestEnvelope>

Example Response

Example Response

<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
	<Header>
		<Version>head</Version>
		<Timestamp>2017-06-09T11:59:31+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>
				<Refund>
					<RefundID>77771</RefundID>
					<ReturnID>9991</ReturnID>
					<OrderID>889472</OrderID>
					<TransactionID>123</TransactionID>
					<RefundReason>Test</RefundReason>
					<RefundAmount>10.00</RefundAmount>
					<VatableAmount>2.00</VatableAmount>
					<VatRate>20.00</VatRate>
					<DateCreated>2013-02-15 09:30:26</DateCreated>			
					<ShowInReports>1</ShowInReports>
					<Items>
						<OrderItemID>2549875</OrderItemID>
						<ReasonCode>UTF</ReasonCode>
						<Quantity>1</Quantity>
						<Price>10.00</Price>
						<IsShipping>0</IsShipping>
					</Items>
					<Items>
						<OrderItemID>2549877</OrderItemID>
						<ReasonCode>UTF</ReasonCode>
						<Quantity>1</Quantity>
						<Price>10.00</Price>
						<IsShipping>0</IsShipping>
					</Items>
				</Refund>
			</Data>
		</Response>
	</Responses>
</AuroraResponseEnvelope>

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 to "automatic".No
RefundIDsID List1.5+Search for specific list of refund ID'sNo
RefundIDs.RefundIDInteger1.5+ID of the refund to filter. You can add this node multiple times with different ID's you want to filter.Yes
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
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
DateStartdate1.5+Search for refund records where the date is >= than the date specifiedNo
DateEnddate1.5+Search for refund records where date is <= than the date specifiedNo
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: this filter is not supported and will raise an error if supplied

Read more
No
LimitInteger1.5+Limit the maximum number of results in the result setNo
PagingPagingType1.5+Paging of result setsNo
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