Returning a sale via the API

Return one or more items on a sale using Jetti's API. Automatically split between dropship and in-house and shipments.

Last updated July 3rd, 2019

Alongside raising returns in the Jetti admin or customer portal, you can also raise and manage returns using the Jetti API. Sale returns will automatically be split by in-house / dropship. When this happens, multiple sale-return objects will be created, linked back to the parent sale by the saleId attribute.

Each sale return will also have a unique reference. It will inherit the parent sale reference, then add a numerical suffix. For example, if two sale return objects were generated for a parent sale, it will generate the references 1001-01, 1001-02.

Step 1

Lookup the sale object

It's likely you'll want to look the sale up by either the externalId (this is the system ID of the order in the sales channel, such as the Shopify system Id). Or, you may want to lookup by the reference field.

Step 2

Generate the return

The easiest way to generate the sale return object is to use the cancel.json endpoint. This will automatically return an array of sale return objects. One for any in-house items and one per dropship provider you are returning items for.

You can optionally pass in an array of sale-item IDs to return. Or, just leave this black to return the whole sale. Setting skipQuantities will prevent the values from being pre-populated, setting the items to be returned / cancelled as 0 on the sale return items created for the sale return.

Step 3

Update the quantities to be returned

If needed, you may need to adjust any of the quantities on the sale return items. For example, you may only want to return 1 of the 2 items ordered. You can put this with a PUT request.

As these sale return objects are created / updated, the cancellationStatus attribute of the sale object will be automatically updated to reflect if the sale is partially or fully cancelled.

You also have the ability to set other properties, such as the adjustmentReasonId for the item.

Back to API