> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gameball.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund Order

> Refund or cancel orders and automatically restore customer points

When a customer returns items or cancels an order, use the Refund API to reverse the transaction. Gameball restores any points redeemed on the original order, deducts the points it earned, and keeps the customer's balance accurate, which is essential for fair returns and clean financial reconciliation.

## Refund an Order

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://api.gameball.co/api/v4.0/integrations/transactions/refund' \
    -H 'Content-Type: application/json' \
    -H 'APIKey: YOUR_API_KEY' \
    -H 'SecretKey: YOUR_SECRET_KEY' \
    -d '{
      "customerId": "12345",
      "refundTransactionId": "REFUND0001",
      "reverseTransactionId": "ORD000123",
      "transactionTime": "2025-10-19T12:30:00Z",
      "refundAmount": 100.00
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "gameballTransactionId": "11034735",
    "refundTransactionId": "REFUND0001",
    "refundAmount": 100.00,
    "refundEquivalentPoints": 100
  }
  ```
</ResponseExample>

## Request Fields

<ParamField body="customerId" type="string" required>
  The unique identifier for the customer.
</ParamField>

<ParamField body="refundTransactionId" type="string" required>
  A unique identifier for this refund transaction.
</ParamField>

<ParamField body="reverseTransactionId" type="string" required>
  The original `orderId` being refunded. Must match an existing order.
</ParamField>

<ParamField body="transactionTime" type="string" required>
  When the refund occurred, in ISO 8601 format.
</ParamField>

<ParamField body="refundAmount" type="number" required>
  The amount being refunded. Use the original order's `totalPaid` for a full refund, or a smaller value for a partial refund.
</ParamField>

<Note>
  **Behind the scenes**, Gameball reverses the original order, restores any points redeemed on it, deducts any points it earned, updates the balance, and records the refund in the transaction history. `refundEquivalentPoints` is the point value of the refunded amount.
</Note>

## Tips & Gotchas

* Always use a unique `refundTransactionId` per refund.
* `reverseTransactionId` must match an existing order ID.
* Partial refunds are supported, adjust `refundAmount` accordingly.
* Process refunds as soon as the return is confirmed.

## Related Resources

<Card title="Refund Transaction API" icon="arrow-rotate-left" href="/api-reference/transactions/cashback-and-redemptions/refund">
  Complete API reference for refund transactions
</Card>
