Skip to navigation

Refund order

View as Markdown

Create a refund against an order. Multiple refunds are supported, but the total refunded quantity cannot exceed the original order quantity for each item. IMPORTANT: Refund prices and tax amounts are automatically calculated from the order. If the order had discounts applied, refunds will reflect the discounted prices (the actual amount paid). Do not send price or tax fields in the refund request - only itemId and quantity are required. Pass an idempotencyKey to make retries safe — a second request with the same key returns the original refund (HTTP 200) instead of creating a new one. Omitting idempotencyKey returns an X-TaxCloud-Warning response header recommending one; the refund is still created.

Authentication

AuthorizationBearer
This authentication type can be used to directly call the service.
OR
X-API-KEYstring
This authentication type is supported by using the provided API key for the merchant account.

Path parameters

connectionIdstringRequired>=36 characters
represents the ID of a connection. It is used as a unique identifier for the connection
orderIdstringRequired
the id of the order to refund against

Request

This endpoint expects an object.
batchIdstringOptional
Optional batch ID for grouping refunds
idempotencyKeystringOptional1-200 characters

Optional opaque key uniquely identifying this refund within the (connection, order). When present, a second create attempt with the same key returns the original refund (HTTP 200) instead of creating a new one. Recommended for ETL or Service Bus consumers that may retry. Use a stable identifier from your source system (e.g. a Shopify refund GID), not a request UUID.

itemslist of objectsOptional

represents the items of the refund request, if an empty lists or no lists is passed it is assumed the entire order will be refunded. IMPORTANT: Prices and tax amounts are automatically calculated from the order. If the order had discounts, refunds will use the discounted prices (actual amount paid).

returnedDatestring or nullOptionalformat: "date-time"

The date of the return; defaults to the current timestamp. Leave empty (recommended) to deduct the refund from the current month's filing. Setting to a prior-month date may trigger an amended filing.

Response headers

X-TaxCloud-WarningstringOptional

Response

Created
connectionIdstring>=36 characters
represents the ID of a connection. It is used as a unique identifier for the connection
itemslist of objects
batchIdstringOptional
Batch ID for grouping refunds
createdDatestringOptionalformat: "date-time"
represents the time when the refund was created.
idempotencyKeystringOptional
Echoed back when the refund was created with an idempotency key.
returnedDatestringOptionalformat: "date-time"
represents the time when the refund took effect.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error