Order and return tools
Use orders_list to find a Sqquid order ID. An order number from a sales Connection is not the same as the Sqquid ID.
orders_list
Section titled “orders_list”Requires orders:read. Read-only.
Lists orders with totals, location assignments, export status, and sync errors.
| Input | Required | Description |
|---|---|---|
status |
No | Export status, such as SKIPPED or NEEDS_FETCH. NOT_EXPORTED cannot be used as a filter. |
search |
No | Order number, customer, email, or address text. Terms shorter than four characters are ignored. |
has_error |
No | true to show only orders with sync errors. |
sort_by, sort |
No | Sort column and direction. Defaults to id and desc. |
limit, offset |
No | Page size from 1 to 100, default 25, and rows to skip, default 0. |
Check search_ignored before treating the result as a search match.
orders_get
Section titled “orders_get”Requires orders:read. Read-only.
Pass the order’s id. Set include_raw_data: true only when you need the larger source data fields; the default is false.
The result includes items, addresses, totals, sync errors, downstream exports, comments, and location allocations. Each allocation identifies the location assigned to fulfill units of an order item. Use its allocation_id with fulfillment tools.
exported_at is the last time the order was exported, or null. It is not limited to POS exports. Check exports for the destination systems.
orders_retry
Section titled “orders_retry”Requires orders:write. Changes status and triggers background work without a separate approval request.
Pass the order’s id. Only SKIPPED and NEEDS_FETCH orders can be retried. Fix the cause shown by orders_get first.
The tool resets the status to NOT_EXPORTED and triggers enabled Connections that export orders. The result lists triggered_connection_ids. This does not confirm a successful export. Check orders_get again afterward.
returns_list
Section titled “returns_list”Requires orders:read. Read-only.
Lists refund returns, their items, totals, export destinations, and errors. Transfer returns created when units move between locations are excluded.
| Input | Required | Description |
|---|---|---|
order_id |
No | Return every refund return for this order. Other filters and pagination are ignored. |
connection_id |
No | Filter by the order’s source Connection. |
status |
No | NEEDS_EXPORT, FINISHED, or SKIPPED. Use has_error to find failures. |
has_error |
No | true for returns with export errors. |
limit, offset |
No | Page size from 1 to 100, default 25, and rows to skip, default 0. |
Check each return’s retryable value before retrying it.
returns_create
Section titled “returns_create”Requires orders:write. User approval is required.
| Input | Required | Description |
|---|---|---|
order_id |
Yes | Sqquid order ID. |
store_id |
Yes | Location receiving the returned units, from locations_list. |
items |
No | List of sku and positive integer qty values. Defaults to an empty list. |
adjustment |
No | Extra refund amount, such as shipping. Negative values deduct from the refund. Defaults to 0. |
push_to_channel |
No | Also send the return to the order’s source Connection, if it supports it. Omit to use that Connection’s default. |
Read orders_get and returns_list for the order first. Supply at least one item or a nonzero adjustment. Quantities cannot exceed the ordered units minus units already returned.
The tool creates a return record in Sqquid and puts units back into stock at the selected location. Sqquid calculates the refund from the order’s prices, discounts, and tax, then updates your POS if it supports returns.
When push_to_channel is on, Sqquid also sends the return to the order’s source Connection, if it supports it. Review this choice in the approval request. Turning it off does not prevent the POS update.
pushed_to_channel confirms whether the return was queued for the order’s source Connection. A disabled Connection does not receive that queued request. This value does not confirm that an external system processed the return or completed a refund.
returns_retry
Section titled “returns_retry”Requires orders:write. Queues work without a separate approval request.
Pass the return’s id from returns_list. Only ERROR or SKIPPED returns can be retried. Sqquid refuses the retry if an exporter marked the error as not retryable.
The status changes to NEEDS_EXPORT for the next export run. Check returns_list afterward to confirm the outcome.