Skip to main content
GET
https://api.dintero.com/v1
/
accounts
/
{aid}
/
discounts
/
rules
Discount collection
curl --request GET \
  --url https://api.dintero.com/v1/accounts/{aid}/discounts/rules \
  --header 'Authorization: Bearer <token>'
[
  {
    "requirement": {
      "purchase_from": "2023-11-07T05:31:56Z",
      "purchase_to": "2023-11-07T05:31:56Z",
      "customer": {
        "addresses": [
          {
            "country": [
              "NO"
            ],
            "postal_code": [
              "0349"
            ],
            "postal_place": [
              "Oslo"
            ],
            "custom_type": [
              "offsite"
            ],
            "type": [
              "custom"
            ]
          }
        ],
        "company": {
          "bussiness_name": [
            "TKP tech AS"
          ],
          "department": [
            "production",
            "research"
          ],
          "industry": [
            "J62.0.1",
            "J62.0.2"
          ],
          "number_of_employees": [
            "20"
          ],
          "organization_number": [
            "123456789MVA"
          ],
          "website": [
            "https://dintero.com"
          ]
        },
        "date_of_birth": [
          "1990-09-20",
          "1990-05-10"
        ],
        "enrolled_by": {
          "type": [
            "url"
          ],
          "value": [
            "https://mypage.example.dintero.com"
          ]
        },
        "favorite_store": [
          "sc029"
        ],
        "first_name": [
          "John"
        ],
        "gender": [
          "male"
        ],
        "last_name": [
          "Doe"
        ],
        "marketing_consent": {
          "email": {
            "consent": [
              "true"
            ]
          },
          "sms": {
            "consent": [
              "true"
            ]
          }
        },
        "status": [
          "vip"
        ],
        "term": {
          "id": [
            "<string>"
          ]
        },
        "type": [
          "<string>"
        ],
        "attributes": {}
      },
      "item": {
        "quantity": 0,
        "mixes": [
          {
            "quantity": 1,
            "reward_eligible": true,
            "items": [
              {
                "id": "b714118"
              },
              {
                "group_id": "g4"
              }
            ]
          }
        ],
        "items": [
          {
            "id": "b714118",
            "group_id": "B1"
          }
        ]
      },
      "store_ids": [
        "sc029"
      ],
      "gross_amount": 0,
      "net_amount": 0,
      "currencies": [
        {
          "anything-but": [
            "NOK"
          ]
        }
      ],
      "stamp": 5,
      "discount_code": "TACO",
      "store": {
        "id": [
          "sc029"
        ],
        "name": [
          "SC Oslo"
        ],
        "business_name": [
          "SC Oslo AS"
        ],
        "address": {
          "country": [
            "NO"
          ],
          "postal_code": [
            "0349"
          ],
          "postal_place": [
            "Oslo"
          ]
        },
        "chain": [
          "SuperChain"
        ],
        "email": [
          "contact@superchain.com"
        ],
        "gln": [
          "5790001398644"
        ],
        "organization_number": [
          "123456789MVA"
        ],
        "phone_number": [
          "+4738260107"
        ],
        "mcc": [
          5814
        ],
        "mcc_ranges": [
          {
            "start": 5814,
            "end": 5815
          }
        ],
        "bax": [
          "102603"
        ],
        "terminal_id": [
          "T0292"
        ]
      }
    },
    "reward": {
      "type": "discount_amount",
      "value": 10000,
      "values": [
        {
          "items": [
            {
              "id": "b714118",
              "group_id": "B1"
            }
          ],
          "value": 123
        }
      ],
      "base": "gross",
      "effect": "discount"
    },
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created_at": "2023-11-07T05:31:56Z",
    "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
    "updated_at": "2023-11-07T05:31:56Z",
    "deleted_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
    "deleted_at": "2023-11-07T05:31:56Z",
    "campaign_id": "<string>",
    "active": true,
    "private": false,
    "updated_by": "3d1e4824-5474-48e7-a369-4f603fa4c5b8",
    "type": "item",
    "name": "Spar 100,-",
    "receipt_text": "Mai Salg",
    "visible_from": "2023-11-07T05:31:56Z",
    "description": "Gjør et Stablestol kupp!",
    "limitation": {
      "dynamic_purchase_to_days": 2,
      "discount_activation": [
        {
          "type": "deactivate_if_discount_active",
          "value": "<string>"
        }
      ],
      "discount_hours": {
        "hours": [
          {
            "day": "mon",
            "start": "10:00",
            "end": "20:00"
          }
        ],
        "timezone": "Europe/Oslo"
      },
      "discount_reward_usage": 1,
      "discount_combination": -1,
      "discount_eligible": "item_eligible_for_discount",
      "discount_repeat_usage": -1,
      "stamp_expire_days": 100,
      "blacklist": [
        {
          "id": "b714118",
          "group_id": "B1"
        }
      ]
    },
    "metadata": {
      "campaign_id": "V101",
      "is_featured": true,
      "dintero:private_text:kind": "Gold"
    },
    "links": [
      {
        "href": "https://example.dintero.com/c/photos/2018/6_20_thumbnail_discount_image.png",
        "rel": "thumbnail_discount_image"
      },
      {
        "href": "https://example.dintero.com/c/photos/2018/6_20_medium_discount_image.png",
        "rel": "medium_discount_image"
      },
      {
        "href": "https://example.dintero.com/shop?utm_source=dintero&utm_medium=email&utm_campaign=spring-summer",
        "rel": "webshoop"
      },
      {
        "href": "https://example.dintero.com/newsletter/2018.pdf",
        "rel": "newletter",
        "type": "application/pdf"
      }
    ],
    "statistics": {
      "stamp": 123,
      "used": 28,
      "usage": 28,
      "amount": 280000,
      "debit_balance": 12350
    }
  }
]

Documentation Index

Fetch the complete documentation index at: https://docs.dintero.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication (token authentication) should be used for accessing the API.

Use Get Token to get an access token for client credentials. Pass the token in the request header:

Authorization: Bearer {access_token}

where the access_token is JSON Web Tokens (JWT).

Path Parameters

aid
string<^[PT]{1}\d{8}$>
required

An id that uniquely identifies the account.

Required string length: 9

Query Parameters

limit
integer
default:10

A limit on the number of objects to be returned. Limit can range between 1 and 100 items, and the default is 10 items.

Required range: 1 <= x <= 100
starting_after
string

cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, end the result contains paging_token=pt1, your subsequent call can include starting_after=pt1 in order to fetch the next page of the list.

since_datetime
string<date-time>

Only discounts added/updated/delete at or after this time is returned. NOTE: this parameter can't be combined with starting_after parameter. Retrieve next page by updating since_datetime to the latest updated_at value found in the result.

purchase_from
string<date-time>

Only discounts with requirement purchase_from at or after this time is returned.

purchase_to
string<date-time>

Only discounts with requirement purchase_to at or before this time is returned.

state
enum<string>
default:all

Indicate the state of the discounts to return

  • active: purchase range is within current timestamp
  • scheduled: purchase range is in the future
  • completed: purchase range is in the past
  • available: active and not deleted
  • deleted: discount have been deleted
  • inactive: active is set to false
Available options:
all,
active,
scheduled,
completed,
available,
deleted,
inactive
campaign_id
string[]
include
enum<string>[]

Additional fields to include for each discount

Available options:
statistics

Response

Discount collection

requirement
object
required

Discount base requirement

reward
object
required
id
string<uuid>
read-only

An UUID that uniquely identifies the resource

created_at
string<date-time>
read-only

The date-time when the resource was created

created_by
string
read-only

The ID of the user/client created the resource

Example:

"1c92f7e1-2897-4d46-bdcc-c127a914fb4e"

updated_at
string<date-time>
read-only

The date-time when the resource was last updated

deleted_by
string
read-only

The ID of the user/client created the resource

Example:

"1c92f7e1-2897-4d46-bdcc-c127a914fb4e"

deleted_at
string<date-time>
read-only
campaign_id
string

The campaign the rule belongs to

active
boolean
default:true

the discount is active and can be available for purchase (if given to any or all customers)

private
boolean
default:false

the discount will be excluded from public discount collection (GET /discounts/public/rules).

updated_by
string
read-only

The ID of the user/client that last updated the resource

Example:

"3d1e4824-5474-48e7-a369-4f603fa4c5b8"

type
enum<string>
read-only

The discount base type * receipt discount is given on receipt * item discount is given to items

Available options:
item,
receipt
name
string
Example:

"Spar 100,-"

receipt_text
string

Text that should be used when displaying the discount, e.g. on receipt

Example:

"Mai Salg"

visible_from
string<date-time>

Make the discount visible to the customer from given date. Default behavior is to only return discount to the customer where the current time is between purchase_from and purchase_to

description
string
Example:

"Gjør et Stablestol kupp!"

limitation
object
metadata
object

Additional metadata about the discount

Metadata prefixed with dintero:exclude:public: will be excluded when listing the rules from the public endpoint

and included in all other endpoints that returns discount rules

Example:
{
"campaign_id": "V101",
"is_featured": true,
"dintero:private_text:kind": "Gold"
}

Links to resources related to the discount

Example:
[
{
"href": "https://example.dintero.com/c/photos/2018/6_20_thumbnail_discount_image.png",
"rel": "thumbnail_discount_image"
},
{
"href": "https://example.dintero.com/c/photos/2018/6_20_medium_discount_image.png",
"rel": "medium_discount_image"
},
{
"href": "https://example.dintero.com/shop?utm_source=dintero&utm_medium=email&utm_campaign=spring-summer",
"rel": "webshoop"
},
{
"href": "https://example.dintero.com/newsletter/2018.pdf",
"rel": "newletter",
"type": "application/pdf"
}
]
statistics
object