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.
Create a new coupon
Authorizations:
path Parameters
projectID required | string ID of the project |
Request Body schema: application/jsonrequired
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
- Payload
{- "id": "manual-50-percent-discount",
- "channels": [
- "app"
], - "type": "manual",
- "redeemType": "multiple",
- "processingType": "builtin",
- "translations": {
- "name": {
- "en": "Discount 50%",
- "de": "Rabatte 50%"
}, - "description": {
- "en": "Special discount with a whopping 50%",
- "de": "Sonderrabatte mit ganzem 50%"
}
}, - "validFrom": "2021-04-26T00:00:00+02:00",
- "validUntil": "2021-07-26T00:00:00+02:00"
}
Response samples
- 201
- 400
- 422
- default
{- "id": "special-offer-123456",
- "projectID": "another-project",
- "channels": [
- "app"
], - "type": "manual",
- "redeemType": "multiple",
- "processingType": "builtin",
- "name": "Rabatte 50%",
- "description": "Sonderrabatte mit ganzem 50%",
- "translations": {
- "name": {
- "en": "Discount 50%",
- "de": "Rabatte 50%"
}, - "description": {
- "en": "Special discount with a whopping 50%",
- "de": "Sonderrabatte mit ganzem 50%"
}
}, - "validFrom": "2021-04-26T00:00:00+02:00",
- "validUntil": "2021-07-26T00:00:00+02:00",
- "links": {
}
}
Retrieve a coupon
Retrieve a coupon
Authorizations:
path Parameters
projectID required | string ID of the project |
couponID required | string ID of a coupon |
Responses
Response samples
- 200
- 404
- default
{- "id": "special-offer-123456",
- "projectID": "another-project",
- "channels": [
- "app"
], - "type": "manual",
- "redeemType": "multiple",
- "processingType": "builtin",
- "name": "Rabatte 50%",
- "description": "Sonderrabatte mit ganzem 50%",
- "translations": {
- "name": {
- "en": "Discount 50%",
- "de": "Rabatte 50%"
}, - "description": {
- "en": "Special discount with a whopping 50%",
- "de": "Sonderrabatte mit ganzem 50%"
}
}, - "validFrom": "2021-04-26T00:00:00+02:00",
- "validUntil": "2021-07-26T00:00:00+02:00",
- "links": {
}
}
Update an existing coupon
Update an existing coupon
Authorizations:
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/jsonrequired
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
- Payload
{- "channels": [
- "app"
], - "type": "manual",
- "redeemType": "multiple",
- "processingType": "builtin",
- "translations": {
- "name": {
- "en": "Discount 50%",
- "de": "Rabatte 50%"
}, - "description": {
- "en": "Special discount with a whopping 50%",
- "de": "Sonderrabatte mit ganzem 50%"
}
}, - "validFrom": "2021-04-26T00:00:00+02:00",
- "validUntil": "2021-07-26T00:00:00+02:00"
}
Response samples
- 200
- 400
- 412
- 422
- default
{- "id": "special-offer-123456",
- "projectID": "another-project",
- "channels": [
- "app"
], - "type": "manual",
- "redeemType": "multiple",
- "processingType": "builtin",
- "name": "Rabatte 50%",
- "description": "Sonderrabatte mit ganzem 50%",
- "translations": {
- "name": {
- "en": "Discount 50%",
- "de": "Rabatte 50%"
}, - "description": {
- "en": "Special discount with a whopping 50%",
- "de": "Sonderrabatte mit ganzem 50%"
}
}, - "validFrom": "2021-04-26T00:00:00+02:00",
- "validUntil": "2021-07-26T00:00:00+02:00",
- "links": {
}
}
Delete an existing coupon
Delete an existing coupon
Authorizations:
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
- 412
- default
{- "error": {
- "type": "string",
- "message": "string"
}
}
Upload a new image
Upload a new image
Authorizations:
path Parameters
projectID required | string ID of the project |
Request Body schema: multipart/form-datarequired
file | string <binary> |
Responses
Response samples
- 201
- 400
- 422
- default
{- "ref": "gs://images.snabble.io/project-123/coupons/204cb6b1054699c7c3d2539ae7d783e67fabf38e-example.png"
}