Skip to content

API reference

Base URL: https://api.loranj.com. All responses are JSON. The full contract is published as an OpenAPI file; the SDK is generated and tested against it.

Public endpoints

Called from shoppers' browsers. Authenticated by the campaign key in the path and the request's Origin, which must be in the campaign's allowed domains.

| Method | Path | Purpose | | ------ | ------------------------------------- | -------------------------------------------------------------------- | | GET | /v1/campaigns/{campaignKey}/config | Campaign settings: status, dates, fields, theme, copy, legal wording | | POST | /v1/campaigns/{campaignKey}/entries | Submit an entry | | GET | /v1/health | Service health |

POST …/entries requires an Idempotency-Key header (a UUID). Repeating a request with the same key returns the first result.

Server endpoints

Called from your servers with a secret key: Authorization: Bearer sk_….

| Method | Path | Purpose | | ------ | ---------------------------------------- | ---------------------------------------------------------------------- | | GET | /v1/entries?campaignId=&cursor=&since= | Pull entries in pages (coming soon) | | GET | /v1/promo-types | The promo-type catalogue and each type's settings schema (coming soon) | | POST | /v1/campaigns | Create a campaign from code (coming soon) |

Errors

Errors use one shape:

{ "error": { "code": "code_used", "message": "This code has already been used." } }

See Results and errors for every code.