Overview
Connect your register, web shop or ERP to Scops Loyalty through the REST API.
Scops Loyalty has a REST API that accepts and returns JSON. Your systems use it to keep members and products in sync, to record purchases and returns, and to apply points, rewards and promotions at checkout.
Environments
| Environment | API base URL | Dashboard |
|---|---|---|
| Staging | https://api.staging.scops-loyalty.com | staging.scops-loyalty.com |
| Production | https://api.production.scops-loyalty.com | production.scops-loyalty.com |
Build and test your integration on staging. When everything works, switch the base URL to production. The two environments don't share data, so set up your wallet types, campaigns and API keys in each one.
Each environment has its own API reference with every endpoint and schema: staging and production.
Authentication
Send your API key in the X-Api-Key header with every request. API keys explains how to create, store and revoke keys.
curl https://api.staging.scops-loyalty.com/wallet-types \
-H "X-Api-Key: $SCOPS_API_KEY"Invalid input returns 400 with the fields that failed validation, and a missing or revoked key returns 401.
What to integrate
| Data | When to send it | Endpoints |
|---|---|---|
| Members | When a customer joins the program, and when their details change. | POST /members, PATCH /members/{identifier} |
| Products | When your catalog changes. | POST /products, PATCH /products/{id}, POST /import/products |
| Checkout benefits | While the cart is open, before payment. | POST /promotions/evaluate/mutation, POST /rewards/evaluate/mutation, POST /transactions/calculate-deduction |
| Purchases and returns | When a sale or a return is completed. | POST /transactions |
| Existing data | Once, before you go live. | POST /import/members, POST /import/transactions |
Checkout flow shows the requests for a register and a web shop, and Bulk imports covers moving existing data in.
Transactions
- Member. Send
memberIdor the member'semail. A transaction whose email doesn't belong to any member is still saved, as unmatched, and you can match it to a member later in the dashboard. - Document identifier. Send your receipt or invoice number in
documentIdentifier. It must be unique across all transactions, and campaigns use it to link points to the purchase. - Returns. Send
type: returnand the original purchase'sdocumentIdentifierinlinkedTransactionId. The purchase must already exist in Scops Loyalty. A return campaign then takes back the points the purchase earned. - Points used. When the member pays with points, send them in
usedBenefits.unitsso they're taken from the wallet, and incustomAttributes.usedPointsso financial analytics counts them. - Products. Send each line with
sku,categoryandbrand. Campaign formulas, segments and promotions match on these values.
Every transaction sent through the API runs through your active campaigns.