API Reference

Discounts

Discount definitions (read-only inventory).

GET
/v1/discounts

Authorization

apiKey
headerAuthorizationBearer <token>

A Formtoro API key minted in Settings → Connections. A key carries one or more scopes; an endpoint refuses a key that lacks its required scope with 403 insufficient_scope. Scopes:

  • analytics:read — all aggregate read endpoints.
  • customers:read — customer-level lifetime value.
  • forms:write — create and edit forms (drafts). Grantable only by a member who holds the Form-editing permission.
  • forms:publish — save versions and turn forms on or off on the live storefront. Grantable only by a member who holds the Form-publishing permission.
  • discounts:read — read discount definitions. Grantable only by a member who holds the Discounts-view permission.

Query Parameters

active?boolean

When true, return only active definitions. Default returns all (active + archived).

Response Body

The shop's discount definitions.

application/json
  1. response
data*array<>

Endpoint-specific payload.

meta*
curl -X GET 'https://public-api.formtoro.com/v1/discounts'
{  "meta": {    "requestId": "string",    "shopId": "string",    "credentialId": "string",    "range": {      "from": "2019-08-24T14:15:22Z",      "to": "2019-08-24T14:15:22Z"    }  },  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "status": "active",      "config": {},      "createdAt": "2019-08-24T14:15:22Z"    }  ]}
GET
/v1/discounts/{id}

Authorization

apiKey
headerAuthorizationBearer <token>

A Formtoro API key minted in Settings → Connections. A key carries one or more scopes; an endpoint refuses a key that lacks its required scope with 403 insufficient_scope. Scopes:

  • analytics:read — all aggregate read endpoints.
  • customers:read — customer-level lifetime value.
  • forms:write — create and edit forms (drafts). Grantable only by a member who holds the Form-editing permission.
  • forms:publish — save versions and turn forms on or off on the live storefront. Grantable only by a member who holds the Form-publishing permission.
  • discounts:read — read discount definitions. Grantable only by a member who holds the Discounts-view permission.

Path Parameters

id*string

The discount definition's UUID. A non-existent / foreign id resolves to 404.

Formatuuid

Response Body

The discount definition.

application/json
  1. response
data*

A discount definition, trimmed to what's needed to reference it in a form. Use id as a form's settings.reward.discountDefinitionId. Only status: active discounts should be referenced.

meta*
curl -X GET 'https://public-api.formtoro.com/v1/discounts/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "meta": {    "requestId": "string",    "shopId": "string",    "credentialId": "string",    "range": {      "from": "2019-08-24T14:15:22Z",      "to": "2019-08-24T14:15:22Z"    }  },  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "status": "active",    "config": {},    "createdAt": "2019-08-24T14:15:22Z"  }}