Skip to main content

Create Invitation

This endpoint is used to send a new loyalty invitation to a customer (typically triggered by SAP users via the “Send invitation” button on the SAP customer screen).

Endpoint

  • URL: /api/Invitations/CreateInvitation
  • Method: POST
  • Authentication: Basic Authentication
  • Content-Type: application/json

Request Parameters

FieldTypeRequiredDescription
Firstnamestring✅ YesMax 120 characters. Customer's first name.
Lastnamestring✅ YesMax 128 characters. Customer's last name.
MobilePhonestring✅ YesGreek mobile number (10 digits, starts with 69). Invitation will be sent here.
LoyaltyProgramIdinteger✅ YesAlways set to 1 (default loyalty program).
InvitationCodestring✅ YesMax 60 characters. Must be unique. Typically the SAP Customer ID.
InvitationStatusbyte✅ YesAlways send 1 (Pending). See status codes below.
Tagsarray✅ YesAlways send []. Reserved for future use (object-based tagging structure).

Invitation Status Values

ValueStatus
0None
1Pending
2Sent
3Opened
4Accepted
5Expired
6Error

Sample Request

{
"Firstname": "Christiana",
"Lastname": "Kogevina",
"MobilePhone": "6936562039",
"LoyaltyProgramId": 1,
"InvitationCode": "<SAP_CUSTOMER_ID>",
"InvitationStatus": 1,
"Tags": []
}

Response Properties

FieldTypeDescription
ResultintIndicates the result of the request:
1 = Invitation Create
2 = Existing Member
InvitationIdint?The ID of the newly created invitation, or null if the user already exists.
MemberIdint?The ID of the existing member, if one with the same phone number is found.

Sample Responses

Invitation Created

{
"Result": 1,
"InvitationId": 1234,
"MemberId": null
}

Existing Member Found

{
"Result": 2,
"InvitationId": null,
"MemberId": 9999
}

Error Responses

CodeMessageDescription
18Invitation already created for mobile phone XXXXXAn invitation already exists for the provided mobile number.
2No object was posted or posted object could not be parsedThe request body is missing or contains invalid JSON.
30Loyalty program not found.Invalid LoyaltyProgramId. Must be set to 1.
19ΧΧΧΧ is not a valid mobile phone number.Mobile number must be 10 digits and start with 69.
0Various error messagesA general server error occurred (e.g., unhandled exception).