Skip to main content

snabble coupon API (v1)

Download OpenAPI specification:Download

All endpoints require the Authorization header to be set with a valid JWT token for the respective environment. The endpoints are for managing and modifying coupons. This will typically be done by a project admin in the Retailer Portal or by direct access.

public

Public API to manage coupons.

Retrieve the list of coupons

Retrieve the list of coupons

Authorizations:
None
path Parameters
projectID
required
string

ID of the project

Responses

Response samples

Content type
application/json
{}

Create a new coupon

Authorizations:
None
path Parameters
projectID
required
string

ID of the project

Request Body schema: application/json
required
object
channels
required
Array of strings (CouponChannels)
Items Enum: "app" "sco"

List of distribution channels

type
required
string (CouponType)

Discriminator to distinguish different kinds of coupons

redeemType
string (CouponRedeemType)
Enum: "once-per-scanned-code" "once-per-app-user-id" "multiple"

Discriminator to distinguish different ways to redeem a coupon

processingType
string (CouponProcessingType)
Enum: "custom" "none" "builtin"

How to process coupons

requiresLoyaltyCard
boolean (RequiresLoyaltyCardType)

Coupon requires loyalty card for redemption

validFrom
string <date-time> (ValidFrom)

The date and time the coupon is valid from (inclusive)

validUntil
string <date-time> (ValidUntil)

The date and time the coupon is valid until (inclusive)

object (AdditionalAttributes)

Additional attributes of a coupon

Responses

Request samples

Content type
application/json
Example
{
  • "id": "manual-50-percent-discount",
  • "channels": [
    ],
  • "type": "manual",
  • "redeemType": "multiple",
  • "processingType": "builtin",
  • "translations": {
    },
  • "validFrom": "2021-04-26T00:00:00+02:00",
  • "validUntil": "2021-07-26T00:00:00+02:00"
}

Response samples

Content type
application/json
Example
{
  • "id": "special-offer-123456",
  • "projectID": "another-project",
  • "channels": [
    ],
  • "type": "manual",
  • "redeemType": "multiple",
  • "processingType": "builtin",
  • "name": "Rabatte 50%",
  • "description": "Sonderrabatte mit ganzem 50%",
  • "translations": {
    },
  • "validFrom": "2021-04-26T00:00:00+02:00",
  • "validUntil": "2021-07-26T00:00:00+02:00",
}

Retrieve a coupon

Retrieve a coupon

Authorizations:
None
path Parameters
projectID
required
string

ID of the project

couponID
required
string

ID of a coupon

Responses

Response samples

Content type
application/json
Example
{
  • "id": "special-offer-123456",
  • "projectID": "another-project",
  • "channels": [
    ],
  • "type": "manual",
  • "redeemType": "multiple",
  • "processingType": "builtin",
  • "name": "Rabatte 50%",
  • "description": "Sonderrabatte mit ganzem 50%",
  • "translations": {
    },
  • "validFrom": "2021-04-26T00:00:00+02:00",
  • "validUntil": "2021-07-26T00:00:00+02:00",
}

Update an existing coupon

Update an existing coupon

Authorizations:
None
path Parameters
projectID
required
string

ID of the project

couponID
required
string

ID of a coupon

header Parameters
If-Match
required
string

The ETag of the resource. If the provided ETag does not match the current ETag of the resource, the request will fail with a 412 Precondition Failed error. Asterisk is supported as wildcard.

Request Body schema: application/json
required
object
channels
required
Array of strings (CouponChannels)
Items Enum: "app" "sco"

List of distribution channels

type
required
string (CouponType)

Discriminator to distinguish different kinds of coupons

redeemType
string (CouponRedeemType)
Enum: "once-per-scanned-code" "once-per-app-user-id" "multiple"

Discriminator to distinguish different ways to redeem a coupon

processingType
string (CouponProcessingType)
Enum: "custom" "none" "builtin"

How to process coupons

requiresLoyaltyCard
boolean (RequiresLoyaltyCardType)

Coupon requires loyalty card for redemption

validFrom
string <date-time> (ValidFrom)

The date and time the coupon is valid from (inclusive)

validUntil
string <date-time> (ValidUntil)

The date and time the coupon is valid until (inclusive)

object (AdditionalAttributes)

Additional attributes of a coupon

Responses

Request samples

Content type
application/json
Example
{
  • "channels": [
    ],
  • "type": "manual",
  • "redeemType": "multiple",
  • "processingType": "builtin",
  • "translations": {
    },
  • "validFrom": "2021-04-26T00:00:00+02:00",
  • "validUntil": "2021-07-26T00:00:00+02:00"
}

Response samples

Content type
application/json
Example
{
  • "id": "special-offer-123456",
  • "projectID": "another-project",
  • "channels": [
    ],
  • "type": "manual",
  • "redeemType": "multiple",
  • "processingType": "builtin",
  • "name": "Rabatte 50%",
  • "description": "Sonderrabatte mit ganzem 50%",
  • "translations": {
    },
  • "validFrom": "2021-04-26T00:00:00+02:00",
  • "validUntil": "2021-07-26T00:00:00+02:00",
}

Delete an existing coupon

Delete an existing coupon

Authorizations:
None
path Parameters
projectID
required
string

ID of the project

couponID
required
string

ID of a coupon

header Parameters
If-Match
required
string

The ETag of the resource. If the provided ETag does not match the current ETag of the resource, the request will fail with a 412 Precondition Failed error. Asterisk is supported as wildcard.

Responses

Response samples

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

Upload a new image

Upload a new image

Authorizations:
None
path Parameters
projectID
required
string

ID of the project

Request Body schema: multipart/form-data
required
file
string <binary>

Responses

Response samples

Content type
application/json
{
  • "ref": "gs://images.snabble.io/project-123/coupons/204cb6b1054699c7c3d2539ae7d783e67fabf38e-example.png"
}