Initiate Refunds
2 minute read
GraphQL How Sellers can work with refunds
What you’ll learn
In this how to we take you through how Sellers can use the GraphQL API to:
- Initiate a Refund (or Cancellation)
- Mark a Refund Request as Returned
- Retrieve the status of their refund requests
Prerequisite Reading
Before attempting to use the GraphQL API to work with Refunds and Cancellations, the reader should familiarize themselves with the end to end refunds process documented here.
This outlines not only the various refund processes, but also defines the key terms and concepts involved.
The Legacy Seller API
Seller initiated refund functionality is not (and will not), be supported the Legacy Seller API.
API Keys
You will need a valid Seller API key to initiate refunds, instructions on how to generate a Seller API key can be found here.What steps can the Seller perform
The Seller can perform the following steps in the Refund or Cancellation process:
- Initiate a Refund Request (this is the same whether it’s Cancellation or Refund)
- Update the Refund Request as returned
- Retrieve the Seller Refund Requests
These functions map to the following GraphQL Mutations and Queries:
API | Description | Results In… |
---|---|---|
refundRequestCreate | Initiates either the Cancellation or Return Process | Results in the Creation of a RefundRequest with the Status of: AWAITING |
refundRequestReturn | Acknowledges the Return of Items | Results in the the status of the RefundRequest being updated to: RETURNED |
updatedRefundRequests | Used to return all Refund Requests updated from a given timestamp | Results in a object array of Refund Requests for that Seller (which can be empty) |
An example of the Cancellation flow (pre-dispatch) is shown below, outlining the API Calls the Seller is authorized to make.
Obtaining Refund Requests
The Seller can then use the updatedRefundRequests
to obtain a list of their refund requests filtered by last updated date.
API Collections
We have provided API collections for both Postman and Insomnia to get you started, please visit the Seller API Collections page to download and get started.