# Refund

> Refund all or part of a sale by its storeyTransactionId, back to the original payment.

Valet developer docs — After the sale. Web page: https://storeypos.com/valet/docs/refund. Full reference for AI: https://storeypos.com/llms-full.txt. OpenAPI: https://storeypos.com/openapi.json.

Endpoint:

```
POST /api/public/valet/sale/{storeyTransactionId}/refund
```

Include `amount` for a partial refund, or omit the body to return everything left. The business's referenced-refund setting decides routing: On needs no tap or terminal; Off uses the original terminal. It always uses the original sale location's Valor account. One referenced request means one Valor call, never an automatic second method. The response carries `refundedTotal` and `remaining` so you always know where the sale stands; a refund beyond what remains is rejected before anything is sent to the terminal. Refunds can be switched off per location — the error tells you plainly if they are.

Request — cURL:

```bash
curl -X POST https://storeypos.com/api/public/valet/sale/9f2c8e1a-4b3d-4000-8000-000000000001/refund \
  -H "X-Valet-Key: vk_live_XXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "X-Valet-Tag: vt_XXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{"amount":42.5,"memo":"Customer return"}'
```

Response:

```json
{
  "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
  "referenceId": "order-10482",
  "reversalId": "rvs_5d71b09c2e44",
  "kind": "refund",
  "amount": 42.5,
  "status": "approved",
  "authCode": "1A7D04",
  "rrn": "042619005831",
  "error": null,
  "declineCategory": null,
  "channel": "terminal",
  "refundedTotal": 42.5,
  "remaining": 0,
  "createdAt": "2026-09-17T09:14:31Z",
  "cardFeeReturned": null,
  "receiptData": {
    "valetReference": "order-10482",
    "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
    "reversalId": "rvs_5d71b09c2e44",
    "valorRefundTransactionId": "00000000000011463101",
    "originalValorTransactionId": "00000000000011463060",
    "approvalCode": "1A7D04",
    "rrn": "042619005831",
    "dateTime": "2026-09-17T09:14:31Z",
    "cardBrand": "visa",
    "last4": "4242",
    "amount": 42.5,
    "entryMode": "contactless",
    "kind": "refund",
    "valorTransactionId": "00000000000011463101",
    "taxAmount": null,
    "feeAmount": null,
    "batchNumber": "12",
    "tranNumber": "VC09",
    "originalAmounts": {
      "subtotal": 40,
      "taxAmount": 2.5,
      "tipAmount": 0,
      "shippingAmount": 0,
      "feeAmount": null,
      "total": 42.5
    },
    "refundedSoFar": 42.5,
    "remaining": 0,
    "paymentType": "card",
    "giftCardLast4": null,
    "balanceAfter": null,
    "cardDifferenceFee": null,
    "amountRequested": 42.5,
    "amountCharged": 42.5,
    "cardFeePercent": null,
    "cardFeeReturned": null
  }
}
```

## Full refund of the $100.00 sale

Request — cURL (same on both accounts):

```bash
curl -X POST https://storeypos.com/api/public/valet/sale/9f2c8e1a-4b3d-4000-8000-000000000001/refund \
  -H "X-Valet-Key: $VALET_KEY" \
  -H "X-Valet-Tag: $VALET_TAG" \
  -H "Content-Type: application/json" \
  -d '{"amount":100,"memo":"Customer return"}'
```

### Standard account (no card difference fee)

Answer — $100.00 back:

```json
{
  "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
  "referenceId": "order-10490",
  "reversalId": "rvs_5d71b09c2e44",
  "kind": "refund",
  "amount": 100,
  "status": "approved",
  "authCode": "1A7D04",
  "rrn": "042619005831",
  "error": null,
  "declineCategory": null,
  "channel": "terminal",
  "refundedTotal": 100,
  "remaining": 0,
  "createdAt": "2026-09-17T09:14:31Z",
  "cardFeeReturned": null,
  "receiptData": {
    "valetReference": "order-10490",
    "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
    "reversalId": "rvs_5d71b09c2e44",
    "valorRefundTransactionId": "00000000000011463101",
    "originalValorTransactionId": "00000000000011463060",
    "approvalCode": "1A7D04",
    "rrn": "042619005831",
    "dateTime": "2026-09-17T09:14:31Z",
    "cardBrand": "visa",
    "last4": "4242",
    "amount": 100,
    "entryMode": "contactless",
    "kind": "refund",
    "valorTransactionId": "00000000000011463101",
    "taxAmount": null,
    "feeAmount": null,
    "batchNumber": "12",
    "tranNumber": "VC09",
    "originalAmounts": {
      "subtotal": 100,
      "taxAmount": 0,
      "tipAmount": 0,
      "shippingAmount": 0,
      "feeAmount": null,
      "total": 100
    },
    "refundedSoFar": 100,
    "remaining": 0,
    "paymentType": "card",
    "giftCardLast4": null,
    "balanceAfter": null,
    "cardDifferenceFee": null,
    "amountRequested": 100,
    "amountCharged": 100,
    "cardFeePercent": null,
    "cardFeeReturned": null
  }
}
```

### Cash discounting account (card difference fee added)

Answer — $100.00 back plus the $3.50 fee (cardFeeReturned):

```json
{
  "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
  "referenceId": "order-10490",
  "reversalId": "rvs_5d71b09c2e44",
  "kind": "refund",
  "amount": 100,
  "status": "approved",
  "authCode": "1A7D04",
  "rrn": "042619005831",
  "error": null,
  "declineCategory": null,
  "channel": "terminal",
  "refundedTotal": 100,
  "remaining": 0,
  "createdAt": "2026-09-17T09:14:31Z",
  "cardFeeReturned": 3.5,
  "receiptData": {
    "valetReference": "order-10490",
    "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
    "reversalId": "rvs_5d71b09c2e44",
    "valorRefundTransactionId": "00000000000011463101",
    "originalValorTransactionId": "00000000000011463060",
    "approvalCode": "1A7D04",
    "rrn": "042619005831",
    "dateTime": "2026-09-17T09:14:31Z",
    "cardBrand": "visa",
    "last4": "4242",
    "amount": 100,
    "entryMode": "contactless",
    "kind": "refund",
    "valorTransactionId": "00000000000011463101",
    "taxAmount": null,
    "feeAmount": null,
    "batchNumber": "12",
    "tranNumber": "VC09",
    "originalAmounts": {
      "subtotal": 100,
      "taxAmount": 0,
      "tipAmount": 0,
      "shippingAmount": 0,
      "feeAmount": 3.5,
      "total": 100
    },
    "refundedSoFar": 100,
    "remaining": 0,
    "paymentType": "card",
    "giftCardLast4": null,
    "balanceAfter": null,
    "cardDifferenceFee": 3.5,
    "amountRequested": 100,
    "amountCharged": 103.5,
    "cardFeePercent": 3.5,
    "cardFeeReturned": 3.5
  }
}
```

> You state the refund against the cash price. A partial refund returns no fee; the refund that completes the cash price also returns the whole fee, once. You never send the percent: Valet uses the percent set on the location's account, and a `cashDiscountPercent` in the request is accepted and ignored. Gift cards and store credit never carry the fee. On the hosted payment window the customer sees the card price before paying. The rule in full: [Card difference fee](https://storeypos.com/valet/docs/card-difference-fee).

---

Previous: [Widget](https://storeypos.com/valet/docs/widget.md)
Next: [Void](https://storeypos.com/valet/docs/void.md)
