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.

In shortPOST 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 method 1 = Card, 2 = Cash.
  • The currency codes the mall accepts, such as USD or EUR. 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

POST/salesApi/shops/{shopId}/sales

Send each sale once it is closed at the till. The body is JSON:

FieldTypeNotes
transactionIdRequiredstring, up to 64The till's receipt or transaction number. Must be unique within the shop; it is what makes retries safe.
occurredAtRequiredISO 8601 date-timeWhen 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.
totalAmountRequirednumber ≥ 0The sale total before discount and taxes are applied.
discountoptionalnumber ≥ 0Defaults to 0.
totalTaxesoptionalnumber ≥ 0Defaults to 0.
netTotaloptionalnumber ≥ 0What the customer paid. Defaults to totalAmount − discount + totalTaxes. Turnover rent is worked out from this figure.
currencyCodeoptionalstringDefaults to USD. Must be a currency the mall has set up with an exchange rate.
saleTypeIdoptionalintegerOne of the mall's sale type ids.
paymentsoptionalarray, up to 50How the customer paid. See below.

Each entry in payments:

FieldTypeNotes
paymentAmountRequirednumber ≥ 0The amount paid this way.
paymentMethodoptionalintegerOne of the mall's payment method ids.
paymentCurrencyoptionalstringDefaults 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 }
    ]
  }'

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 OK with 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

  1. Save each closed sale in a local queue on the till before sending.
  2. Send it. On 200 or 201, mark it sent.
  3. 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.
  4. On a 400, 403 or 404, stop retrying that sale: it won't succeed unchanged. Log the message and tell the shop.
  5. When the till comes back online after an outage, send the queue oldest first. occurredAt keeps each sale on the right day and hour.

Correct a sale

PUT/salesApi/shops/{shopId}/sales/{saleId}

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 Conflict with 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

PUT/salesApi/shops/{shopId}/sales/{saleId}/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

GET/salesApi/sales?shopId={shopId}&from={date}&to={date}

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.

GET/salesApi/shops/{shopId}/monthly

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" }
}
StatusMeaningWhat to do
200This transactionId was already stored.Success. Mark the sale sent.
201 / 202Stored.Success.
400The 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 / 403The 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.
404The shop or sale doesn't exist, or the key belongs to another shop.Check the shop id in the URL.
409The sale was already corrected.Correct its newest version.
413The body is over 1 MB.Send one sale per request.
5xxA 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 occurredAt from 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 201 and shows on the shop's dashboard in Salesift.
  • Sending the same test sale again answers 200 and 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 400 and is logged, not retried forever.
  • The key lives in the till's secure settings, and someone owns renewing it before it expires.