Take a payment
Hosted payment window (session)
Create a session and let Storey's hosted window take card, gift card or store credit, including key entry.
Endpoints
POST /api/public/valet/session
GET /api/public/valet/session/{token}
POST /api/public/valet/session/{token}Creates a 20-minute token and payUrl. Send kind: sale (default) with referenceId, subtotal and total; or kind: refund / void with storeyTransactionId (the sale UUID), plus optional amount for a partial refund. Choose paymentType and giftCardCode when running a sale at POST /session/{token}, not when creating it. Refunds and voids inherit the original sale payment type; do not send a new paymentType or code. All three kinds work for card, gift_card and store_credit. Module-on choices appear automatically for sales; card stays the default.
Used by the hosted window. GET returns what to show plus the additive paymentOptions { card, giftCard, storeCredit }: gift card and store credit are true only when the business has the Gift cards / Store credit module on; card is always the default. It also returns the additive cardFee { percent, fee, cardTotal } for a sale at a cash-discount location (card payments only; null otherwise), which the window shows before the customer pays. POST runs it once. Optional body fields (sales only): paymentType ("card" default, "gift_card", "store_credit") and giftCardCode. Same all-or-nothing balance rule and the same receiptData as POST /sale; refunds and voids opened for a gift card or store credit sale go back onto the same card. A refusal returns 200 status "declined" with reason and leaves the window open so the customer can correct the code.
The hosted payment window offers gift card and store credit by itself when the business has that module on — nothing to add to your session call. The customer types or scans the code (phones can use the camera where the browser supports it). For card payments on a cash discounting account the window shows the card difference fee and the card price before the customer pays.
Create a sale session — cURL
curl -X POST https://storeypos.com/api/public/valet/session \
-H "X-Valet-Key: $VALET_KEY" \
-H "X-Valet-Tag: $VALET_TAG" \
-H "Content-Type: application/json" \
-d '{"kind":"sale","referenceId":"order-10490","subtotal":100}'Pay with a gift card — POST /api/public/valet/session/{token} body
{
"paymentType": "gift_card",
"giftCardCode": "7000000000000005"
}GET /api/public/valet/session/{token} adds
{
"paymentOptions": {
"card": true,
"giftCard": true,
"storeCredit": false
}
}Every hosted call
| Kind | Call | Send |
|---|---|---|
| Hosted sale (card, gift_card, store_credit) | POST /api/public/valet/session → POST /api/public/valet/session/{token} | Create: kind: "sale" (default), referenceId, subtotal; optional total/taxAmount/tipAmount/shippingAmount. Run: paymentType omitted/card; or gift_card/store_credit + giftCardCode. Key-entry card: cardToken from secure provider field, optional address1/zip. Creation does not set paymentType. |
| Hosted refund (card, gift_card, store_credit) | POST /api/public/valet/session → POST /api/public/valet/session/{token} | Create: kind: "refund", storeyTransactionId (UUID), optional amount. Run: no body. Original sale determines payment type, never a new choice. |
| Hosted void (card, gift_card, store_credit) | POST /api/public/valet/session → POST /api/public/valet/session/{token} | Create: kind: "void", storeyTransactionId (UUID). Run: no body. Original sale determines payment type. |
| Hosted status | GET /api/public/valet/session/{token} | Token in path; returns session view, paymentOptions, cardFee (card difference fee for card payments, or null), sale and reversal summaries (not the full run response). |
| Hosted secure card field | GET /api/public/valet/session/{token}/card | Token in path; key-entry station only. Provider field initialization, not a saved card. |
| Hosted processor receipt copy | POST /api/public/valet/session/{token}/receipt | phone (10 digits) and/or email. Approved processor card sale with gateway reference only; not digital gift-card delivery. |
