Integration guide
Send sales from a till to Salesift
One HTTPS request per sale. This guide covers the API key, the endpoints and their JSON, the errors you can get back, and how to retry safely, with examples in curl, Node and Python.
POST https://api.salesift.com/salesApi/shops/{shopId}/sales with the header api-key and a JSON body holding transactionId, occurredAt and totalAmount. Resending the same transactionId never creates a duplicate.Every endpoint, field and answer is also in the API reference, where you can try requests with a test key, and as an OpenAPI file for generating a client.
Before you start
Get these from the mall team or the shop owner:
- The shop id, a whole number such as
14. Each shop in the mall has its own. - An API key made for that shop. Keys are made in Salesift under Shops then View API keys, and shown once when made.
- The ids of the sale types and payment methods the mall uses, for example sale type
1= Sale, payment method1= Card,2= Cash. - The currency codes the mall accepts, such as
USDorEUR. A sale in a currency the mall hasn't set up is refused.
A shop with several tills can use one key for all of them or one key per till. Both work; separate keys let the mall revoke one till without stopping the others.
Authentication
Every request carries the shop's key in the api-key header. There is no login step and no token to refresh.
api-key: 5f0c2c…your key…9a3f- Calls go over HTTPS only, to
https://api.salesift.com. - A key reaches its own shop and nothing else. Using it on another shop's URL answers
404. - A key stops working when it expires (1 to 3 years after it is made) or is revoked. Requests then answer
403. Ask for a new key before the old one runs out. - Keep the key on the till's server side or in its secure settings. Never put it in a web page, an app users can download, a URL or a log.
Send a sale
Send each sale once it is closed at the till. The body is JSON:
| Field | Type | Notes |
|---|---|---|
transactionIdRequired | string, up to 64 | The till's receipt or transaction number. Must be unique within the shop; it is what makes retries safe. |
occurredAtRequired | ISO 8601 date-time | When the sale happened. Include the time zone offset or Z, for example 2026-10-18T14:02:11+03:00. Up to 24 hours in the future is accepted, for clock drift. |
totalAmountRequired | number ≥ 0 | The sale total before discount and taxes are applied. |
discountoptional | number ≥ 0 | Defaults to 0. |
totalTaxesoptional | number ≥ 0 | Defaults to 0. |
netTotaloptional | number ≥ 0 | What the customer paid. Defaults to totalAmount − discount + totalTaxes. Turnover rent is worked out from this figure. |
currencyCodeoptional | string | Defaults to USD. Must be a currency the mall has set up with an exchange rate. |
saleTypeIdoptional | integer | One of the mall's sale type ids. |
paymentsoptional | array, up to 50 | How the customer paid. See below. |
Each entry in payments:
| Field | Type | Notes |
|---|---|---|
paymentAmountRequired | number ≥ 0 | The amount paid this way. |
paymentMethodoptional | integer | One of the mall's payment method ids. |
paymentCurrencyoptional | string | Defaults to the sale's currency. |
Amounts are rounded to 2 decimal places. Amounts can't be negative; ask the mall team which sale type to use for refunds and returns.
curl https://api.salesift.com/salesApi/shops/14/sales \
-H "api-key: $SALESIFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transactionId": "T-48213",
"occurredAt": "2026-10-18T14:02:11+03:00",
"totalAmount": 99.00,
"discount": 9.10,
"totalTaxes": 0,
"currencyCode": "USD",
"saleTypeId": 1,
"payments": [
{ "paymentMethod": 1, "paymentAmount": 89.90 }
]
}'// Node 18+ (built-in fetch)
const res = await fetch(
`https://api.salesift.com/salesApi/shops/${shopId}/sales`,
{
method: "POST",
headers: {
"api-key": process.env.SALESIFT_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
transactionId: receipt.number, // unique per shop
occurredAt: receipt.closedAt.toISOString(),
totalAmount: receipt.total,
discount: receipt.discount,
totalTaxes: receipt.tax,
currencyCode: "USD",
saleTypeId: 1,
payments: [{ paymentMethod: 1, paymentAmount: receipt.paid }],
}),
}
);
if (res.status === 201 || res.status === 200) {
const sale = await res.json(); // 200 means it was already stored
markSent(receipt, sale.id);
} else if (res.status >= 500 || res.status === 429) {
retryLater(receipt); // safe: same transactionId
} else {
const { error } = await res.json().catch(() => ({}));
logRejected(receipt, res.status, error?.message);
}# Python 3 with requests
import os, requests
res = requests.post(
f"https://api.salesift.com/salesApi/shops/{shop_id}/sales",
headers={"api-key": os.environ["SALESIFT_API_KEY"]},
json={
"transactionId": receipt["number"],
"occurredAt": receipt["closed_at"].isoformat(),
"totalAmount": receipt["total"],
"discount": receipt["discount"],
"totalTaxes": receipt["tax"],
"currencyCode": "USD",
"saleTypeId": 1,
"payments": [{"paymentMethod": 1, "paymentAmount": receipt["paid"]}],
},
timeout=10,
)
if res.status_code in (200, 201):
sale = res.json() # 200: this transactionId was already stored
elif res.status_code >= 500:
retry_later(receipt) # safe to resend with the same transactionId
else:
print(res.status_code, res.text)Response
201 Created with the stored sale. Keep its id if you may need to correct the sale later. netTotalSystem is the net total in the mall's reporting currency, using fxRate.
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": 90412,
"transactionId": "T-48213",
"version": 1,
"shopId": 14,
"occurredAt": "2026-10-18T11:02:11.000Z",
"currencyCode": "USD",
"totalAmount": 99,
"discount": 9.1,
"totalTaxes": 0,
"netTotal": 89.9,
"fxRate": 1,
"netTotalSystem": 89.9,
"payments": [
{ "paymentMethod": 1, "paymentCurrency": "USD", "paymentAmount": 89.9 }
]
}Retries and duplicates
Networks fail. When a request times out you can't know whether Salesift stored the sale, so send it again with the same transactionId:
- If the first request was stored, the retry answers
200 OKwith the stored sale and saves nothing new. - If it wasn't, the retry stores it and answers
201 Created.
So a sale is never counted twice. Treat both 200 and 201 as success.
A sending pattern that holds up
- Save each closed sale in a local queue on the till before sending.
- Send it. On
200or201, mark it sent. - On a timeout, a network error or a
5xx, keep it in the queue and retry with growing gaps: 10 seconds, 1 minute, 5 minutes, then every 15 minutes. - On a
400,403or404, stop retrying that sale: it won't succeed unchanged. Log the message and tell the shop. - When the till comes back online after an outage, send the queue oldest first.
occurredAtkeeps each sale on the right day and hour.
Correct a sale
Send only the fields that change, plus a modificationReason (up to 255 characters). Salesift keeps the original and saves the change as a new version with a new id, returned with 202 Accepted. Totals and rent use the newest version.
curl -X PUT https://api.salesift.com/salesApi/shops/14/sales/90412 \
-H "api-key: $SALESIFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"discount": 19.10,
"modificationReason": "Discount left off at the till"
}'- Always correct the newest version. Using an older id answers
409 Conflictwith This sale was already modified; use its newest id. - The key's role needs the update sale permission. Without it, the request answers
403; ask the mall team.
Replace a sale's payments
The body is a JSON array of payments, as above. It replaces the sale's payments, saves a new version with a new id and answers 201 Created. It needs the same update sale permission.
curl -X PUT https://api.salesift.com/salesApi/shops/14/sales/90413/payments \
-H "api-key: $SALESIFT_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{ "paymentMethod": 1, "paymentAmount": 50.00 },
{ "paymentMethod": 2, "paymentAmount": 29.90 }
]'Read sales back
Lists the shop's sales between two ISO 8601 date-times, newest first, up to 20,000 per request. Use it to reconcile the till against Salesift at the end of the day.
The shop's total for the current month.
# Your shop's sales for one day, newest first
curl "https://api.salesift.com/salesApi/sales?shopId=14&from=2026-10-18T00:00:00%2B03:00&to=2026-10-19T00:00:00%2B03:00" \
-H "api-key: $SALESIFT_API_KEY"
# This month's total for the shop
curl https://api.salesift.com/salesApi/shops/14/monthly \
-H "api-key: $SALESIFT_API_KEY"Errors
Errors answer JSON with a readable message in error.message:
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"status": { "code": 400, "message": "totalAmount is required", ... },
"data": null,
"error": { "message": "totalAmount is required" }
}| Status | Meaning | What to do |
|---|---|---|
200 | This transactionId was already stored. | Success. Mark the sale sent. |
201 / 202 | Stored. | Success. |
400 | The body is wrong: a missing or negative amount, a bad date, an unknown currency, sale type or payment method. | Fix the data; don't retry unchanged. |
401 / 403 | The key is missing, wrong, expired or revoked, or its role lacks the permission. These may come back with no JSON body. | Check the header; ask for a new key. |
404 | The shop or sale doesn't exist, or the key belongs to another shop. | Check the shop id in the URL. |
409 | The sale was already corrected. | Correct its newest version. |
413 | The body is over 1 MB. | Send one sale per request. |
5xx | A problem on Salesift's side. | Retry later with the same transactionId. |
Common messages: transactionId is required, transactionId is too long, occurredAt must be a date, occurredAt is in the future, totalAmount must be a positive number, Unknown currency EUR, Currency EUR has no exchange rate set, Unknown saleTypeId, Too many payments, Shop does not exist.
Limits and good practice
- One sale per request, bodies up to 1 MB, up to 50 payments per sale.
- There is no per-key rate limit today. Send sales as they close, and when sending a backlog keep to a few requests at a time.
- Send
occurredAtfrom the till's clock with its offset, and keep the clock synced. Salesift files sales on the mall's local day and hour. - Reuse one HTTPS connection (keep-alive) when sending many sales.
- Never send card numbers, customer names or other personal data. Salesift needs amounts, times and ids only.
Go-live checklist
- A test sale answers
201and shows on the shop's dashboard in Salesift. - Sending the same test sale again answers
200and the total doesn't change. - Turning the network off queues sales, and they arrive once it's back.
- A sale with a wrong currency answers
400and is logged, not retried forever. - The key lives in the till's secure settings, and someone owns renewing it before it expires.