Quickstart
Controlled pilot: These calls target the live external sandbox hostname. Use only merchant-scoped sandbox credentials issued directly by Sparelane.
1. Set Variables
BASE_URL="https://api.sandbox.sparelane.com.au/v1"
API_KEY="replace-with-issued-sandbox-key"
Sparelane issues sandbox API keys directly for approved pilots. Never commit a working API key.
2. Check Merchant Identity
curl "$BASE_URL/merchant" \
-H "Authorization: Bearer $API_KEY" \
-H "x-request-id: demo-request-0001"
3. Create A Customer
curl "$BASE_URL/customers" \
-X POST \
-H "Authorization: Bearer $API_KEY" \
-H "content-type: application/json" \
-d '{
"externalCustomerId": "cust_demo_001",
"displayName": "Sarah Example",
"email": "sarah.customer@example.test"
}'
4. Create A Link Authorisation
curl "$BASE_URL/customers/{customerId}/link-authorizations" \
-X POST \
-H "Authorization: Bearer $API_KEY" \
-H "content-type: application/json" \
-d '{ "expiresInMinutes": 30 }'
The invitation token is returned once. Consumer approval happens outside merchant API credentials.
5. Submit A Bill
curl "$BASE_URL/bills" \
-X POST \
-H "Authorization: Bearer $API_KEY" \
-H "content-type: application/json" \
-d '{
"externalCustomerId": "cust_demo_001",
"amountCents": 4995,
"currency": "AUD",
"dueAt": "2026-11-15T00:00:00.000Z",
"description": "Fictional monthly subscription",
"idempotencyKey": "bill-demo-2026-11-001"
}'