# Sale: card

> POST /api/public/valet/sale for a card on a terminal, on standard and cash discounting accounts.

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

Endpoint:

```
POST /api/public/valet/sale
```

Send your own `referenceId` — it is your idempotency key, and repeating it returns the original answer instead of charging twice. `subtotal` is required; `taxAmount`, `tipAmount` and `shippingAmount` default to 0; `total` is optional, and if you send it it must equal their sum — the server checks the maths and rejects the call otherwise. A `replayed` flag of true means this referenceId was seen before and the original result was returned.

Status is `approved`, `declined`, `no_connection` or `error`. Every sale reply carries `warnings`, an array of codes that is empty when nothing is wrong.

Card sales here are for terminal stations only. If a card sale uses a key-entry station, the call is rejected and you are pointed at `POST /api/public/valet/session` instead — a card number can never be sent to Storey over this API.

## Example: $100.00 sale

Request — cURL (same on both accounts):

```bash
curl -X POST https://storeypos.com/api/public/valet/sale \
  -H "X-Valet-Key: $VALET_KEY" \
  -H "X-Valet-Tag: $VALET_TAG" \
  -H "Content-Type: application/json" \
  -d '{"referenceId":"order-10490","subtotal":100}'
```

### Standard account (no card difference fee)

Answer — card pays $100.00:

```json
{
  "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
  "referenceId": "order-10490",
  "status": "approved",
  "authCode": "0F3C21",
  "rrn": "042619005831",
  "card": {
    "brand": "visa",
    "last4": "4242",
    "entryMode": "contactless"
  },
  "amounts": {
    "subtotal": 100,
    "taxAmount": 0,
    "tipAmount": 0,
    "shippingAmount": 0,
    "total": 100,
    "cardDifferenceFee": null,
    "amountRequested": 100,
    "amountCharged": 100,
    "cardFeePercent": null
  },
  "refundedAmount": 0,
  "voidedAt": null,
  "receipt": {
    "batchNo": "12",
    "tranNo": "VC07",
    "responseText": "SUCCESS",
    "surchargeAmount": "0.00",
    "cashDiscount": "0.00",
    "cardholderName": "JANE SAMPLE",
    "terminal": "2319993484"
  },
  "error": null,
  "declineCategory": null,
  "channel": "terminal",
  "capturedAt": "2026-09-16T18:22:04Z",
  "createdAt": "2026-09-16T18:21:58Z",
  "receiptData": {
    "valetReference": "order-10490",
    "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
    "valorTransactionId": "00000000000011463060",
    "approvalCode": "0F3C21",
    "rrn": "042619005831",
    "dateTime": "2026-09-16T18:22:04Z",
    "cardBrand": "visa",
    "last4": "4242",
    "amount": 100,
    "taxAmount": 0,
    "feeAmount": null,
    "entryMode": "contactless",
    "batchNumber": "12",
    "tranNumber": "VC07",
    "kind": "sale",
    "reversalId": null,
    "originalValorTransactionId": null,
    "valorRefundTransactionId": null,
    "originalAmounts": {
      "subtotal": 100,
      "taxAmount": 0,
      "tipAmount": 0,
      "shippingAmount": 0,
      "feeAmount": null,
      "total": 100
    },
    "refundedSoFar": 0,
    "remaining": 100,
    "paymentType": "card",
    "giftCardLast4": null,
    "balanceAfter": null,
    "cardDifferenceFee": null,
    "amountRequested": 100,
    "amountCharged": 100,
    "cardFeePercent": null,
    "cardFeeReturned": null
  },
  "replayed": false,
  "warnings": []
}
```

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

Answer — $100.00 at 3.5% = $103.50 charged:

```json
{
  "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
  "referenceId": "order-10490",
  "status": "approved",
  "authCode": "0F3C21",
  "rrn": "042619005831",
  "card": {
    "brand": "visa",
    "last4": "4242",
    "entryMode": "contactless"
  },
  "amounts": {
    "subtotal": 100,
    "taxAmount": 0,
    "tipAmount": 0,
    "shippingAmount": 0,
    "total": 100,
    "cardDifferenceFee": 3.5,
    "amountRequested": 100,
    "amountCharged": 103.5,
    "cardFeePercent": 3.5
  },
  "refundedAmount": 0,
  "voidedAt": null,
  "receipt": {
    "batchNo": "12",
    "tranNo": "VC07",
    "responseText": "SUCCESS",
    "surchargeAmount": "350",
    "cashDiscount": "0.00",
    "cardholderName": "JANE SAMPLE",
    "terminal": "2319993484"
  },
  "error": null,
  "declineCategory": null,
  "channel": "terminal",
  "capturedAt": "2026-09-16T18:22:04Z",
  "createdAt": "2026-09-16T18:21:58Z",
  "receiptData": {
    "valetReference": "order-10490",
    "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
    "valorTransactionId": "00000000000011463060",
    "approvalCode": "0F3C21",
    "rrn": "042619005831",
    "dateTime": "2026-09-16T18:22:04Z",
    "cardBrand": "visa",
    "last4": "4242",
    "amount": 100,
    "taxAmount": 0,
    "feeAmount": 3.5,
    "entryMode": "contactless",
    "batchNumber": "12",
    "tranNumber": "VC07",
    "kind": "sale",
    "reversalId": null,
    "originalValorTransactionId": null,
    "valorRefundTransactionId": null,
    "originalAmounts": {
      "subtotal": 100,
      "taxAmount": 0,
      "tipAmount": 0,
      "shippingAmount": 0,
      "feeAmount": 3.5,
      "total": 100
    },
    "refundedSoFar": 0,
    "remaining": 100,
    "paymentType": "card",
    "giftCardLast4": null,
    "balanceAfter": null,
    "cardDifferenceFee": 3.5,
    "amountRequested": 100,
    "amountCharged": 103.5,
    "cardFeePercent": 3.5,
    "cardFeeReturned": null
  },
  "replayed": false,
  "warnings": []
}
```

> 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).

## Example with tax

Request — cURL:

```bash
curl -X POST https://storeypos.com/api/public/valet/sale \
  -H "X-Valet-Key: vk_live_XXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "X-Valet-Tag: vt_XXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{"referenceId":"order-10482","subtotal":40,"taxAmount":2.5,"total":42.5}'
```

Response:

```json
{
  "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
  "referenceId": "order-10482",
  "status": "approved",
  "authCode": "0F3C21",
  "rrn": "042619005831",
  "card": {
    "brand": "visa",
    "last4": "4242",
    "entryMode": "contactless"
  },
  "amounts": {
    "subtotal": 40,
    "taxAmount": 2.5,
    "tipAmount": 0,
    "shippingAmount": 0,
    "total": 42.5,
    "cardDifferenceFee": null,
    "amountRequested": 42.5,
    "amountCharged": 42.5,
    "cardFeePercent": null
  },
  "refundedAmount": 0,
  "voidedAt": null,
  "receipt": {
    "batchNo": "12",
    "tranNo": "VC07",
    "responseText": "SUCCESS",
    "surchargeAmount": "0.00",
    "cashDiscount": "0.00",
    "cardholderName": "JANE SAMPLE",
    "terminal": "2319993484"
  },
  "error": null,
  "declineCategory": null,
  "channel": "terminal",
  "capturedAt": "2026-09-16T18:22:04Z",
  "createdAt": "2026-09-16T18:21:58Z",
  "receiptData": {
    "valetReference": "order-10482",
    "storeyTransactionId": "9f2c8e1a-4b3d-4000-8000-000000000001",
    "valorTransactionId": "00000000000011463060",
    "approvalCode": "0F3C21",
    "rrn": "042619005831",
    "dateTime": "2026-09-16T18:22:04Z",
    "cardBrand": "visa",
    "last4": "4242",
    "amount": 42.5,
    "taxAmount": 2.5,
    "feeAmount": null,
    "entryMode": "contactless",
    "batchNumber": "12",
    "tranNumber": "VC07",
    "kind": "sale",
    "reversalId": null,
    "originalValorTransactionId": null,
    "valorRefundTransactionId": null,
    "originalAmounts": {
      "subtotal": 40,
      "taxAmount": 2.5,
      "tipAmount": 0,
      "shippingAmount": 0,
      "feeAmount": null,
      "total": 42.5
    },
    "refundedSoFar": 0,
    "remaining": 42.5,
    "paymentType": "card",
    "giftCardLast4": null,
    "balanceAfter": null,
    "cardDifferenceFee": null,
    "amountRequested": 42.5,
    "amountCharged": 42.5,
    "cardFeePercent": null,
    "cardFeeReturned": null
  },
  "replayed": false
}
```

## Declined

Declined answer (HTTP 200):

```json
{
  "storeyTransactionId": "vlt_2b7e40c19d55",
  "referenceId": "order-10483",
  "status": "declined",
  "authCode": null,
  "rrn": "042619005831",
  "card": {
    "brand": "visa",
    "last4": "4242",
    "entryMode": "contactless"
  },
  "amounts": {
    "subtotal": 40,
    "taxAmount": 2.5,
    "tipAmount": 0,
    "shippingAmount": 0,
    "total": 42.5,
    "cardDifferenceFee": null,
    "amountRequested": 42.5,
    "amountCharged": 42.5,
    "cardFeePercent": null
  },
  "refundedAmount": 0,
  "voidedAt": null,
  "receipt": null,
  "error": "51 - INSUFFICIENT FUNDS",
  "declineCategory": "insufficient_funds",
  "channel": "terminal",
  "capturedAt": null,
  "createdAt": "2026-09-16T18:21:58Z",
  "receiptData": null,
  "replayed": false
}
```

A decline is not an HTTP error: it is HTTP 200 with `status: "declined"`, the processor's real reason in `error`, and a [decline category](https://storeypos.com/valet/docs/decline-categories).

## Fields

- `referenceId` (string, 1–64, required): your idempotency key.
- `subtotal` (number, required).
- `taxAmount`, `tipAmount`, `shippingAmount` (number, default 0).
- `total` (number > 0, optional): left out = the sum above; if sent it must equal it.
- `cashDiscountPercent` (number 0–25, optional): accepted and ignored; the card difference fee uses only the location's boarded percent.
- `paymentType` ("card" | "gift_card" | "store_credit", optional): omitted = card.
- `giftCardCode` (string): required for gift_card / store_credit.
- `customerRef` (string, optional): accepted and ignored. `saveCard: true` is refused with 400.

---

Previous: [Choose the transaction kind](https://storeypos.com/valet/docs/transaction-kinds.md)
Next: [Sale: gift card or store credit](https://storeypos.com/valet/docs/sale-stored-value.md)
