Loyalty Programs

A loyalty program is a container for one or more Promotions, which is a mechanism to reward accounts for completing certain actions.

Attributes

  • id

    string

    The unique identifier of the Loyalty Program.

  • name

    string

    The display name of the Loyalty Program.

  • description

    string

    The displayable description for the Loyalty Program.

  • mediaUploadId

    string

    The id of the Media Upload image of the Loyalty Program.

  • img

    string

    The img URL of the Loyalty Program.

  • accountId

    string

    The Account that will own the Loyalty Program.

  • createdAt

    timestamp

    When the Loyalty Program was created.

  • createdBy

    crn

    The User or API Key that created the Loyalty Program.

  • test

    boolean

    true if the Loyalty Program is for testing purposes only.


POST /api/loyalty-programs

This endpoint allows you to create a Loyalty Program .

Attributes

  • name

    string required

    The display name of the Loyalty Program.

  • accountId

    string required

    The Account that will own the Loyalty Program.

  • description

    string

    The displayable description for the Loyalty Program.

  • mediaUploadId

    string

    The id of the Media Upload image of the Loyalty Program.

Errors

  • INVALID_ACCOUNT_TYPE

    403

    The Account must be type org.

Request
curl -X POST \
https://service.centrapay.com/api/loyalty-programs \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"name": "Centrapay Cafe Loyalty Program",
"description": "Centrapay Cafe Loyalty: Earn rewards, enjoy perks! Join now!",
"mediaUploadId": "8aoMfscvtuewsuJzmzBzAs",
"accountId": "Jaim1Cu1Q55uooxSens6yk"
}
'
Response
{
"id": "WRhAxxWpTKb5U7pXyxQjjY",
"name": "Centrapay Cafe Loyalty Program",
"description": "Centrapay Cafe Loyalty: Earn rewards, enjoy perks! Join now!",
"mediaUploadId": "8aoMfscvtuewsuJzmzBzAs",
"img": "https://media-upload.centrapay.com/image.png?jhbdsfau67ewejshb=487hsdjhbdgs743",
"accountId": "Jaim1Cu1Q55uooxSens6yk",
"createdAt": "2021-08-25T00:02:49.488Z",
"createdBy": "crn::user:b657195e-dc2f-11ea-8566-e7710d592c99",
"test": true
}

GET /api/accounts/{accountId}/loyalty-programs

Returns a paginated list of Loyalty Programs for an Account.

Request
curl -X GET \
https://service.centrapay.com/api/accounts/Jaim1Cu1Q55uooxSens6yk/loyalty-programs \
-H 'x-api-key: <TOKEN>'
Response
{
"items": [
{
"id": "WRhAxxWpTKb5U7pXyxQjjY",
"name": "Centrapay Cafe Loyalty Program",
"description": "Centrapay Cafe Loyalty: Earn rewards, enjoy perks! Join now!",
"mediaUploadId": "8aoMfscvtuewsuJzmzBzAs",
"img": "https://media-upload.centrapay.com/image.png?jhbdsfau67ewejshb=487hsdjhbdgs743",
"accountId": "Jaim1Cu1Q55uooxSens6yk",
"createdAt": "2021-08-25T00:02:49.488Z",
"createdBy": "crn::user:b657195e-dc2f-11ea-8566-e7710d592c99",
"test": true
},
{
"id": "DKTs3U38hdhfEqwF1JKoT2",
"name": "Centra Tea Warehouse Loyalty Program",
"description": "Centra Tea Warehouse Loyalty: Earn rewards, enjoy perks! Join now!",
"mediaUploadId": "Hopo4g34sLVdjEMBs2p19F",
"img": "https://media-upload.centrapay.com/image.png?jhbdsfau67ewejshb=487hsdjhbdgs743",
"accountId": "Jaim1Cu1Q55uooxSens6yk",
"createdAt": "2021-08-25T00:02:49.488Z",
"createdBy": "crn::user:b657195e-dc2f-11ea-8566-e7710d592c99",
"test": true
}
]
}