Loyalty Program Memberships

A Loyalty Program Membership represents an Account’s membership to a Loyalty Program.

Attributes

  • id

    string

    The unique identifier of the Loyalty Program Membership.

  • accountId

    string

    The Account that is being onboarded to the Loyalty Program.

  • programId

    string

    The id of the Loyalty Program that the Membership is created for.

  • name

    string

    The display name of the Loyalty Program.

  • description

    string

    The displayable description for the Loyalty Program.

  • status

    string

    The status of the Loyalty Program Membership.

  • mediaUploadId

    string

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

  • img

    string

    The img URL of the Loyalty Program.

  • createdAt

    timestamp

    When the Loyalty Program Membership was created.

  • createdBy

    crn

    The User or API Key that created the Loyalty Program Membership.

  • test

    boolean

    true if the Loyalty Program Membership is for testing purposes only.


POST /api/loyalty-programs/{loyaltyProgramId}/memberships

This endpoint allows you to create Loyalty Program Memberships to onboard users to Loyalty Programs .

Attributes

  • accountId

    string required

    The Account that is being onboarded to the Loyalty Program.

Errors

  • MEMBERSHIP_ALREADY_EXISTS

    403

    A membership has already been created for this account and this loyalty program.

  • LOYALTY_PROGRAM_ACCOUNT_LIVENESS_MISMATCH

    403

    The account cannot be test if the loyalty program is not test.

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