LoyumiDevelopers
START HERE

Build one correct loyalty loop.

Create a Sandbox program, award one order exactly once, read the balance, and prove the return path before production.

Public · no accountSandbox firstContract version 1.2.0

Start with the least technical surface that fits.

You can begin with guided configuration and move toward direct API control without changing the loyalty model.

Available
01

Guided dashboard

Choose a blueprint, create a Sandbox program, add members, and configure rewards without writing code.

Open merchant setup
Merchant preview
03

Widget Studio

Compose a schema-driven, device-local draft. A production storefront runtime is not yet generally available.

Understand the preview

Make one order earn exactly once.

This walkthrough uses synthetic Sandbox identifiers. Replace every angle-bracket value with one created in your own Sandbox.

  1. 1

    Create and activate a Sandbox program

    Choose a blueprint, review its earn rule, and keep production locked. Record the program ID.

  2. 2

    Add one consenting test member

    Use the same external customer ID your commerce system already knows. Confirm the member is active in the same environment.

  3. 3

    Create a scoped server key

    Create a Sandbox key with events:write. Copy it once and keep it on your server—never in storefront JavaScript or a mobile binary.

  4. 4

    Send the completed order

    Use the commerce order ID for both Idempotency-Key and sourceReference. Amounts are integer minor units, so 2599 means 25.99 in a two-decimal currency.

cURL request
curl -X POST "https://app.loyumi.com/api/v1/events" \
  -H "Authorization: Bearer <sandbox-key>" \
  -H "X-Environment: <sandbox-environment-id>" \
  -H "Idempotency-Key: order-10042" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "purchase.completed",
    "programId": "<program-id>",
    "externalCustomerId": "customer-123",
    "amountMinor": 2599,
    "channel": "web",
    "sourceReference": "order-10042"
  }'
201New award committed
{
  "id": "txn_…",
  "status": "committed",
  "requestId": "req_…",
  "member": { "externalCustomerId": "customer-123", "tier": "Member" },
  "award": { "points": 25, "basePoints": 25, "campaignPoints": 0 },
  "campaigns": [],
  "referral": null,
  "coupon": null
}

Finish with evidence, not hope.

01

A new order returns 201 and one transaction ID

02

The identical retry returns 200 and idempotent: true

03

The member endpoint shows the expected balance state

04

A partial return uses returnAmountMinor and returns 201

05

Logs retain requestId without storing secret keys

06

No Sandbox credential exists in client code

NEXT
Build the mental model

Understand why these steps protect customer trust and financial control.

Read Concepts →