NorelioDeveloper documentation

Customer state

Read one buyer's subscriptions and purchases by your account reference or by email: fields, statuses and limits.

GET /api/v1/customers/state returns the subscriptions and purchases of one of your buyers: what the partner sees in the cabinet's subscribers and order lists, for one person and machine-readable. It answers 200 always; for an unknown (or foreign) buyer both lists are empty.

The server API is for a partner whose application knows its own user: a payment is created from your server, with no button or panel on a page, and the user's state (subscriptions and purchases) is read by your own account reference. The key is the same as for the access check (API key tab in the cabinet), sent as Authorization: Bearer; the partner is identified by the key, there is no partner parameter. Rate limits are the same as for the access check: per your server's address and per key. Responses are JSON only and never cached. You can ask only about your own products and buyers: a foreign product or buyer and a non-existent one answer alike.

Request

http
GET https://app.norelio.eu/api/v1/customers/state?clientReference={reference}
GET https://app.norelio.eu/api/v1/customers/state?email={email}
Authorization: Bearer {api key}

Exactly one query parameter: clientReference (your account reference, same format) or email (the buyer's email, lower-cased as in the cabinet). Both or neither is a 400 error. By account reference, the orders carrying it are found together with the subscriptions those orders started, including their renewals.

Example by client reference
curl -s "https://app.norelio.eu/api/v1/customers/state?clientReference=acc_10294" \
  -H "Authorization: Bearer $NORELIO_API_KEY"

{"subscriptions":[{"id":"sub_4d5e6f","productId":"prod_1a2b3c","status":"active","validUntil":"2026-04-14T09:26:53.000Z","currentPeriodEnd":"2026-04-14T09:26:53.000Z","cancelAtPeriodEnd":false,"clientReference":"acc_10294"}],"purchases":[{"orderId":"ord_7k3m2p","productId":"prod_1a2b3c","paidAt":"2026-03-14T09:26:53.000Z","amount":1990,"currency":"EUR","status":"paid","clientReference":"acc_10294","refunded":false},{"orderId":"ord_9z8y7x","productId":"prod_4d5e6f","paidAt":"2026-02-01T18:03:11.000Z","amount":990,"currency":"EUR","status":"refunded","clientReference":"acc_10294","refunded":true}]}
Example by email
curl -s "https://app.norelio.eu/api/v1/customers/state?email=buyer%40example.com" \
  -H "Authorization: Bearer $NORELIO_API_KEY"

Response

200 OK with two lists. Each subscription:

FieldDescription
idThe subscription id at Norelio.
productIdThe product id.
statusThe subscription state as in the buyer's account: active — charges are running; past_due — the last charge failed and the provider is retrying; canceled — charges stopped, the paid period runs out; ended — the subscription is over.
validUntilUntil when access is paid (ISO 8601): the same date the access check returns, without grace; null when there is no access. It is the access date, not the next charge: a refund or a closed access shortens it.
currentPeriodEndEnd of the current paid period as the provider reports it, i.e. the next charge; null when unknown.
cancelAtPeriodEndtrue when charges have been stopped and the subscription runs out its period.
clientReferenceThe account reference of the order the subscription started with, or null.

Each purchase:

FieldDescription
orderIdThe order id — the same paymentId as in the webhooks.
productIdThe product id; null for a payment without a product.
paidAtWhen the payment was confirmed (ISO 8601); null while it is not.
amountThe price shown to the buyer, in the smallest currency unit (cents), without VAT — like amount in the webhook.
currencyThe currency of that price, three-letter code.
statuspaid, refunded (in full) or disputed.
clientReferenceThe account reference by the client reference rule: for a subscription renewal, the one of the order the subscription started with; null when none was passed.
refundedtrue when money went back to the buyer, in full or in part.
creditsFor a top-up purchase, the number of credits bought (from the order's snapshot); null for any other purchase.
creditsUnitFor a top-up purchase, the unit name; null for any other purchase.

Each list holds up to 50 rows, newest first. Purchases include only orders on which money actually moved: paid, refunded and disputed ones; unpaid and cancelled attempts are not shown.

Example response
{
  "subscriptions": [
    {
      "id": "sub_4d5e6f",
      "productId": "prod_1a2b3c",
      "status": "active",
      "validUntil": "2026-04-14T09:26:53.000Z",
      "currentPeriodEnd": "2026-04-14T09:26:53.000Z",
      "cancelAtPeriodEnd": false,
      "clientReference": "acc_10294"
    }
  ],
  "purchases": [
    {
      "orderId": "ord_7k3m2p",
      "productId": "prod_1a2b3c",
      "paidAt": "2026-03-14T09:26:53.000Z",
      "amount": 1990,
      "currency": "EUR",
      "status": "paid",
      "clientReference": "acc_10294",
      "refunded": false
    },
    {
      "orderId": "ord_9z8y7x",
      "productId": "prod_4d5e6f",
      "paidAt": "2026-02-01T18:03:11.000Z",
      "amount": 990,
      "currency": "EUR",
      "status": "refunded",
      "clientReference": "acc_10294",
      "refunded": true
    }
  ]
}
Unknown buyer
{
  "subscriptions": [],
  "purchases": []
}

Errors

An error from any API endpoint is JSON of one shape: an error object with code (one of the codes below) and message (a short English sentence). A 429 response carries a Retry-After header. The access check keeps its own, older error shape.

StatusCodeWhen
429rate_limitedtoo many requests in a row, from your address or with your key
401invalid_api_keythe key is missing or does not match
400invalid_requestthe body or the query is malformed; message says what exactly
403direct_checkout_not_enabledcreating payments from your server is not yet enabled for your account: the platform first reviews your purchase terms (the same review as for direct checkout)
404product_not_foundno product with this id belongs to your account, or it cannot be bought right now
502checkout_failedthe payment provider could not start the payment; retry later
404not_foundno such endpoint
405method_not_allowedthe endpoint does not accept that method
403test_key_requiredthe endpoint works only with the test API key (it starts with nrl_test_), and the request came with the live key
404test_order_not_foundno test order with this id belongs to your account, or it has already been deleted: test orders live for 30 days
409test_action_not_allowedthe action is not possible in the test order's current state, such as a refund of an order not yet paid or a renewal of a canceled subscription; message names the reason
Example error
{
  "error": {
    "code": "direct_checkout_not_enabled",
    "message": "Creating payments from your server is enabled after the platform has reviewed your purchase terms. Ask support from the cabinet's Messages section."
  }
}