POST
/
transactions
/
refund-transactions
/
{parent-transaction-id}
curl --request POST \
  --url https://base_url/api/v1/transactions/refund-transactions/{parent-transaction-id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "refund_type": "FULL",
  "line_items": [
    {
      "line_id": "<string>",
      "quantity": 123,
      "price_per_unit": 123
    }
  ]
}'
{
  "data": {
    "id": "2535af08-a139-4d0c-9827-1651e46dfbcf"
  },
  "message": "Successfully created refund transaction."
}
The legacy Refund transaction interface is being replaced by the RETURN transaction type. While both are currently supported, new integrations should use RETURN transactions.

Examples

Full Return

{
  "refund_type": "FULL"
}

Partial Return

{
  "refund_type": "PARTIAL",
  "line_items": [
    {
      "line_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "quantity": 1
    }
  ]
}

Partial Return with Custom Price

{
  "refund_type": "PARTIAL",
  "line_items": [
    {
      "line_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "quantity": 1,
      "price_per_unit": 22.50
    }
  ]
}

How It Works

This endpoint creates a RETURN transaction linked to the original sale transaction specified by parent-transaction-id. The system ensures that all returned line items have negative amounts and are properly linked to the original transaction for tax accounting purposes.

The return can be either FULL (returning the entire original transaction) or PARTIAL (returning specific line items). For partial returns, you must specify which line items to return using their line IDs from the original transaction.

The system will:

  1. Validate that the original transaction exists and is accessible
  2. Create a new RETURN transaction with appropriate negative amounts
  3. Link the return to the original sale via parent_invoice_id
  4. Apply the tax credit in the appropriate jurisdiction

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

parent-transaction-id
string
required

The unique identifier of the transaction to generate a return for.

Body

application/json

Response

200
application/json

Transaction creation response

The response is of type object.