Getting started
Base URL
Section titled “Base URL”https://api.uptools.io/v1/trustorderEvery path on these pages is relative to it. Requests and responses are JSON (Content-Type: application/json).
API key
Section titled “API key”- Sign in to the upTools Console and enable TrustOrder under Products. It is free.
- On the Webshops and API keys tab add your webshop (the host name only, for example
example.com). - Create a key with New key. The Console shows it only once, so copy it right away.
Send the key in the Authorization header:
Authorization: Bearer to_live_…| Key prefix | Environment | What it sees |
|---|---|---|
to_live_ |
live | the live reports of every connected shop |
to_test_ |
test | test reports only, kept apart from live |
Use a test key while you build the integration. Reports sent with a test key never affect live verdicts.
First request
Section titled “First request”Check that the key works and see which webshop it belongs to:
curl https://api.uptools.io/v1/trustorder/me \ -H "Authorization: Bearer $TRUSTORDER_KEY"{ "shop_id": 12, "shop_name": "Example shop", "domain": "example.com", "env": "live", "account_status": "approved", "daily_check_quota": 50000, "checks_today": 132}A new account starts as pending: checks work right away, and the reports it sends are stored but count only after approval.
The integration in three calls
Section titled “The integration in three calls”- Before the order: hash the buyer’s identifiers (hashing) and ask for a verdict with
POST /check(check). - After delivery: report the outcome of the order with
PUT /signals/{order_ref}(signals). - When an order changes back: withdraw its report with
DELETE /signals/{order_ref}.
Fail open
Section titled “Fail open”TrustOrder must never stop a sale. Treat every error, and every answer that takes longer than 1.5 seconds, as allow. The server answers fast with 503 when it cannot reach its data, so a client with a short timeout stays quick.