Import webshop sales into the POS
A customer buys online and wants to return the item to a shop. The shop assistant scans the receipt, and the till has never heard of the sale.
Register Sale fixes that. It imports finished sales from external systems (webshops, self-checkout solutions) into ViKING POS, so the transaction exists in the estate and stores can act on it.
“Finished” is the operative word. This API is for sales that have already completed and been paid for elsewhere. To price a basket before payment, use Basket API.
Two endpoints
The base URL is https://api.fiftytwo.com/register-sale-api.
Register Sale authenticates with an Auth0-issued Bearer JWT, not a token
from auth.fiftytwo.com. The header format is identical; the issuer is not.
Ask your FiftyTwo consultant which tenant issues yours.
The flow
Processing is asynchronous. Submitting a sale returns immediately with a correlation ID; the import happens after.
Idempotency is your job
If a POST /v1/sale times out, you do not know whether the sale was accepted.
Retrying can import it twice, and a duplicate sale means a customer could
return the same goods twice.
Persist the correlation ID before you consider the submission done, and key your retry logic on your own order ID:
If the POST times out with no ID recorded, reconcile before resubmitting, ideally by checking whether the sale already exists via Transaction POS Log.
Poll with backoff
Poll from a background worker, not from the request that completes the customer’s checkout. The customer should not wait on POS import.
What the store sees
Once processed, the sale is a transaction in the estate like any other. A shop assistant can find it and process a return against it through the normal returns flow. See Returns and corrections and Handle returns.
Choosing between this and the Receipt API
The Receipt API also accepted posted receipts from external systems, and it is deprecated. New integrations should use Register Sale for writing sales in, and Transaction POS Log for reading transactions out.