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
Field | Type | Required | Description |
---|---|---|---|
Firstname | string | ✅ Yes | Max 120 characters. Customer's first name. |
Lastname | string | ✅ Yes | Max 128 characters. Customer's last name. |
MobilePhone | string | ✅ Yes | Greek mobile number (10 digits, starts with 69 ). Invitation will be sent here. |
LoyaltyProgramId | integer | ✅ Yes | Always set to 1 (default loyalty program). |
InvitationCode | string | ✅ Yes | Max 60 characters. Must be unique. Typically the SAP Customer ID. |
InvitationStatus | byte | ✅ Yes | Always send 1 (Pending). See status codes below. |
Tags | array | ✅ Yes | Always send [] . Reserved for future use (object-based tagging structure). |
Invitation Status Values
Value | Status |
---|---|
0 | None |
1 | Pending |
2 | Sent |
3 | Opened |
4 | Accepted |
5 | Expired |
6 | Error |
Sample Request
{
"Firstname": "Christiana",
"Lastname": "Kogevina",
"MobilePhone": "6936562039",
"LoyaltyProgramId": 1,
"InvitationCode": "<SAP_CUSTOMER_ID>",
"InvitationStatus": 1,
"Tags": []
}
Response Properties
Field | Type | Description |
---|---|---|
Result | int | Indicates the result of the request: 1 = Invitation Create 2 = Existing Member |
InvitationId | int? | The ID of the newly created invitation, or null if the user already exists. |
MemberId | int? | 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
Code | Message | Description |
---|---|---|
18 | Invitation already created for mobile phone XXXXX | An invitation already exists for the provided mobile number. |
2 | No object was posted or posted object could not be parsed | The request body is missing or contains invalid JSON. |
30 | Loyalty 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 . |
0 | Various error messages | A general server error occurred (e.g., unhandled exception). |