curl --request POST \
--url https://api.voucherify.io/v2/loyalties/examine/earning-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"event": "customer.order.paid",
"customer_identification": {
"customer_id": "<string>",
"customer_source_id": "<string>",
"member_id": "<string>"
},
"customer_order_paid": {
"customer": {
"metadata": {}
},
"member": {
"metadata": {}
},
"order": {
"amount": 123,
"initial_amount": 123,
"discount_amount": 123,
"metadata": {},
"items": [
{
"id": "<string>",
"source_id": "<string>",
"product_id": "<string>",
"sku_id": "<string>",
"amount": 123,
"discount_amount": 123,
"quantity": 123,
"price": 123,
"product": {
"id": "<string>",
"source_id": "<string>",
"price": 123
},
"sku": {
"id": "<string>",
"source_id": "<string>",
"price": 123
},
"metadata": {}
}
]
}
}
}
'{
"event": "<string>",
"memberships": [
{
"member": {
"id": "<string>",
"customer_id": "<string>",
"program_id": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>"
},
"program": {
"id": "<string>",
"name": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>"
},
"cards": [
{
"card": {
"id": "<string>",
"card_definition_id": "<string>",
"card_type": "<string>",
"code": "<string>",
"object": "<string>"
},
"points_estimation": 123
}
],
"incentives": [
{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"object": "incentive"
}
],
"object": "member_earning_opportunity"
}
],
"object": "earnings_examine_result"
}Examine Earnings
⚠️ BETA endpoint
This is a work-in-progress documentation of a BETA endpoint. The parameters, fields, request and response bodies, and other data may subject to change. If you want to share feedback or improvements, contact Voucherify support or your Technical Account Manager.
Performs a dry-run estimation of points and incentives a customer (or member) would earn for a given event, without actually triggering any earning rule processing or modifying balances.
curl --request POST \
--url https://api.voucherify.io/v2/loyalties/examine/earning-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"event": "customer.order.paid",
"customer_identification": {
"customer_id": "<string>",
"customer_source_id": "<string>",
"member_id": "<string>"
},
"customer_order_paid": {
"customer": {
"metadata": {}
},
"member": {
"metadata": {}
},
"order": {
"amount": 123,
"initial_amount": 123,
"discount_amount": 123,
"metadata": {},
"items": [
{
"id": "<string>",
"source_id": "<string>",
"product_id": "<string>",
"sku_id": "<string>",
"amount": 123,
"discount_amount": 123,
"quantity": 123,
"price": 123,
"product": {
"id": "<string>",
"source_id": "<string>",
"price": 123
},
"sku": {
"id": "<string>",
"source_id": "<string>",
"price": 123
},
"metadata": {}
}
]
}
}
}
'{
"event": "<string>",
"memberships": [
{
"member": {
"id": "<string>",
"customer_id": "<string>",
"program_id": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>"
},
"program": {
"id": "<string>",
"name": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>"
},
"cards": [
{
"card": {
"id": "<string>",
"card_definition_id": "<string>",
"card_type": "<string>",
"code": "<string>",
"object": "<string>"
},
"points_estimation": 123
}
],
"incentives": [
{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"object": "incentive"
}
],
"object": "member_earning_opportunity"
}
],
"object": "earnings_examine_result"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Trigger event. Currently supported: customer.order.paid or order.paid.
"customer.order.paid"
Discriminated union identifying who is being evaluated.
Show child attributes
Show child attributes
Event-specific payload for customer.order.paid containing context for rule evaluation.
Show child attributes
Show child attributes
Was this page helpful?

