Backend API
Retrieve a return with the Swell Backend API.
Arguments
idobjectIdrequired
The id of the refund to retrieve.
expandstring
Expanding link fields and child collections is performed using the expand argument.
- For example, expand=account would return a related customer account if one exists.
When the field represents a collection, you can specify the query limit.
- For example, expand=variants:10 would return up to 10 records of the variants collection.
See expanding for more details.
fieldsstring
Return only the specified fields in the result. For example fields=name,slug would return only the fields name and slug in the response. Supports nested object and array fields using dot-notation, for example, items.product_id. The category id is always returned.
includestring
Include one or more arbitrary queries in the response, possibly related to the main query.
See including for more details.
GET/returns/:id
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.get('/returns/{id}', {
id: '60f199509111e70000000083'
});
The return model
{
"id": "60f199509111e70000000083",
"items": [
{
"id": "5ca537326a0ec32a521139dd",
"order_item_id": "5a9ea7ba3f95740a914267f2",
"product_id": "5cad15bc9b14d1990724663b",
"quantity": 2,
"quantity_received": 0,
"quantity_receivable": 2,
"quantity_restocked": 0,
"quantity_restockable": 2
}
],
"order_id": "60f199509111e70000000084",
"currency": "USD",
"date_created": "2021-07-16T14:36:00.399Z",
"date_updated": "2021-07-16T14:36:00.399Z",
"origin": {
"name": "Jon Snow",
"address1": "1 Main Street",
"city": "Brooklyn",
"state": "NY",
"zip": 11201,
"country": "US",
"phone": "(555) 555-5555"
},
"received": false,
"service": "fedex_ground",
"tracking_code": "T192000000XYZ"
}