Skip to content
Try For Free
Bizstim
Free tools
Pricing Contact Log in
Try For Free Book Demo
Home / API Reference / Discounts
Resource

Discounts

Discount codes clients can apply when they pay, with their limits and the services they cover.

The discount object

Every discount record carries these fields in this order, after object, which is always "discount".

FieldTypeDescription
idinteger
usesintegerHow many times one client can use the code; 0 = no limit. The owner and staff are not limited.
secretinteger0 = public (clients and agents can use it), 1 = secret (only the owner and staff can apply it).
expiresstring, up to 10 charactersYYYY-MM-DD. Clients can no longer use the code from this day on.
codestring, up to 256 characters
fixedinteger0 = amount is a percent, 1 = amount is a fixed sum in the account currency.
typeinteger0 = taken off the purchase, 1 = added to the client's balance as extra credit.
amountdecimalThe percent (fixed 0) or the sum in the account currency (fixed 1).
servicesstring, up to 4096 charactersComma-separated ids of the services the code is limited to (see Services); empty = any service.

Example

{
    "object": "discount",
    "id": 42,
    "uses": 1,
    "secret": 1,
    "expires": "2026-12-31",
    "code": "SPRING10",
    "fixed": 1,
    "type": 1,
    "amount": 25.5,
    "services": "3,5"
}

List discounts

GET /api/v1/discounts

Parameters

ParameterInDescription
limitqueryRecords per page, 1 to 1000 (default 100).
offsetqueryRecords to skip (default 0).

Returns

A list envelope of discount records (see Pagination).

Request

curl "https://www.bizstim.com/api/v1/discounts" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json"

Response

{
    "object": "list",
    "total": 2,
    "limit": 100,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "discount",
            "id": 42,
            "uses": 1,
            "secret": 1,
            "expires": "2026-12-31",
            "code": "SPRING10",
            "fixed": 1,
            "type": 1,
            "amount": 25.5,
            "services": "3,5"
        },
        {
            "object": "discount",
            "id": 43,
            "uses": 1,
            "secret": 1,
            "expires": "2026-12-31",
            "code": "SPRING10",
            "fixed": 1,
            "type": 1,
            "amount": 25.5,
            "services": "3,5"
        }
    ]
}

Retrieve a discount

GET /api/v1/discounts/{id}

Parameters

ParameterInDescription
idpathThe record's id.

Returns

One discount record, or 404 not_found when no record with that id exists on your account.

Request

curl "https://www.bizstim.com/api/v1/discounts/42" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json"

Response

{
    "object": "discount",
    "id": 42,
    "uses": 1,
    "secret": 1,
    "expires": "2026-12-31",
    "code": "SPRING10",
    "fixed": 1,
    "type": 1,
    "amount": 25.5,
    "services": "3,5"
}