Welcome to the Privilege API reference. This document is meant to be used in combination with https://admin.clubprivilege.ch/. All the parameters used in the curl and web samples are described here. Reach out to info@idmobile.ch if something is missing or unclear.

Members subscription flows

The below steps describe a basic ways of how a member subscription process flow with Privilege can work

Single offer campaign with no form page

Settings for a flow using a single offer campaign and a SMS subscription keyword (so, without any form page)

Settings

  1. Create a Club Merchant

  2. Create a Campaign

  3. Create an Offer

  4. Request each time you want Statistics

Display the SMS subscription keyword on any support you want (flyers, display screen, mail, ...)

Once the SMS subscription keyword is displayed to your customers, each time they send an SMS to the 494 containing the subscription keyword (e.g: BUYANDWIN), they will be registered into the Privilege database and they will receive a SMS reply containg their campaign offer link (ex: https://idtk.ch/I5Kk93). The customer will have to present this offer link to one of your shops, the QR code will be scanned (by the IDTicketing app) in order to check if customer can benefit of his advantage.

Multi offer campaign with no form page

Settings for a flow using a multi-offers campaign and a SMS subscription keyword (so, without any form page)

Settings

  1. Create a merchant

  2. Create a campaign

  3. Create each time you want an offer

  4. Request each time you want Statistics

Display the SMS subscription keyword on any support you want (flyers, display screen, mail, ...)

Once the SMS subscription keyword is displayed to your customers, each time they send an SMS to the 494 containing the subscription keyword (e.g: BUYANDWIN), they will be registered into the Privilege database and they will receive a SMS reply containg their campaign multi-offer shortened link (ex: https://idtk.ch/Zwg1qM). The customer will have to present this offer link to one of your shops, the QR code will be scanned (by the IDTicketing app) in order to check if customer can benefit of his advantage.

Single offer campaign with a landing page

Settings for a flow using a single offer campaign and a subscription form page

Settings

  1. Create a Merchant

  2. Create a Campaign using subscription form parameters

  3. Create an Offer

  4. Request each time you want Statistics

Redirect your customers to the form page URL (e.g.: https://www.clubprivilege.ch/club/#your_merchant_code#/fr/)

Once your customers are redirected to the form page URL, they will be able to fill their information in order to subscribe to your Privilege. Once, they are registered into the Privilege database, they will receive a SMS reply containg their campaign offer link (ex: https://idtk.ch/I5Kk93). The customer will have to present this offer link to one of your shops, the QR code will be scanned (by the IDTicketing app) in order to check if customer can benefit of his advantage.

Request an Access Token

To be able to use the Privilege, you have to request an access token using your backoffice credentials. An access token automatically after 7 hours, but you can request ones as many as you want.
Endpoint: https://www.clubprivilege.ch/oauth/v2/token
Method: PUT

Parameters

Parameter Format Description

client_id

41 characters

Unique account identifier (provided by our support)

client_secret

40 characters

Account generated secret key (provided by our support)

username

N characters

Your username, chose by yourself

password

N characteres

Your password, chose by yourself

Response

Variable Format Description

access_token

86 characters

Unique access token

Example

curl -X GET 
"https://www.clubprivilege.ch/oauth/v2/token?grant_type=password&client_id=##YOUR_CLIENT_ID##&client_secret=##YOUR_CLIENT_SECRET##&username=##YOUR_USERNAME##&password=##YOUR_PASSWORD##"

Get an account

Retrieve all available accounts.
Endpoint: https://www.idticketing.ch/api/accounts
Method: GET

Parameter Format Description

name

50 characters

The account name

limit

integer

Number of results

page

integer

The result page number

Response

Variable Format Description

status

boolean

enabled/disabled account

creationDate

datetime

The date when this account was created

modificationDate

datetime

The last date when this account was modified

id

integer

This is the account internal ID from database

name

50 characters

The readable name of the account

Example

curl -X GET -H "Authorization: Bearer NTk0NmIyMThmMWRhMzZhNjBmYmZiNmEzMmUxM2M1MTE3NzdiMDZkY2ExYmEzZmIxYzZhZGMzOTAxYTZkYTg5ZQ" "https://www.clubprivilege.ch/api/accounts

Create a new Merchant (or Update)

Normaly, once your are on-boarded on Privilege, then our support will create a new Club (merchant) and configure it to your needs. Also you can manage yourself your merchants account using the Privilege adminisitration https://admin.clubprivilege.ch. But in case you need to manage multiple separated Privilege merchants from your system, then this API allow you create and manage your multiple merchants account information.
Endpoint: https://www.clubprivilege.ch/api/merchant
Method: PUT

Parameter Format Description

identifier

50 characters

Your Club (merchant) identifier. This is an internal identifier (not displayed to members), and secondarily, if you need to create campaign or offer for this merchant, you will have to precise the "identifier" while calling the API service. Ex: mysite

name

50 characters

Your merchant name. It is displayed to members on some pages (landing page, tickets, ...). Ex: My Site

nameVariante1,2,3,4

50 characters

Your merchant name variantes n°1, n°2, n°3, n°4. It is displayed to members on some legal pages (ex: CGU). If not provided it will be the name which will be used. Ex: My Site, My Site SA, My Site & Associates

email

200 characters

It may be used to send you message info concerning your Privilege activity

password

250 characters

This is the password you may be used to access to the Privilege backoffice here

address

250 characters

Your merchant physical address. Ex: Route Industrielle 4, 1806 Saint-Légier-La Chiésaz, Suisse

address

250 characters

Your hotline number. By default it is IDMobile hotline number +41 848 123 400

siteUrl

250 characters

Your Club (merchant) site name. By default, it is https://www.clubprivilege.ch/club/mysite.

infosUrl

250 characters

Your owned site name. Ex: https://www.mysite.com

cguUrl

250 characters

Your owned site CGU URL. Ex: https://www.mysite.com/terms-and-conditions

shopsMapUrl

250 characters

Your owned shops map. Ex: https://www.google.com/maps/d/embed?mid=1wOM6b_b1uAa9Dz2cB8KUABi-GZi9dFob

unsubscriptionUrl

250 characters

Your owned site unsubscription URL. By default it is https://www.clubprivilege.ch/club/mysite/fr/unsubscribe

smsSender

50 characters

It is used as the sender whiling sending SMS message to the members

translations

{langue}

smsKeyword

50 characters

It is used by members as the keyword to send (to the 494) to subscribe as a member to the Merchant Privilege. The service Keyword will be created at our SMS provider and each SMS sent will trigger a notification which will subscribe the member.

mobileValidators

250 characters

This is the list of mobiles (separated by "#") which will be considered as mobile testers. They will be able to bypass some restriction and limits while using club campaigns forms and offers. Ex: 4177777777#4177888888

status

boolean

The merchant activation status (true/false). By default "true"

hidden

boolean

The merchant display status (true for hidden, false for displayed). By default "false"

secured

boolean

Activate/Secured merchant club form access by password. By default "false"

Response

Variable Format Description

id

integer

This is the Club (merchant) internal ID from Privilege database

Example

curl -X PUT 
-d "identifier=prelude&name=Prelude&email=joachim.ifergan.mogo@gmail.com&password=1234567890&smsSender=PRELUDE&smsKeyword=PRELUDE" 
-H "Authorization: Bearer YTk3MzRhZGE3YmMxMTYxMzdjNjRkM2E0MjQzMzJmOWFlNzRjMzg3YTVjZTJjNGMwN2FkMjY2MDFkYTRhNzAzYQ" 
"https://www.clubprivilege.ch/api/merchant"

Get a Merchant

You can access your Club (merchant) information through the Privilege administration. But if you need to display/manage those information from your system, you can manage those information using this API.
Endpoint : http://www.clubprivilege.ch/api/merchant/{merchantCode}
Method: GET

Parameter Format Description

merchantCode

50 characters

Unique Club (merchant) code provided at creation

Response

Variable Format Description

status

boolean

enabled/disabled merchant

creationDate

datetime

The date when this merchant was created

modificationDate

datetime

The last date when this merchant was modified

id

integer

This is the merchant internal ID from Privilege database

name

50 characters

The readable name of the merchant. It can be displayed on form or ticket pages

nameVariante1

50 characters

The readable name of the merchant. It can be displayed on legal conditions page

nameVariante2

50 characters

The readable name of the merchant. It can be displayed on legal conditions page

nameVariante3

50 characters

The readable name of the merchant. It can be displayed on legal conditions page

nameVariante4

50 characters

The readable name of the merchant. It can be displayed on legal conditions page

smsSender

15 characters (without special or space characters)

The sender name use to send SMS. It is displayed as the sender on members mobile when they receive an SMS from Privilege

smsKeyword

50 characters

The SMS keyword to send to the 494 for subscribing to the merchant Privilege

siteUrl

250 characters

unsubscriptionUrl

250 characters

shopsMapUrl

250 characters

The GoogleMaps displayed your points of sale/shops

cguUrl

250 characters

The link to your general conditions page (generally, redirecting to your website)

infosUrl

250 characters

The link to the data protection policy page. By default it is the one of Privilege https://www.clubprivilege.ch/club/#your_merchant_code#/fr/conditions

code

50 characters

This is the merchant code and URL identifier. You will have to send this identifier while using the API for this merchant

identifier

integer

This is the Mbuy customer ID related to this merchant

identifier2

integer

This is the Mbuy campaign ID related to this merchant

tags

100 characters

In case you need various URL for your Privilege, this parameter allow you to manage them (separated by "|")

address

200 characters

The main address of this merchant. It is displayed on the form page

hotlineNumber

50 characters

The hotline number of this merchant. It is displayed on the form page

mobileValidators

200 characters

In case you need to be able to make several registrations, you can specify your mobile number as a tester (separated by "#")

authorizedLanguages

100 characters

The allowed languages on this Club

hidden

boolean

If set to true, the Club (merchant) is not visible

secured

boolean

If set to true, the Club (merchant) form page is secured with a login/password

account

Account

In case you manage multiple merchants, this is your account ID

translations

{langue}

header

text

The header displayed on the form page https://www.clubprivilege.ch/club/#your_merchant_code#/fr/

translations

{langue}

conditionsIntro

text

The term of usage intro displayed on the form page https://www.clubprivilege.ch/club/#your_merchant_code#/fr/

translations

{langue}

conditionsData

text

The term of page linked on the form page https://www.clubprivilege.ch/club/#your_merchant_code#/fr/

translations

{langue}

conditionsOffline

text

The term of usage intro displayed on the form page for offline registration https://www.clubprivilege.ch/club/#your_merchant_code#/fr/

Example

curl -X GET 
-H "Authorization: Bearer YzBiNTg5ZThhNzEzZjMwODhiNTM5YzJlYzZjNmU3YjBhM2NmZTE4NDYzMGZmMzcxMzE1OGI1NGQ1ZjdlODUwNQ" 
"https://www.clubprivilege.ch/api/merchant/nestleshop"

Get a list of Merchants

You can access your Club (merchant) information through the Privilege administration. But if you need to display/manage those information from your system, you can manage those information using this API.
Endpoint : https://www.clubprivilege.ch/api/merchants
Method: GET

Parameter Format Description

id

integer

The campaign id of the campaign

identifier

characters

The merchant code

page

integer

The page number for paginated results

limit

integer

The numbers of results by page for paginated results

Response

Variable Format Description

list of merchants

Merchant

The Clubs (merchants) result list

Example

curl -X GET -H "Authorization: Bearer NTk0NmIyMThmMWRhMzZhNjBmYmZiNmEzMmUxM2M1MTE3NzdiMDZkY2ExYmEzZmIxYzZhZGMzOTAxYTZkYTg5ZQ" "http://www.dev.clubprivilege.ch/api/merchants"

Create a new Campaign (or Update)

To start your Privilege strategy, you must at least create one campaign (containing at least one offer). Campaign informations manage all content related to your Privilege form page (which is located at the address https://www.clubprivilege.ch/club/#merchant_id#/). You can manage your campaigns using the Privilege administration. But if you need to create/update a campaign from your system, then you can request those informations using this API
Endpoint: https://www.clubprivilege.ch/api/campaign
Methode: PUT

Parameter Format Description

identifier

characters (Max. 50)

The campaign identifier. You will need to manage this campaign using the identifier

name

characters (Max. 100)

The campaign name. It is using for displaying statistics and when scanning ticket using the scan app

merchant

characters (Max. 50)

The Club (merchant) identifier to which this campaign belong to

startDate

datetime

The start date of the campaign. Starting that date the configuration of this campaign will be used for the form page

endDate

datetime

The end date of the campaign. Ending that date the configuration of this campaign will not be used anymore for the form page

status

boolean

The campaign activation status. By default true

main

boolean

If that campaign is the club principal campaign, then its configuration will be used on the default club form page. By default false

publishStatus

boolean

The publication status of the campaign (STATUS_DRAFT = 1; STATUS_WAITING_FOR_VALIDATION = 2; STATUS_VALIDATED = 3; STATUS_SENDING = 4; STATUS_LIVE = 5; STATUS_CLOSED = 6; STATUS_INTERRUPTED = 7; STATUS_DELETED = 8). By default 5.

hasRegistration

boolean

If that campaign need to override the main form page, then set this parameter to true. By default false

hasDedicatedRegistration

boolean

If that campaign need to have its proper new landing page, then set this parameter to true. By default "false"

isTargetingMultipleCountries

boolean

If members can comes from various countries then set this parameter to true. If they only comes from Switzerlland then set this parameter to false

presentationHeaderImage

250 characters

The header image used on the main home of Privilege

formHeaderImage

250 characters

The header image used on the form page

formBackgroundImage

250 characters

The background image used on the form page

sharedImage

250 characters

The image used when sharing a Privilege page (form, ticket, ...) on social networks

translations

{langue}

formTitle

250 characters

The title of the form page. You can precise the {langue} (e.g: formTitleFr or formTitleEn or formTitleIt or formTitleDe) to set the translation of that title. If none langue is used (e.g: formTitle) the default langue is "fr".

translations

{langue}

formSubtitle

250 characters

The subtitle of the form page. You can precise the {langue} (e.g: formSubtitleFr or formSubtitleEn or formSubtitleIt or formSubtitleDe) to set the translation of that subtitle. If none langue is used (e.g: formSubtitle) the default langue is "fr".

translations

{langue}

formIntroduction

250 characters

The introduction of the form page. You can precise the {langue} (e.g: formIntroductionFr or formIntroductionEn or formIntroductionIt or formIntroductionDe) to set the translation of that introduction. If none langue is used (e.g: formIntroduction) the default langue is "fr".

translations

{langue}

formFieldsTitle

100 characters

The text displayed on club form page above fields.

translations

{langue}

formFooter

text

The text displayed on club form page below fields.

formHasFirstname

boolean

Set this parameter to true if you want to display the "firstname" entry field on the form page

formHasLastname

boolean

Set this parameter to true if you want to display the "lastname" entry field on the form page

formHasPostalCode

boolean

Set this parameter to true if you want to display the "postal code" entry field on the form page

formHasGender

boolean

Set this parameter to true if you want to display the "gender" entry field on the form page

formHasShareLinks

boolean

Set this parameter to true if you want to display the "share on social networks" buttons on the form page

hasSharedReward

boolean

Set this parameter to true if you want to generate a ticket each time a member sponsors a new member

hasScanAnwsers

boolean

Set this parameter to true if you want to send specific SMS message content to members when they consume their tickets at the shop. By default, defaults message are used

isOffline

boolean

Set this parameter to true if you want to allow subscription of members with no mobile. By default "false"

ticketValidityMinDate

datetime

The min date to consume tickets of this campaign. Starting that date the tickets will be accepted by the app scan

ticketValidityMaxDate

datetime

The max date to consume tickets of this campaign. Ending that date the tickets will not be accepted anymore by the app scan

ticketValidityMinDelay

integer

The min delay (in days) to consume tickets of this campaign after the ticket creation date. Starting that delay the tickets will be accepted by the app scan

ticketValidityMaxDelay

integer

The max delay (in days) to consume tickets of this campaign after the ticket creation date. Starting that delay the tickets will not be accepted anymore by the app scan

maxTickets

integer

The max number of tickets generated for this campaign. When limit is reached, members will not receive anymore ticket while registering on the form page

translations

{langue}

smsRegistrationConfirm

characters

The SMS text receive when members register to the Privilege using the form page. You can precise the {langue} (e.g: smsRegistrationConfirmFr or smsRegistrationConfirmEn or smsRegistrationConfirmIt or smsRegistrationConfirmDe) to send this text to members with that language set on their profil. If none langue is used (e.g: smsRegistrationConfirm) the default langue is "fr".

translations

{langue}

smsGodfatherConfirm

characters

The SMS text receive when members register to the Privilege using the form page and using a sponsored link (i.e: shared on social networks). You can precise the {langue} (e.g: smsGodfatherConfirmFr or smsGodfatherConfirmEn or smsGodfatherConfirmIt or smsGodfatherConfirmDe) to send this text to members with that language set on their profil. If none langue is used (e.g: smsGodfatherConfirm) the default langue is "fr".

translations

{langue}

smsTicketBurnConfirm

characters

The SMS text receive when members scan their ticket using the app scan. You can precise the {langue} (e.g: smsTicketBurnConfirmFr or smsTicketBurnConfirmEn or smsTicketBurnConfirmIt or smsTicketBurnConfirmDe) to send this text to members with that language set on their profil. If none langue is used (e.g: smsTicketBurnConfirm) the default langue is "fr".

hasSmsKeyword

boolean

Set this parameter to true if you want to accept member registration by sending an SMS to the 494 (e.g.: send BUYANDWIN to 494)

translations

{langue}

smsKeyword

characters (Max. 15)

The SMS keyword to send (to the 494 number) for registering to the Privilege using this campaign. You can precise the {langue} (e.g: smsKeywordFr or smsKeywordEn or smsKeywordIt or smsKeywordDe) to set the registered member language using this keyword. If none langue is used (e.g: smsKeyword) the default langue is "fr".

translations

{langue}

smsKeywordRegistrationConfirm

characters

The SMS text received when members register to the Privilege using the campaign SMS keyword. You can precise the {langue} (e.g: smsKeywordRegistrationConfirmFr or smsKeywordRegistrationConfirmEn or smsKeywordRegistrationConfirmIt or smsKeywordRegistrationConfirmDe) to send this text to members with that language set on their profil. If none langue is used (e.g: smsKeywordRegistrationConfirm) the default langue is "fr".

hasTargeting

datetime

If you want to send a mass SMS to all existing members for this club then set this parameter to true. By default "false"

smsTargetingDate

datetime

The date when mass SMS will be sent to all members targeted by the campaign

smsRetargetingDate

datetime

The date when mass SMS will be re-sent to all members targeted by the campaign

isSentAuto

boolean

Set this parameter to true if you want to send the campaign automatically. By default "false"

targetingGeoPostalCode

boolean

Set this parameter to true if you want to send the campaign automatically. By default "false"

Response

Variable Format Description

id

integer

This is the campaign internal ID from the Privilege database

Example

curl -X PUT 
-d "identifier=prelude-welcome&merchant=prelude&name=Bienvenue%20coiffeur%20Prélude&startDate=2019-01-01&endDate=2019-01-15&ticketValidityMaxDelay=30&maxTickets=100&smsKeyword=PRELUDEX&status=1&smsTicketBurnConfirm=Merci+pour+votre+visite+%21+Faites+profiter+vos+amis+en+partageant+ce+lien+https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2ioLHsnfnhs&smsKeywordRegistrationConfirm=%7B%7BofferName%7D%7D%21+Cliquez+vite+sur+le+lien+%7B%7BshortURL%7D%7D+pour+b%C3%A9n%C3%A9ficier+de+votre+avantage+%7B%7BmerchantName%7D%7D%21+Faites+profiter+vos+amis+en+partageant+ce+lien+%7B%7BrewardURL%7D%7D+%21" 
-H "Authorization: Bearer YmI1Njc3NjIxMDkxMGVkOTEyMDcwY2Q0NzJhZjBjMjQwMjU1NDE1NDAwMzkyNWMwZDdjYWU2Nzg3NGQyNmEwMQ" 
"https://www.clubprivilege.ch/api/campaign"

Get a Campaign

Campaign(s) information manage all content related to your Club form page (which is located at the address https://www.clubprivilege.ch/club/#your_merchant_code#/). You can manage your campaign(s) using the Privilege administration site. But if you need to retrieve campaign information (for example to manage the form page on your website instead of the standard one located at https://www.clubprivilege.ch/club/#your_merchant_coder#/fr/, then you can request those informations using this API.
Endpoint : https://www.clubprivilege.ch/api/campaign/{id}
Method: GET

Parameter Format Description

id

integer

The internal ID of the campaign

merchant

50 characters

The Club (merchant) code of the campaign

Response

Variable Format Description

id

integer

This is the campaign internal ID from Privilege database

status

boolean

enabled/disabled campaign

creationDate

datetime

The date when this campaign was created

modificationDate

datetime

The last date when this campaign was modified

name

50 characters

The readable name of the campaign. It can be displayed on form or ticket pages

identifier

50 characters

The campaign identifier. You need it to manage this campaign configuration or its offers ones using the API

startDate

datetime

The start date of the campaign. Starting that date the configuration of this campaign will be used for the form page

endDate

datetime

The end date of the campaign. Ending that date the configuration of this campaign will not be used anymore for the form page

publishStatus

boolean

The publication status of the campaign (STATUS_DRAFT = 1; STATUS_WAITING_FOR_VALIDATION = 2; STATUS_VALIDATED = 3; STATUS_SENDING = 4; STATUS_LIVE = 5; STATUS_CLOSED = 6; STATUS_INTERRUPTED = 7; STATUS_DELETED = 8). By default 5.

ticketValidityMinDate

datetime

The min date to consume tickets of this campaign. Starting that date the tickets will be accepted by the app scan

ticketValidityMaxDate

datetime

The max date to consume tickets of this campaign. Ending that date the tickets will not be accepted anymore by the app scan

ticketValidityMinDelay

integer

The min delay (in days) to consume tickets of this campaign after the ticket creation date. Starting that delay the tickets will be accepted by the app scan

ticketValidityMaxDate

integer

The max delay (in days) to consume tickets of this campaign after the ticket creation date. Starting that delay the tickets will not be accepted anymore by the app scan

hasRegistration

boolean

If this campaign has a registration form (main registration page) then this parameter will be set to true

hasDedicatedRegistration

boolean

If this campaign has a dedicated registration form (landing page) then this parameter will be set to true

hasScanRegistration

boolean

If this campaign has a registration form on scan app then this parameter will be set to true

hasTargeting

boolean

If this campaign has a set of members targeting criteria (form page) then this parameter will be set to true

ticketOnlyTargeted

boolean

When set to true, generates and sends a ticket at subscription only if member is targeted

isSentAuto

boolean

Set this parameter to true if you want to send the campaign automatically. By default "false"

isTargetingMultipleCountries

boolean

If registered members can comes from various countries then this parameter is set to true. If they only comes from Switerland, then it is set to false

targetingDate

datetime

The date when mass SMS will be sent to all members targeted by the campaign

retargetingDate

datetime

The date when mass SMS will be re-sent to all members targeted by the campaign

targetingGeoPostalCode

string

Target members by geographic postal code

targetingGeoState

string

Target members by geographic state

targetingGeoStatesExclude

string

Target members by geographic state to exclude

targetingGeoLangue

string

Target members by member language

targetingGeoGender

string

Target members by member gender

targetingGeoDistance

integer

Target members by geographic distance from the postal code

targetingMobileCountry

string

Target members by mobile country prefix

targetingActivesOnly

boolean

Target members actives only (burned at least one ticket)

targetingInactivesOnly

boolean

Target members inactives only (burned no ticket)

targetingCampaignOld

integer

Target members who received a ticket from an Mbuy campaign (deprecated)

targetingIncompleteOnly

boolean

Target members with missing information (firstname, lastname, postal code)

targetingMinSubscriptionDate

datetime

Target members registered after a subscription date

targetingBirthDayOnly

boolean

Target members who borned on the current day of a previous year

targetingSubscriptionDayOnly

boolean

Target members who registered on the current day of a previous year

targetingSubscription

string

Target members who subscribed using a source

targetingTicketValidShop

string

Target members who burned their tickets at a shop (scan desk)

targetingTicketBurnedStartDate

datetime

Target members who burned their tickets after a date

targetingTicketBurnedEndDate

datetime

Target members who burned their tickets before a date

targetingTicketsBurnedMinCount

integer

Target members who burned at least a number of tickets

presentationHeaderImage

250 characters

The image URL that is displayed on the main/home of Privilege

formHeaderImage

250 characters

The images URL that is displayed as the header of the merchant form page https://www.clubprivilege.ch/club/#your_merchant_code#/fr/

formBackgroundImage

250 characters

The images URL that is displayed as the background of the merchant form page https://www.clubprivilege.ch/club/#merchant_id#/fr/

formHasFirstname

boolean

This parameter is set to true if the "firstname" entry field is displayed on the form page

formHasLastname

boolean

This parameter is set to true if the "lastname" entry field is displayed on the form page

formHasPostalCode

boolean

This parameter is set to to true if the "postal code" entry field is displayed on the form page

formHasGender

boolean

This parameter is set to true if the "gender" entry field is displayed on the form page

formPersonalInfoOptional

boolean

This parameter is set to true if personal information are optional on form page

formHasCgu

boolean

This parameter is set to true if the "confirm general conditions" checkbox is displayed on the form page

formHasFieldTitle

boolean

This parameter is set to true if the form fields title is displayed on the form page

formIsProtected

boolean

This parameter is set to true if the form page is protected by a login/password

formHasShareLinks

boolean

This parameter is set to true if the "share on social networks" buttons are displayed on the form page

hasSharedReward

boolean

This parameter is set to true if a ticket is generated each time a member sponsors another new member

sharedImage

integer

The image used when sharing a Privilege page (form, ticket, ...) on social networks

hasSmsKeyword

integer

This parameter is to true if members registrations by sending an SMS to the 494 (e.g.: send BUYANDWIN to 494) are accepted

hasScanAnswers

boolean

This parameter is set to true if SMS are sent for this campaign at ticket specific scan status

maxTickets

integer

The max number of tickets generated for this campaign. When limit is reached, the form page is closed

maxBurnedTickets

integer

The max number of tickets burned for this campaign. When limit is reached, the scan app refuses next scanned tickets

maxKey

string

The max key to manage common stock for maxTickets and maxBurnedTickets

formEndRedirectionUrl

250 characters

This is the URL to redirect member to when form page is closed

formCloseSubscriptionDate

datetime

This is the date to close the form page

hasSingleTicketRegistration

boolean

If set to true, the form page will allow member to choose their offer

isOffline

boolean

If set to true, then members registration without mobile are accepted

isCloseSubscriptionDateLimitReached

boolean

If set to true, the form is closed because close subscription date is reached

isAllOffersMaxTicketsLimitReached

boolean

If set to true, the form is closed because max numbers of generated tickets is reached

main

integer

If this parameter is set to true, then it means that this will be the default campaign (in case there are no others activated campaigns available)

onConsumeStartCampaign

Campaign

Trigger the campaign registration when ticket is scanned

sentSMSsCount

integer

The number of sent SMS with this campaign

generatedTicketsCount

integer

The number of generated tickets with this campaign

burnedTicketsCount

integer

The number of scanned tickets with this campaign

targetedCustomersCount

integer

The number of members targeted with this campaign

estimatedCustomersCount

integer

The estimated number of members targeted with this campaign

merchant

Merchant

The merchant related to this campaign

offers

Offer

The offers related to this campaign

fields

CampaignField

The custom form fields related to this campaign

targetingFields

CampaignField

The targeted criteria values used by the campaign targeting

targetingCampaigns

Campaign

The campaigns to used as targeting for this campaign

translations

{langue}

presentation

text

The presentation of the Privilege displayed on the home Privilege

translations

{langue}

formTitle

250 characters

The title of the Privilege diplayed on the form page https://www.clubprivilege.ch/club/#your_merchant_code#/.

translations

{langue}

formSubtitle

250 characters

The subtitle of the Privilege campaign diplayed on the form page https://www.clubprivilege.ch/club/#your_merchant_code#/.

translations

{langue}

formFieldsTitle

250 characters

The subtitle of the Privilege campaign diplayed on the form page https://www.clubprivilege.ch/club/#your_merchant_code#/.

translations

{langue}

formIntroduction

text

The introduction of Privilege campaign diplayed on the form page https://www.clubprivilege.ch/club/#your_merchant_code#/.

translations

{langue}

formLegalOptin

text

The text label for the optin checkbox of the form.

translations

{langue}

formRegistrationConfirm

characters

The confirmation message for the {langue} displayed after a registration through the form page

translations

{langue}

formFooter

text

The text for the form footer.

translations

{langue}

smsSender

15 characters

The sender name of the SMS.

translations

{langue}

smsTargeting

text

The text for the content of SMS targeting launch.

translations

{langue}

smsRetargeting

text

The text for the content of SMS re-targeting launch.

translations

{langue}

smsRegistrationConfirm

text

The text for the content of SMS sent at registration.

translations

{langue}

smsAlreadyRegisteredConfirm

text

The text for the content of SMS at registration of an already known.

translations

{langue}

smsGodfatherConfirm

text

The text for the content of SMS at sponsoring of a member.

translations

{langue}

smsTicketBurnConfirm

text

The text for the content of SMS at ticket scan succeed.

translations

{langue}

smsScanAlreadyConsumed

text

The text for the content of SMS at ticket already scanned.

translations

{langue}

smsScanExpired

text

The text for the content of SMS at scan of ticket expired.

translations

{langue}

smsScanOutOfStock

text

The text for the content of SMS at scan of ticket after stock limit.

translations

{langue}

smsKeyword

50 characters

The text to send by SMS for automatic registration.

translations

{langue}

smsKeywordRegistrationConfirmation

text

The text for the content of SMS at keyword registration.

translations

{langue}

smsGameWinConfirm

text

The text for the content of SMS sent at game win.

translations

{langue}

smsGameLooseConfirm

text

The text for the content of SMS sent at game loose.

Example

curl -X GET -H "Authorization: Bearer NTk0NmIyMThNmEzMmUxM2M1MTE3NzdiMDZkY2ExYmEzZmIxYzZhZGMzOQ" "https://www.clubprivilege.ch/api/campaign/1245?merchant=nestleshop"

Get a list of Campaigns

Campaign(s) information manage all content related to your Club form page (which is located at the address https://www.clubprivilege.ch/club/#your_merchant_code#/). You can manage your campaign(s) using the Privilege administration site. But if you need to retrieve campaign information (for example to manage the form page on your website instead of the standard one located at https://www.clubprivilege.ch/club/#your_merchant_coder#/fr/, then you can request those informations using this API.
Endpoint : https://www.clubprivilege.ch/api/campaigns
Method: GET

Parameter Format Description

main

integer

This gets only main campaigns

merchant

characters

The Club (merchant) code of the campaign

merchantIdentifier

integer

The merchant Mbuy customer identifier of the campaign

merchantIdentifier2

integer

The merchant Mbuy campaign identifier of the campaign

page

integer

The page number for paginated results

limit

integer

The numbers of results by page for paginated results

Response

Variable Format Description

list of campaigns

Campaign

The campaigns result list

Example

curl -X GET -H "Authorization: Bearer NTk0NmIyMThNmEzMmUxM2M1MTE3NzdiMDZkY2ExYmEzZmIxYzZhZGMzOQ" "https://www.clubprivilege.ch/api/campaigns?merchant=nestleshop"

Create a new Offer

Offe(s) information manage all content related to your Privilege tickets offers which are given to your members when they register (or when you decide to). You can manage one or multiple offer(s) for each of your campaign, this can be done using the Privilege administration. But if you need to retrieve an offer information from your system (for example to manage the form page on your website instead of the standard one located at https://www.clubprivilege.ch/club/#merchant_identifier#/fr/), then you can request those information using this API.
Endpoint : https://www.clubprivilege.ch/api/offer
Method: PUT

Parameter Format Description

identifier

50 characters

The identifier of the offer. It is not displayed to members. It can be latter used to retrieve/update offer information

merchant

50 characters

The identifier of the campaign which this offer needs to be created for

campaign

50 characters

The identifier of the Club (merchant) which this offer needs to be created for

ticketBarcode

250 characters

If your shop need to scan a barcode (moreover than the QR code) to update your system, then send the barcode URL using this parameter

ticketHeaderImage

250 characters

The image is displayed on the header of members tickets

ticketBackgroundColorCode

10 characters

The color code is used as background on members tickets

ticketBorderColorCode

10 characters

The color code is used as border on members tickets

ticketTextColor

10 characters

The color code is used as text color on members tickets

ticketValidColorCode

10 characters

The color code is used by the app when a member ticket is scanned

ticketValidShop

characters

The identifier of one of merchant shops which the ticket is valid for

translations

{langue}

name

characters (Max. 100)

The title of the offer. It is displayed on the ticket offer. You can precise the {langue} (e.g: nameFr or nameEn or nameIt or nameDe) to set the translation of that name. If none langue is used (e.g: name), then the default langue is "fr".

translations

{langue}

informations

N characters

The informations of the offer. It is displayed on the ticket offer. You can precise the {langue} (e.g: informationsFr or informationsEn or informationsIt or informationsDe) to set the translation of that informations. If none langue is used (e.g: informations), then the default langue is "fr".

translations

{langue}

conditions

N characters

The conditions of the offer. It is displayed on the ticket offer. You can precise the {langue} (e.g: conditionsFr or conditionsEn or conditionsIt or conditionsDe) to set the translation of those conditions. If none langue is used (e.g: conditions), then the default langue is "fr".

translations

{langue}

restrictions

N characters

The restrictions of the offer. It is displayed on the ticket offer. You can precise the {langue} (e.g: restrictionsFr or restrictionsEn or restrictionsIt or restrictionsDe) to set the translation of that retrictions. If none langue is used (e.g: restrictions) the default langue is "fr".

Response

Variable Format Description

id

integer

This is the offer internal ID created in Privilege database.

Example

curl -X PUT 
-d "identifier=chf5-coiffeur&merchant=prelude&campaign=prelude-welcome&name=CHF%205.-%20sur%20votre%20prochaine%20coupe&informations=Valable%20dans%20les%20enseignes%20Prélude%20sur%20présentation%20de%20votre%20Code%20QR%20personnel%20et%20un%20seul%20par%20personne.&restrictions=Non%20cumulable%20avec%20d’autres%20avantages%20et%20rabais%20sur%20l’article choisi.%20Offre%20valable%2030%20jours.&status=1" 
-H "Authorization: Bearer YTk3MzRhZGE3YmMxMTYxMzdjNjRkM2E0MjQzMzJmOWFlNzRjMzg3YTVjZTJjNGMwN2FkMjY2MDFkYTRhNzAzYQ" 
"https://www.clubprivilege.ch/api/offer"

Get an Offer

Offer(s) information manage all content related to your Privilege tickets offers which are given to your Club (merchant) members when they register (or when they participate to your campaigns). You can manage your offer(s) using the Privilege administration. But if you need to retrieve an offer information from your system (for example to manage the form page on your website instead of the standard one located at https://www.clubprivilege.ch/club/#your_merchant_code#/fr/), then you can request those information using this API.
Endpoint : https://www.clubprivilege.ch/api/offer/{id}
Method: GET

Parameter Format Description

id

integer

The offer id which you need to retrieve the information for

Response

Variable Format Description

id

integer

The offer internal ID from Privilege database.

identifier

50 characters

The offer identifier (code). It is not displayed to the members. It can be used to retrieve offer information using the API

status

boolean

The status of the offer (enabled/disabled)

creationDate

datetime

The offer creation date

modificationDate

datetime

The offer modification date

name

100 characters

The offer name

type

integer

The offer type (-1: none, 1: gift, 2: election, 3: win, 4: gift_card, 5: auth_card, 6: prepaid_card, 7: reward_card)

hideCustomerInfos

boolean

This hides member personal informations from tickets

hideQRCode

boolean

This hides the QR code image from tickets

hideBarcode

boolean

This hides the barcode image from tickets

isDynamicBarcode

boolean

This generates EAN barcode from tickets code

staticBarcodeImage

250 characters

The URL of the offer ticket EAN barcode

isUsableMultipleTimes

boolean

This allows tickets to be scanned multiple times

isUsableEachDay

boolean

This allows tickets to be scanned once time per day

isUsableSingleDay

boolean

This allows tickets to be scanned multiple time during a single day

isUsableEachShop

boolean

This allows tickets to be scanned one time by each scan desk

numberOfUsages

integer

The number of scan allowed for each tickets

isSelfScannable

boolean

This allows tickets to be self-scanned by members. This display a camera to scan a QR (e.g: at shop entry)

isDebitable

boolean

This allow ticket to be debitable and triggers a debit popup on app when scanning tickets

creditAmountInitial

integer

The debitable amount on each ticket. The ticket is refused if there is no more credit.

reductionRate

integer

The reduction amount rate provided bby ticket. The amount is calculated at each ticket scan.

spentAmountMin

integer

The minimum amount spent to debit this ticket

ticketHeaderImage

URL

The offer ticket header image

ticketValidColorCode

10 characters

The color code used by the app when scaning one of this offer tickets

ticketValidShop

characters

The shop where these offer tickets are valid for

ticketBackgroundColor

10 characters

The background color used when displaying the offer tickets

ticketBorderColor

10 characters

The color used for borders when displaying the offer tickets

ticketTextColor

10 characters

The color used for text when displaying the offer tickets

ticketLinkColor

10 characters

The color used for text links when displaying the offer tickets

main

boolean

If main is set to true, then it means that this offer is given when members are subscribing to Privilege

hasCodePool

boolean

If set to true, then it means that this offer has a predefined pool of codes defined

hasScanSettings

boolean

If set to true, then it means that this offer has a predefined SMS text content for each ticket scan result type

scanExpiredColorCode

10 characters

The color used by the app scan when scaning an expired ticket of this offer

scanValidColorCode

10 characters

The color used by the app scan when scaning an valid ticket of this offer

scanOutOfStockColorCode

10 characters

The color used by the app scan when scaning a ticket of this offer after stock is depleated

scanConsumedColorCode

10 characters

The color used by the app scan when scaning an already consumed ticket of this offer

scanInvalidColorCode

10 characters

The color used by the app scan when scaning a ticket of this offer using an invalid shop desk

maxTickets

integer

The maximum number of ticket generated for this offer

maxBurnedTickets

integer

The maximum number of ticket scanned for this offer

maxKey

integer

The maximum key to manage stock of tickets generated/burned for this offer

ticketValidityMinDate

datetime

The date starting which the offer tickets are valid

ticketValidityMaxDate

datetime

The date until which the offer tickets are valid

ticketValidityMinDelay

integer

The delay starting which the offer tickets are valid

ticketValidityMaxDelay

integer

The delay until which the offer tickets are valid

displaySlider

boolean

If set to true, this display a slider on form page

sliderImage

250 characters

The offer image used to display it on form page slider

generatedTicketsCount

integer

The number of generated tickets with this offer

burnedTicketsCount

integer

The number of scanned tickets with this offer

displayOrder

integer

The position of the ticket offer among others campaign offers tickets

merchant

Merchant

The merchant related to this offer

campaign

Campaign

The campaign related to this offer

ticketActivationCampaign

Campaign

The campaign used to activate tickets of this offer

translations

{langue}

name

characters

The name of the offer. It is displayed on the offer ticket

translations

{langue}

informations

characters

The information related to the offer. It is displayed on the offer ticket

translations

{langue}

conditions

characters

The conditions related to the offer. It is displayed on the offer ticket

translations

{langue}

restrictions

characters

The usage restriction related to the offer. It is displayed on the offer ticket

translations

{langue}

scanExpiredText

text

The text content of message popup displayed on the app scan when scaning ticket expired of this offer.

translations

{langue}

scanValidText

text

The text content of message popup displayed on the app scan when scaning valid ticket of this offer.

translations

{langue}

scanOutOfStockText

text

The text content of message popup displayed on the app scan when scaning ticket of this offer once stock is depleated.

translations

{langue}

scanInvalidShopText

text

The text content of message popup displayed on the app scan when scaning ticket of this offer using invalid shop desk.

translations

{langue}

scanConsumedText

text

The text content of message popup displayed on the app scan when scaning ticket already consumed of this offer.

translations

{langue}

sliderTitle

150 characters

The slide title displayed on the form page

translations

{langue}

sliderDescription

text

The slider description displayed on the form page

translations

{langue}

gameDescription

text

The text introduction used for game

translations

{langue}

smsGameWinConfirm

characters

The text content of SMS sent when wining a game

Example

curl -X GET -H "Authorization: Bearer YzBiNTg5ZThhNzEzZjMwODhiNTM5YzJlYzZjNmU3YjBhM2NmZTE4NDYzMGZmMzcxMzE1OGI1NGQ1ZjdlODUwNQ" "https://www.clubprivilege.ch/api/merchant/offer/1045"

Get a list of Offers

Offer(s) information manage all content related to your Privilege tickets offers which are given to your Club (merchant) members when they register (or when they participate to your campaigns). You can manage your offer(s) using the Privilege administration. But if you need to retrieve an offer information from your system (for example to manage the form page on your website instead of the standard one located at https://www.clubprivilege.ch/club/#your_merchant_code#/fr/), then you can request those information using this API.
Endpoint : https://www.clubprivilege.ch/api/offers
Method: GET

Parameter Format Description

campaign

integer

The campaign id of the offer

merchant

integer

The merchant ID of the offer

page

integer

The page number for paginated results

limit

integer

The numbers of results by page for paginated results

Response

Variable Format Description

list of offers

Offer

The offers result list

Example

curl -X GET -H "Authorization: Bearer NTk0NmIyMThmMWRhMzZhNjBmYmZiNmEzMmUxM2M1MTE3NzdiMDZkY2ExYmEzZmIxYzZhZGMzOTAxYTZkYTg5ZQ" "https://www.clubprivilege.ch/api/offers?merchant=2&campaign=1245"

Subscribe a new Customer

If you host the form page/subscription form, then when the new member post the form, you must call the API to subscribe this new member. The API will create a ticket of that campaign offer and will send a SMS to the member containing the tickets link.
Endpoint: https://www.clubprivilege.ch/api/customer
Method: PUT

Parameter Format Description

merchant

characters

The Club (merchant) code which the member is subscribing for

mobile

characters

The member phone number (e.g: 077777777)

country

characters

The member phone number prefix (e.g: +41 for Switzerland, +33 for France, ...)

langue

characters

The member langue

firstname

characteres

The member firstname

lastname

characteres

The member laststname

gender

male or female

The member gender (e.g: male)

postalCode

characteres

The member postal code (e.g.: 1012)

active

boolean

The member subscription status (0 to unsubscribe, 1 to subscribe)

tokenReceived

characters

The token of the member who sponsored this member

source

characters

The member subscription source (e.g: LeMatin.ch), you will latter be able to target members by source if necessary

userAgent

characters

The member browser user agent (e.g.: Mozilla 5.0+ iPhone CPU iPhone OS 13)

ip

characteres

The member IP (e.g.: 178.197.239.119)

Response

Variable Format Description

id

integer

The member internal ID from Privilege database

token

characters

The member token. If you need to allow member to sponsor others members, then you have to send the token parameter in your share URLs, so you be able to retrieve it when a new member subscribe and send it to the API (as the tokenReceived parameter). Example: https://www.clubprivilege.ch/club/nestleshop/fr?t=tok-a86875015cf0becc9dfc64d9d6d2ac5f

Example

curl -X PUT -d "merchant=nestleshop&firstname=Joachim&lastname=Ifergan&postalCode=1012&gender=male&mobile=4178888888&langue=fr&active=1" -H "Authorization: Bearer NzZhNDJmNTM5NzJjZjY2YjMxNDMxMzc3ZTkzOTU2NzYxYzJkYjc1OGVhNjg1ZjU1NjZmODA3MzRjMTliNjU4MA" "https://www.clubprivilege.ch/api/customer"

Get a Customer

If you retrieve your members information from your system, you must call this API.
Endpoint: https://www.clubprivilege.ch/api/customer
Method: GET

Parameter Format Description

id

integer

The member ID which you need to retrieve information for

merchant

integer

The merchant Mbuy customer ID related to this member

mobile

50 characters

The member mobile

limit

integer

Number of results

page

integer

The result page number

Response

Variable Format Description

id

integer

The member internal ID from Privilege database

firstname

45 characters

The member firstname

lastname

45 characters

The member lastname

email

45 characters

The member email

langue

2 characters

The member language

mobile

characters

The member phone number (e.g: 4178888888)

gender

integer

The member gender (1 for female, 2 for male)

creationDate

datetime

The member subscription date

modificationDate

datetime

The member last modification date

tokenOwned

164 characters

The member token. It is used in share links, so we can reward the member when he sponsors a new member

tokenReceived

164 characters

The godfather token. In case this members has been sponsored by another member

status

boolean

"1" if the member is subscribed and "0" if he is unsubscribed

sharesCount

integer

The number of member shares

sharesHitsCount

integer

The number of member shares hits

age

integer

The member age

messageType

integer

The type of message received (1: SMS)

userAgent

128 characters

The member user agent

ip

16 characters

The member IP

target

32 characters

The last campaign which this member was targeted for

status

boolean

The last date this member was targeted

godfather

Customer

The member who sponsored this member

godchilds

array of Customer

The members sponsored by this member

tickets

array of Tickets

The tickets received by this member

ticketsBurned

array of Tickets

The tickets consumed by this member

customerUser

CustomerUser

The unique mobile ID related to this member

SMSs

array of SMS

The IDs of SMSs received by this member

customersFields

array of CustomerFields

The members data fields with values

Example

curl -X GET 
-H "Authorization: Bearer NzZhNDJmNTM5NzJjZjY2YjMxNDMxMzc3ZTkzOTU2NzYxYzJkYjc1OGVhNjg1ZjU1NjZmODA3MzRjMTliNjU4MA" 
"https://www.clubprivilege.ch/api/customer/67173"

Get a list of Customers

If you retrieve your members information from your system, you must call this API.
Endpoint: https://www.clubprivilege.ch/api/customers
Method: GET

Parameter Format Description

id

integer

The member ID which you need to retrieve information for

merchant

integer

The merchant Mbuy customer ID related to this member

mobile

50 characters

The member mobile

sort

50 characters

The sort order string

page

integer

The page number for paginated results

limit

integer

The numbers of results by page for paginated results

Response

Variable Format Description

list of customers

Customer

The members (customers) result list

curl -X GET
-H "Authorization: Bearer NzZhNDJmNTM5NzJjZjY2YjMxNDMxMzc3ZTkzOTU2NzYxYzJkYjc1OGVhNjg1ZjU1NjZmODA3MzRjMTliNjU4MA"
"https://www.clubprivilege.ch/api/customers"

Retrieve Statistics

If you need to display some statistics in your system, you can request statistics by campaign using this API. This API will return for each day and for each shop the number of tickets generated, the number of tickets burned, the number of distinct members, the number of distinct members who burned their tickets
Endpoint: https://www.clubprivilege.ch/api/statistics
Method: GET

Parameter Format Description

merchant

characters

The Club (merchant) code which you need to retrieve statistics for

campaign

characters

The campaign identifier which you need to retrieve statistics for

Response

Variable Format Description

day

date

The statistics date

shop

characters

The statistics shop label

nbTickets

integer

The number of tickets generated

nbTicketsBurned

integer

The number of tickets burned/consumed

nbCampaignTicketsCustomers

integer

The number of customers who received a tickets of this campaign

nbCampaignTicketsViewedCustomers

integer

The number of customers who received and viewed a tickets of this campaign and consumed it

nbCampaignTicketsConsumedCustomers

integer

The number of customers who received a tickets of this campaign and consumed it

curl -X GET 
-H "Authorization: Bearer NzZhNDJmNTM5NzJjZjY2YjMxNDMxMzc3ZTkzOTU2NzYxYzJkYjc1OGVhNjg1ZjU1NjZmODA3MzRjMTliNjU4MA" 
"https://www.clubprivilege.ch/api/statistics/nestleshop?campaign=rentree"

Consume a Ticket

You can consume a ticket using the iOS/Android scan app or using the online scan through the Privilege administration. But if you need to display/manage those information from your system, you can consume ticket using this API.
Endpoint : https://www.clubprivilege.ch/api/ticket
Method: PUT

Parameter Format Description

merchant

50 characters

The merchant code

code

64 characters

The ticket code

mobile

50 characters

The mobile of member consuming the ticket

country

2 characters

The mobile coutnry of member consuming the ticket

countryAuto

boolean

Indicates if international mobile format is used

shop

50 characters

The shop desk used to scan this ticket

amountsSpentByOffers

array

A json string containing amount spent for each offer, to get all applicable ongoing reductions

langue

2 characters

The langue to use to notify member after consuming the ticket

dryRun

boolean

Indicates if it is a try or real consumation

Response

Variable Format Description

result

250 characters

error

250 characters

The error code

error_description

250 characters

The error description

Example

curl -X PUT -d "merchant=nestleshop&code=Y1356484491" -H "Authorization: Bearer NjY3YWRjN2U4MDQ4MzYxNjVkMDBmOGE2YTc4MmFlZTBkNjIwNWMyOTZjMGE1ZmI1ZDQ4ZTUwYWM0MmZkNDJkMA" "https://www.clubprivilege.ch/api/ticket/consume"

Get a Tickets

You can retrieve a list of tickets information through the Privilege administration. But if you need to display/manage those information from your system, you can manage those information using this API.
Endpoint: https://www.clubprivilege.ch/api/tickets
Method: GET

Parameter Format Description

id

integer

The ticket ID which you need to retrieve information for

merchant

50 characters

The merchant code related to the tickets

mobile

50 characters

The member mobile

startDate

datetime

The minimum ticket creation date

endDate

datetime

The maximum ticket creation date

offer

integer

The offer internal ID

campaign

integer

The campaign internal ID

limit

integer

Number of results

page

integer

The result page number

Response

Variable Format Description

id

integer

The member internal ID from database

creationDate

datetime

The ticket creation date

code

64 characters

The code string

manifestation

integer

The manifestation ID

customerUser

integers

The mobile ID

partlog

integer

The ticket ID

merchant

integer

The Mbuy customer ID

validity

integer

The ticket validity type (deprecated)

transaction

integer

(deprecated)

class

integer

The ticket class (deprecated)

category

integer

The ticket category (deprecated)

customerType

integer

The ticket customer type (deprecated)

text

250 characters

The ticket text title displayed on member ticket

comment

250 characters

The ticket comment displayed on member ticket

consumedDate

datetime

The ticket consumed date (if ticket is already consumed)

shop

250 characters

The ticket Shop label

subShop

250 characters

The ticket Shop sub-level label

email

64 characters

(deprecated)

mailSubject

250 characters

(deprecated)

views

integer

The ticket views count

privilege

boolean

Flag to indicate if it is a Privilege or simple ticket

status

boolean

Flag to indicate if it is an active ticket (deprecated)

amountInitial

float

The initial amount credited on the ticket (if it is a debitable Privilege ticket)

amountResidual

float

The remaning amount on the ticket (if it is a debitable Privilege ticket)

offer

Offer

The offer related to this ticket (if it is a Privilege ticket)

campaign

Campaign

The campaign related to this ticket (if it is a Privilege ticket)

customer

Customer

The member related to this ticket

fields

array of TicketDayField

The custom fields related to this ticket

Example

curl -X GET
-H "Authorization: Bearer NzZhNDJmNTM5NzJjZjY2YjMxNDMxMzc3ZTkzOTU2NzYxYzJkYjc1OGVhNjg1ZjU1NjZmODA3MzRjMTliNjU4MA"
"https://www.clubprivilege.ch/api/tickets?mobile=417777777&merchant=nestleshop"

Get a list of consumed Tickets

You can retrieve a list of consumed tickets information through the Privilege administration. But if you need to display/manage those information from your system, you can manage those information using this API.
Endpoint: https://www.clubprivilege.ch/api/tickets-consumed
Method: GET

Parameter Format Description

id

integer

The ticket ID which you need to retrieve information for

merchant

50 characters

The merchant code related to the tickets

mobile

50 characters

The member mobile

startDate

datetime

The minimum ticket creation date

endDate

datetime

The maximum ticket creation date

offer

integer

The offer internal ID

campaign

integer

The campaign internal ID

limit

integer

Number of results

page

integer

The result page number

Response

Variable Format Description

list of consumed tickets

array of Tickets

The consumed tickets result list

Example

curl -X GET -H "Authorization: Bearer NTk0NmIyMThmMWRhMzZhNjBmYmZiNmEzMmUxM2M1MTE3NzdiMDZkY2ExYmEzZmIxYzZhZGMzOTAxYTZkYTg5ZQ" "http://www.dev.clubprivilege.ch/api/tickets-consumed?mobile=417777777&merchant=nestleshop"

Get a list of Shops

You can access your Shop desks information through the Privilege administration. But if you need to display/manage those information from your system, you can manage those information using this API.
Endpoint : https://www.clubprivilege.ch/api/shops
Method: GET

Parameter Format Description

merchant

characters

The merchant code

page

integer

The page number for paginated results

limit

integer

The numbers of results by page for paginated results

Response

Variable Format Description

id

integer

The shop internal ID from database

identifier

50 characters

The shop desk identifier string

subIdentifier

50 characters

The shop desk sub-level identifier string

merchant

integer

The merchant Mbuy ID

startHour

integer

The shop desk opening hour

endHour

integer

The shop desk closing hour

maxBurnedTickets

integer

The shop desk max consumed tickets

burnedTicketsCount

integer

The shop desk consumed tickets count

exitShop

Shop

The auto exit shop desk

url

250 characters

The shop desk url information

accessCampaign

integer

The access campaign

Example

curl -X GET -H "Authorization: Bearer NjY3YWRjN2U4MDQ4MzYxNjVkMDBmOGE2YTc4MmFlZTBkNjIwNWMyOTZjMGE1ZmI1ZDQ4ZTUwYWM0MmZkNDJkMA" "https://www.clubprivilege.ch/api/shops?merchant=209"

Get a list of SMSs

You can access your members SMS information through the Privilege administration. But if you need to display/manage those information from your system, you can manage those information using this API.
Endpoint : https://www.clubprivilege.ch/api/sms
Method: GET

Parameter Format Description

mobile

characters

The member mobile related to this SMS

merchant

characters

The merchant code related to the SMS

startDate

datetime

The minimum sent date of SMS

endDate

datetime

The maximum sent date of SMS

page

integer

The page number for paginated results

limit

integer

The numbers of results by page for paginated results

Response

Variable Format Description

id

integer

The SMS internal ID from database

creationDate

datetime

The SMS creation date

sentDate

datetime

The SMS sent date

mobile

50 characters

The mobile related to this SMS

langue

2 characters

The SMS content language

message

text

The SMS text content

messagePartsCount

integer

The SMS message parts count

type

integer

The SMS type (deprecated)

messageId

integer

The SMS third party internal ID (from MNC)

typeOperation

integer

The SMS operation type (deprecated)

merchant

integer

The Mbuy customer ID related to this SMS

customer

Customer

The member related to this SMS

Example

curl -X GET -H "Authorization: Bearer NjY3YWRjN2U4MDQ4MzYxNjVkMDBmOGE2YTc4MmFlZTBkNjIwNWMyOTZjMGE1ZmI1ZDQ4ZTUwYWM0MmZkNDJkMA" "https://www.clubprivilege.ch/api/sms?merchant=209&mobile=417777777&limit=1&page=1"

Send a SMS

SMS are sent automatically, but if you need to send those information from your system, you can manage those information using this API.
Endpoint : https://www.clubprivilege.ch/api/sms/send
Method: PUT

Parameter Format Description

mobile

characters

The member mobile related to this SMS

country

characters

The member mobile country prefix related to this SMS

countryAuto

boolean

Detects mobile country automatically

merchant

characters

The merchant code related to the SMS

smsContent

text

The SMS content

_locale

characters

The member language related to this SMS

Response

Variable Format Description

id

integer

The SMS internal ID from database

Example

curl -X PUT -d "mobile=417777777&merchant=nestleshop&message=TEST" -H "Authorization: Bearer NjY3YWRjN2U4MDQ4MzYxNjVkMDBmOGE2YTc4MmFlZTBkNjIwNWMyOTZjMGE1ZmI1ZDQ4ZTUwYWM0MmZkNDJkMA" "https://www.clubprivilege.ch/api/sms/send"

Re-send a SMS

SMS are sent automatically, but if you need to send those information from your system, you can manage those information using this API.
Endpoint : https://www.clubprivilege.ch/api/sms/resend
Method: PUT

Parameter Format Description

mobile

characters

The member mobile related to this SMS

country

characters

The member mobile country prefix related to this SMS

countryAuto

boolean

Detects mobile country automatically

merchant

characters

The merchant code related to the SMS

_locale

characters

The member language related to this SMS

Response

Variable Format Description

id

integer

The SMS internal ID from database

Example

curl -X PUT -d "mobile=417777777&merchant=nestleshop&message=TEST" -H "Authorization: Bearer NjY3YWRjN2U4MDQ4MzYxNjVkMDBmOGE2YTc4MmFlZTBkNjIwNWMyOTZjMGE1ZmI1ZDQ4ZTUwYWM0MmZkNDJkMA" "https://www.clubprivilege.ch/api/sms/resend"
Last updated 2021-11-29 17:39:57 UTC