Register member in a loyalty program
Description
Registers a member in a loyalty program. Before registration, the profile is searched in the database using the specified matching method (email, phone number, profile ID, or a custom field).
Request URL
Method: POST
https://example.com/api/v1.1/loyalty/register_member
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abc123def456" | Yes | API token |
| loyalty_program_id | int | 123 | Yes | Loyalty program ID |
| matching | string | "email" | Yes | Profile lookup method: email, phone, profile_id, custom |
| registration_date | string | "2024-09-01T12:34:56Z" | No | Registration date in RFC3339 format; if omitted, the current time is used |
| string | "user@example.com" | Yes, if matching = email | Member email used to find the profile | |
| phone | string | "+1234567890" | Yes, if matching = phone | Member phone number in international format |
| profile_id | string | "profile123" | Yes, if matching = profile_id | Profile ID |
| field_name | string | "user_id" | Yes, if matching = custom | Custom field name for lookup |
| field_value | string / int | "123456" | Yes, if matching = custom | Custom field value |
Request example
- JSON
- XML
{
"token": "abc123def456",
"loyalty_program_id": 123,
"matching": "email",
"email": "user@example.com",
"registration_date": "2024-09-01T12:34:56Z"
}
<xml>
<token>abc123def456</token>
<loyalty_program_id>123</loyalty_program_id>
<matching>email</matching>
<email>user@example.com</email>
<registration_date>2024-09-01T12:34:56Z</registration_date>
</xml>
Response example
- JSON
- XML
{
"error": 0,
"error_text": "Successful operation",
"profile_id": "123456"
}
<xml>
<error>0</error>
<error_text>Successful operation</error_text>
<profile_id>123456</profile_id>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| profile_id | string | ID of the profile registered in the loyalty program |