Skip to main content

Overview

Checkout extensions let your app take part in checkout on a store that installed it. Salesive calls your server while the buyer is checking out, and uses your answer straight away.
A buyer is waiting on every call. Answer within 3 seconds. If you do not, or your answer is not valid, Salesive carries on without you: the store’s own shipping options are shown, and the order goes through. Your app can never break a store’s checkout.

Register a callback

Register one callback URL per extension, per store, with your app token. The registration is tied to the installation behind the token, so it only ever applies to that store.
Body of a PUT: A PUT again replaces the registration. Uninstalling the app switches it off; after a reinstall, register again. The URL must be public. Salesive refuses plain http, other ports, URLs with a username or password, and any host that resolves to a private, loopback or internal address. The check is made when you register and again before every call, and redirects are never followed. For local development, use a public https tunnel. Store types. Shipping rates can only be registered on stores that ship: ecommerce stores (products) and restaurants (food). Business stores (services) and digital stores get 409 with code store_does_not_ship. Cart validation works on every store type.

How calls are signed

Every call is a POST with a JSON body, signed exactly like webhooks: the base64 HMAC-SHA256 of the raw body, keyed with your app’s signing secret, in the X-Salesive-Hmac-SHA256 header. Development installs are signed with your development signing secret when your app has one. Every body has id, topic, shopId and sentAt (ISO time). They are covered by the signature, so refuse a request whose sentAt is more than a few minutes old. Buyer contact details are never sent: no name, phone number or email address.

Shipping rates

Salesive calls you when the buyer reaches the shipping step, for orders that have items to ship (products or food; services and digital items are left out).
Request
Answer with your rates:
Response
Up to 10 rates are used. A rate that breaks a rule is dropped on its own; the others still show. An empty rates list means you have nothing for this order. What the buyer sees. Your rates appear as one shipping option, under your name, after the store’s own options. The price the buyer pays is the price from your answer, stored by Salesive; nothing the buyer’s browser sends can change it. Answers are reused for up to 10 minutes for the same order and address, and you are called again after that or after you re-register. After the sale. The order’s shipment records which rate was chosen (metadata.rateId, metadata.rateName). Use webhooks and the Orders API to pick the order up and fulfil it.

Cart validation

Salesive calls you when the buyer places the order, before anything is created.
Request
To let the order through, answer { "errors": [] }. To stop it, list what is wrong:
Response
Each error is a string or an object with message (up to 300 characters) and an optional lineId. Up to 5 messages are used. The buyer sees your messages and nothing is created: their cart stays as it was. The storefront gets 422 with code CHECKOUT_BLOCKED.
Cart validation fails open. If you time out, return an error status, or answer with something that is not valid, the order goes through. Do not rely on it for checks that must never be skipped.

Example handler

Node.js (Express)

Permissions

Both scopes are requested like any other on the OAuth scope parameter, and the merchant sees them on the consent screen. See Scopes & permissions.