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
Field | Value | API Version | Description | Required |
---|---|---|---|---|
OrderID | Integer | 1.5+ | The order within which to create a new refund. | Yes |
RefundReason | Text | 1.5+ | Textural description of the refund for Admin users | Yes |
RefundAmount | Float | 1.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 |
VatRate | Float | 1.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 |
EmailCustomer | Integer = 1 or 0 | 1.5+ | Determines whether to send a refund email to the customer. | No |
ShowInReports | Integer = 1 or 0 | 1.5+ | Determines whether this refund should be used in Aurora reporting. | No |
ReturnID | Integer | 1.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 |
TriggerRefundPayment | Integer = 1 | 1.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 |
PaymentTransactions | Container | 1.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.TransactionId | Integer | 1.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
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 to "automatic". | No |
RefundIDs | ID List | 1.5+ | Search for specific list of refund ID's | No |
RefundIDs.RefundID | Integer | 1.5+ | ID of the refund to filter. You can add this node multiple times with different ID's you want to filter. | Yes |
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 |
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 |
DateStart | date | 1.5+ | Search for refund records where the date is >= than the date specified | No |
DateEnd | date | 1.5+ | Search for refund records where date is <= than the date specified | 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: this filter is not supported and will raise an error if supplied Read more | No |
Limit | Integer | 1.5+ | Limit the maximum number of results in the result set | No |
Paging | PagingType | 1.5+ | Paging of result sets | 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