Skip to main content

snabble Promotions API (v1)

Download OpenAPI specification:Download

All endpoints require the Authorization header to be set with a valid JWT token for the respective environment.

Retrieve active configuration

Retrieves the currently active promotion configurations for the project

Authorizations:
ApiKey
path Parameters
projectID
required
string (ProjectID)

The identifier for a particular project.

Responses

Response samples

Content type
application/json
{
  • "rounding": {
    },
  • "ranks": [
    ],
  • "groups": [
    ]
}

Retrieve configuration by id

Retrieves the promotion configuration with the given id for the project

Authorizations:
ApiKey
path Parameters
projectID
required
string (ProjectID)

The identifier for a particular project.

configID
required
integer (ConfigID)

A numeric id to identify a particular promotion configuration. This is an internal identifier.

Responses

Response samples

Content type
application/json
{
  • "rounding": {
    },
  • "ranks": [
    ],
  • "groups": [
    ]
}

Update configuration

Update an existing promotion configuration

Authorizations:
ApiKey
path Parameters
projectID
required
string (ProjectID)

The identifier for a particular project.

configID
required
integer (ConfigID)

A numeric id to identify a particular promotion configuration. This is an internal identifier.

Request Body schema: application/json
required
object
id
required
integer (ConfigID)

A numeric id to identify a particular promotion configuration. This is an internal identifier.

projectID
string (ProjectID)

The identifier for a particular project.

active
boolean

Whether or not this is the currently active promotion for a project.

object (RoundingConfig)

The rounding strategy to use when calculating promotions.

Array of items

The ranks in this configuration. Each rule belongs to a rank. The rules will be evaluation in the order of their ranks.

Array of items

The groups of rules in this configuration. The groups are applied in the order they are specified. If a group specifies a condition it is skipped if the condition is not fulfilled.

Responses

Request samples

Content type
application/json
{
  • "rounding": {
    },
  • "ranks": [
    ],
  • "groups": [
    ]
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Retrieve configurations

Retrieve all the promotion configurations for a project, only one of which can be active.

Authorizations:
ApiKey
path Parameters
projectID
required
string (ProjectID)

The identifier for a particular project.

Responses

Response samples

Content type
application/json
{
  • "configurations": [
    ]
}

Create configuration

Create a new promotion configuration for the project

Authorizations:
ApiKey
path Parameters
projectID
required
string (ProjectID)

The identifier for a particular project.

Request Body schema: application/json
required
object
id
required
integer (ConfigID)

A numeric id to identify a particular promotion configuration. This is an internal identifier.

projectID
string (ProjectID)

The identifier for a particular project.

active
boolean

Whether or not this is the currently active promotion for a project.

object (RoundingConfig)

The rounding strategy to use when calculating promotions.

Array of items

The ranks in this configuration. Each rule belongs to a rank. The rules will be evaluation in the order of their ranks.

Array of items

The groups of rules in this configuration. The groups are applied in the order they are specified. If a group specifies a condition it is skipped if the condition is not fulfilled.

Responses

Request samples

Content type
application/json
{
  • "rounding": {
    },
  • "ranks": [
    ],
  • "groups": [
    ]
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Activate configuration

Set an active configuration to be the active one

Authorizations:
ApiKey
path Parameters
projectID
required
string (ProjectID)

The identifier for a particular project.

configID
required
integer (ConfigID)

A numeric id to identify a particular promotion configuration. This is an internal identifier.

Responses