The Loyalty Program object

Attributes

id string

Unique identifier for the object.

created_at string

ISO 8601 timestamp of when the object was created.

updated_at string

ISO 8601 timestamp of when the object was last updated.

loyalty_program_name string required
loyalty_program_type string
from_date string required
to_date string
customer_group string
customer_territory string
auto_opt_in boolean

Default: false

conversion_factor number
expiry_duration integer
expense_account string
cost_center string
company string
project string
The Loyalty Program object
{
  "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"
}
GET /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

id string required

The identifier of the loyalty program to retrieve.

Returns

Returns the loyalty program object if a valid identifier was provided.

GET /api/accounts/loyalty-program/{id}
curl https://api.overplane.dev/api/accounts/loyalty-program/loyalty-program_abc123 \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "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"
}
GET /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

limit integer

Maximum number of objects to return. Default: 20.

offset integer

Number of objects to skip for pagination. Default: 0.

Returns

A paginated list of loyalty program objects.

GET /api/accounts/loyalty-program
curl https://api.overplane.dev/api/accounts/loyalty-program \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "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
}
POST /api/accounts/loyalty-program

Create a loyalty program

Creates a new loyalty program object.

Body parameters

loyalty_program_name string required
loyalty_program_type string
from_date string required
to_date string
customer_group string
customer_territory string
auto_opt_in boolean

Default: false

conversion_factor number
expiry_duration integer
expense_account string
cost_center string
company string
project string

Returns

Returns the newly created loyalty program object if the call succeeded.

POST /api/accounts/loyalty-program
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"}'
Response
{
  "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"
}
PATCH /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

id string required

The identifier of the loyalty program to update.

Body parameters

loyalty_program_name string
loyalty_program_type string
from_date string
to_date string
customer_group string
customer_territory string
auto_opt_in boolean

Default: false

conversion_factor number
expiry_duration integer
expense_account string
cost_center string
company string
project string

Returns

Returns the updated loyalty program object.

PATCH /api/accounts/loyalty-program/{id}
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"}'
Response
{
  "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"
}
DELETE /api/accounts/loyalty-program/{id}

Delete a loyalty program

Permanently deletes a loyalty program. This cannot be undone.

Path parameters

id string required

The identifier of the loyalty program to delete.

Returns

Returns a confirmation that the loyalty program has been deleted.

DELETE /api/accounts/loyalty-program/{id}
curl https://api.overplane.dev/api/accounts/loyalty-program/loyalty-program_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X DELETE
Response
{
  "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

idx integer
loyalty_program_id string required
tier_name string required
min_spent number
collection_factor number required

Endpoints

GET /api/accounts/loyalty-program-collection?parent_id={id}
POST /api/accounts/loyalty-program-collection
PATCH /api/accounts/loyalty-program-collection/{id}
DELETE /api/accounts/loyalty-program-collection/{id}
POST /api/accounts/loyalty-program-collection/reorder
Loyalty Program Collection object
{
  "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
}