Markering Campaign & Coupon

Purpose

  • Administrate marketing campains, coupons and let you set a limit for the number of redeems.

  • Enable a partner to redeem on behalf of a customer.

Get Started

Campaign

Enables a administrator to handle campaigns.

Create new campaign

POST /marketing/campaigns
Host: https://preprod-api.almbrand.dk
Content-Type: application/json
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}
{
"campaign_code": "SUMMER2020",
"description": "Summer campaign for travel insurance.",
"start_at": "2021-06-01T12:00:00.000Z",
"end_at": "2021-07-31T11:08:57.471Z",
"max_redemptions": 200
}
response:
200 ok
{
"campaign_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
"campaign_code": "SUMMER2020",
"description": "Summer campaign for travel insurance.",
"start_at": "2021-06-01T12:00:00.000Z",
"end_at": "2021-07-31T11:08:57.471Z",
"max_redemptions": 200,
"current_redemptions": 0,
"audit": {
"created_at": "2021-05-25T11:25:31.663Z",
"created_by": "abwxyz"
}
}

List campaigns by criteria and paginated

GET /marketing/campaigns                                 - list all campaigns
Host: https://preprod-api.almbrand.dk
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}
response:
200 ok
{ elements : [
{
"campaign_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
"campaign_code": "SUMMER2020",
"description": "Summer campaign for travel insurance.",
"start_at": "2021-06-01T12:00:00.000Z",
"end_at": "2021-07-31T11:08:57.471Z",
"max_redemptions": 200,
"current_redemptions": 0,
"audit": {
"created_at": "2021-05-25T11:25:31.663Z",
"created_by": "abwxyz"
},

:

],
"page" : {
"size" : 10,
"total_elements" : 11,
"total_pages" : 2,
"number" : 0
},
"_links" : {
"next" : {
"href" : "http://preprod-api.almbrand.dk//marketing/campaigns?page=1&size=10"
}
}
}
Other criteria: 

GET /marketing/campaigns?starting_after=2021-06-01 - starting after

GET /marketing/campaigns?ending_before=2021-08-01 - ending before

GET /marketing/campaigns?page=1&size=10 - specific page

GET /marketing/campaigns?campaign_code=SUMMER2020 - with campaign_code

Get specific campaign

GET /marketing/campaigns/3fa85f64-5717-4562-b3fc-2c963f66afa6                                 
Host: https://preprod-api.almbrand.dk
Content-Type: application/json
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}
response:
200 ok
{
"campaign_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
"campaign_code": "SUMMER2020",
"description": "Summer campaign for travel insurance.",
"start_at": "2021-06-01T12:00:00.000Z",
"end_at": "2021-07-31T11:08:57.471Z",
"max_redemptions": 200,
"current_redemptions": 0,
"audit": {
"created_at": "2021-05-25T11:25:31.663Z",
"created_by": "abwxyz"
}
}

Change a campaign

PUT /marketing/campaigns/3fa85f64-5717-4562-b3fc-2c963f66afa6                                 
Host: https://preprod-api.almbrand.dk
Content-Type: application/json
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}

{
"campaign_code": "SUMMER2022",
"description": "Summer campaign for travel insurance 2022.",
"start_at": "2022-06-01T12:00:00.000Z",
"end_at": "2022-07-31T12:00:00.000",
"max_redemptions": 400
}
response:

200 ok
{
"campaign_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
"campaign_code": "SUMMER2022",
"description": "Summer campaign for travel insurance 2022.",
"start_at": "2022-06-01T12:00:00.000Z",
"end_at": "2022-07-31T12:00:00.000Z",
"max_redemptions": 400
"audit": {
"created_at": "2021-05-25T11:25:31.663Z",
"created_by": "abwxyz"
"last_modified_at": "2021-12-24T11:25:31.663Z",
"last_modified_by": "abhjik"
}
}

Delete campaign

DELETE /marketing/campaigns/3fa85f64-5717-4562-b3fc-2c963f66afa6                                 
Host: https://preprod-api.almbrand.dk
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}
response:

200 ok
{
"audit": {
"deleted_at": "2022-01-01T11:25:31.663Z",
"deleted_by": "abhjik"
}
}

Coupon

Enables a administrator to handle coupons.

Create new coupon for a campaign

POST /marketing/campaigns/3fa85f64-5717-4562-b3fc-2c963f66afa6/coupons
Host: https://preprod-api.almbrand.dk
Content-Type: application/json
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}
{
"coupon_code": "HANSWINTER034",
"customer": "customerNo:263481624"
}
response:

200 ok
{
"coupon_id": "47649701-28fa-4bba-baa3-b5784eb8a1af"
"coupon_code": "HANSWINTER034",
"customer": "customerNo:263481624"
"campaign_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"redeemed_at": "2021-06-01T12:00:00.000Z",
"redeemed_by": "email: hans.winter@example.com",
"audit": {
"created_at": "2021-05-25T11:25:31.663Z",
"created_by": "abwxyz"
}
}

List coupons by criteria for a campaign

GET /marketing/campaigns/3fa... a6/coupons     - list all coupons for a campaign
Host: https://preprod-api.almbrand.dk
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}
response:
200 ok
{ elements : [
{
"coupon_id": "47649701-28fa-4bba-baa3-b5784eb8a1af"
"coupon_code": "HANSWINTER034",
"customer": "customerNo:263481624"
"campaign_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"redeemed_at": "2021-06-01T12:00:00.000Z",
"redeemed_by": "email: hans.winter@example.com",
"audit": {
"created_at": "2021-05-25T11:25:31.663Z",
"created_by": "abwxyz"
}
}
:

],
"page" : {
"size" : 10,
"total_elements" : 199,
"total_pages" : 20,
"number" : 0
},
"_links" : {
"next" : {
"href" : "http://preprod-api.almbrand.dk//marketing/campaigns/3fa... a6/coupons/?page=1&size=10"
}
}
}
Other criteria: 

GET /marketing/.../coupons?created_after=2021-06-01 - created after

GET /marketing/coupons?created_before=2021-08-01 - created before

GET /marketing/.../coupons?redeemed_after=2021-06-01 - created after

GET /marketing/coupons?redeemed_before=2021-08-01 - created before

GET /marketing/coupons?page=1&size=10 - specific page

GET /marketing/coupons?campaign_code=SUMMER2020 - with campaign_code

GET /marketing/coupons?coupon_code=HANSWIN098 - with coupon_code

Get a specific coupon

GET /marketing/campaigns/coupons/47649701-28fa-4bba-baa3-b5784eb8a1af 
Host: https://preprod-api.almbrand.dk
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}
response:
200 ok
{
"coupon_id": "47649701-28fa-4bba-baa3-b5784eb8a1af"
"coupon_code": "HANSWINTER034",
"customer": "customerNo:263481624"
"campaign_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"redeemed_at": "2021-06-01T12:00:00.000Z",
"redeemed_by": "email: hans.winter@example.com",
"audit": {
"created_at": "2021-05-25T11:25:31.663Z",
"created_by": "abwxyz"
}
}

Delete a specific campaign

DELETE /marketing/campaigns/coupons/47649701-28fa-4bba-baa3-b5784eb8a1af 
Host: https://preprod-api.almbrand.dk
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}
response:
200 ok
{
"audit": {
"deleted_at": "2021-05-25T11:25:31.663Z",
"deleted_by": "abwxyz"
}
}

Redemption

Enables a customer to redeem a coupon.

Redeem a coupon by campaign_code

POST/marketing/campaigns/coupons/redemption 
Host: https://preprod-api.almbrand.dk
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}
{
"redeemed_by": "email:hans.winter@example.com",
"campaign_code": "SUMMER2021"
}
response:
200 ok
{
"redeemed_at": "2021-05-25T12:54:56.184Z",
}

Redeem a coupon by coupon_code

POST/marketing/campaigns/coupons/redemption 
Host: https://preprod-api.almbrand.dk
Accept: application/json
Authorization: Bearer {{access_token}}
ocp-apim-subscription-key: {{subcription_key}}
{
"redeemed_by": "email:hans.winter@example.com",
"coupon_code": "HANSWINTER034"
}
response:
200 ok
{
"redeemed_at": "2021-05-25T12:54:56.184Z",
}