The Loyalty Program object
Attributes
Unique identifier for the object.
ISO 8601 timestamp of when the object was created.
ISO 8601 timestamp of when the object was last updated.
Default: false
{
"id": "loyalty-program_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"loyalty_program_name": "loyalty_program_name_example",
"loyalty_program_type": "loyalty_program_type_example",
"from_date": "2024-01-15",
"to_date": "2024-01-15",
"customer_group": "customer_group_example",
"customer_territory": "customer_territory_example",
"auto_opt_in": false,
"conversion_factor": 0,
"expiry_duration": 0,
"expense_account": "expense_account_example",
"cost_center": "cost_center_example",
"company": "Example Corp",
"project": "project_example"
} /api/accounts/loyalty-program/{id} Retrieve a loyalty program
Retrieves the details of an existing loyalty program. Supply the unique loyalty program ID that was returned from a previous request.
Path parameters
The identifier of the loyalty program to retrieve.
Returns
Returns the loyalty program object if a valid identifier was provided.
curl https://api.overplane.dev/api/accounts/loyalty-program/loyalty-program_abc123 \
-H "Authorization: Bearer sk_test_..." {
"id": "loyalty-program_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"loyalty_program_name": "loyalty_program_name_example",
"loyalty_program_type": "loyalty_program_type_example",
"from_date": "2024-01-15",
"to_date": "2024-01-15",
"customer_group": "customer_group_example",
"customer_territory": "customer_territory_example",
"auto_opt_in": false,
"conversion_factor": 0,
"expiry_duration": 0,
"expense_account": "expense_account_example",
"cost_center": "cost_center_example",
"company": "Example Corp",
"project": "project_example"
} /api/accounts/loyalty-program List all loyalty programs
Returns a list of loyalty programs. The results are sorted by creation date, with the most recently created appearing first.
Query parameters
Maximum number of objects to return. Default: 20.
Number of objects to skip for pagination. Default: 0.
Returns
A paginated list of loyalty program objects.
curl https://api.overplane.dev/api/accounts/loyalty-program \
-H "Authorization: Bearer sk_test_..." {
"data": [
{
"id": "loyalty-program_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"loyalty_program_name": "loyalty_program_name_example",
"loyalty_program_type": "loyalty_program_type_example",
"from_date": "2024-01-15",
"to_date": "2024-01-15",
"customer_group": "customer_group_example",
"customer_territory": "customer_territory_example",
"auto_opt_in": false,
"conversion_factor": 0,
"expiry_duration": 0,
"expense_account": "expense_account_example",
"cost_center": "cost_center_example",
"company": "Example Corp",
"project": "project_example"
}
],
"has_more": false,
"total": 1
} /api/accounts/loyalty-program Create a loyalty program
Creates a new loyalty program object.
Body parameters
Default: false
Returns
Returns the newly created loyalty program object if the call succeeded.
curl https://api.overplane.dev/api/accounts/loyalty-program \
-H "Authorization: Bearer sk_test_..." \
-X POST \
-H "Content-Type: application/json" \
-d '{"loyalty_program_name":"loyalty_program_name_example","from_date":"2024-01-15"}' {
"id": "loyalty-program_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"loyalty_program_name": "loyalty_program_name_example",
"loyalty_program_type": "loyalty_program_type_example",
"from_date": "2024-01-15",
"to_date": "2024-01-15",
"customer_group": "customer_group_example",
"customer_territory": "customer_territory_example",
"auto_opt_in": false,
"conversion_factor": 0,
"expiry_duration": 0,
"expense_account": "expense_account_example",
"cost_center": "cost_center_example",
"company": "Example Corp",
"project": "project_example"
} /api/accounts/loyalty-program/{id} Update a loyalty program
Updates the specified loyalty program by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Path parameters
The identifier of the loyalty program to update.
Body parameters
Default: false
Returns
Returns the updated loyalty program object.
curl https://api.overplane.dev/api/accounts/loyalty-program/loyalty-program_abc123 \
-H "Authorization: Bearer sk_test_..." \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"loyalty_program_name":"loyalty_program_name_example","loyalty_program_type":"loyalty_program_type_example"}' {
"id": "loyalty-program_abc123",
"created_at": "2024-01-15T09: 30: 00Z",
"updated_at": "2024-01-15T09: 30: 00Z",
"loyalty_program_name": "loyalty_program_name_example",
"loyalty_program_type": "loyalty_program_type_example",
"from_date": "2024-01-15",
"to_date": "2024-01-15",
"customer_group": "customer_group_example",
"customer_territory": "customer_territory_example",
"auto_opt_in": false,
"conversion_factor": 0,
"expiry_duration": 0,
"expense_account": "expense_account_example",
"cost_center": "cost_center_example",
"company": "Example Corp",
"project": "project_example"
} /api/accounts/loyalty-program/{id} Delete a loyalty program
Permanently deletes a loyalty program. This cannot be undone.
Path parameters
The identifier of the loyalty program to delete.
Returns
Returns a confirmation that the loyalty program has been deleted.
curl https://api.overplane.dev/api/accounts/loyalty-program/loyalty-program_abc123 \
-H "Authorization: Bearer sk_test_..." \
-X DELETE {
"id": "loyalty-program_abc123",
"deleted": true
} Line items
Child objects that belong to this loyalty program. These are accessed via the parent's ID.
Loyalty Program Collection
Attributes
Endpoints
/api/accounts/loyalty-program-collection?parent_id={id} /api/accounts/loyalty-program-collection /api/accounts/loyalty-program-collection/{id} /api/accounts/loyalty-program-collection/{id} /api/accounts/loyalty-program-collection/reorder {
"id": "loyalty-program-collection_abc123",
"idx": 1,
"loyalty_program_id": "loyalty_program_id_example",
"tier_name": "tier_name_example",
"min_spent": 0,
"collection_factor": 0
}