ReturnsService class (accessed via client.returns) handles reverse logistics — getting an item back from a customer. A return moves through a lifecycle: a customer requests it, you approve (or reject) it, a reverse shipment collects the item, you mark it received, then resolve to issue the refund, exchange, or store credit.
requestReturn
Opens a return against a delivered order. Capture the customer’s reason and, optionally, a note and the specific items being returned.The response is wrapped: it returns
{ return }. Because return is a reserved word in JavaScript, alias it on destructuring — const { return: ret } = ....{ return }.
getReturn
Fetches a single return by id with its current status and history.listReturns
Lists your returns, newest first. Page withlimit (1–100, default 50) and offset; the response’s pagination block tells you whether more pages exist and the next_offset to request.
{ returns, pagination } — a page of returns plus { limit, offset, has_more, next_offset }.
approveReturn
Approves the return and chooses how it will be resolved. Approving creates a reverse shipment to collect the item from the customer.{ return_id, status, reverse_shipment_id? }. Track the reverse_shipment_id with client.tracking to see the collection in progress.
rejectReturn
Declines the return request. Include a note explaining the decision.receiveReturn
Marks the returned item as physically received back at your end (or the warehouse), after the reverse shipment completes its collection.resolveReturn
Finalises the return — issuing the refund, exchange, or store credit decided at approval. Optionally restock the item back into inventory.{ return_id, status, resolution, refund_amount }.
Sandbox: with a
tybrite_sk_test_* key the whole return flow runs in sandbox — refunds are simulated and no real money moves.
