curl --request PUT \
--url https://api.voucherify.io/v2/loyalties/incentives/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "<string>",
"points": {
"value": 4611686018427388000,
"card_definition_id": "<string>"
},
"points_proportional": {
"card_definition_id": "<string>",
"order": {},
"order_items": {}
},
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 4611686018427388000
}
},
"stock": 1073741823
}
'{
"id": "linc_abc123def456",
"name": "<string>",
"stock": 1073741823,
"created_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"points": {
"value": 4611686018427388000,
"card_definition_id": "<string>"
},
"points_proportional": {
"card_definition_id": "<string>",
"order": {
"amount": {
"every": 4611686018427388000,
"value": 4611686018427388000
},
"total_amount": {
"every": 4611686018427388000,
"value": 4611686018427388000
},
"metadata": {
"every": 4611686018427388000,
"value": 4611686018427388000,
"property": "<string>"
}
},
"customer": {
"metadata": {
"every": 4611686018427388000,
"value": 4611686018427388000,
"property": "<string>"
}
},
"order_items": {
"amount": {
"every": 4611686018427388000,
"value": 4611686018427388000,
"applicable_to": [
{
"product": {
"id": "<string>"
},
"sku": {
"id": "<string>"
},
"products_collection": {
"id": "<string>"
}
}
]
},
"subtotal_amount": {
"every": 4611686018427388000,
"value": 4611686018427388000,
"applicable_to": [
{
"product": {
"id": "<string>"
},
"sku": {
"id": "<string>"
},
"products_collection": {
"id": "<string>"
}
}
]
},
"quantity": {
"every": 4611686018427388000,
"value": 4611686018427388000,
"applicable_to": [
{
"product": {
"id": "<string>"
},
"sku": {
"id": "<string>"
},
"products_collection": {
"id": "<string>"
}
}
]
}
}
},
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 4611686018427388000
}
},
"updated_at": "2023-11-07T05:31:56Z"
}Update an incentive
⚠️ 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.
Updates an existing incentive. In DRAFT status all properties can be updated. In ACTIVE status only name and stock can be changed. At least one property must be provided.
curl --request PUT \
--url https://api.voucherify.io/v2/loyalties/incentives/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "<string>",
"points": {
"value": 4611686018427388000,
"card_definition_id": "<string>"
},
"points_proportional": {
"card_definition_id": "<string>",
"order": {},
"order_items": {}
},
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 4611686018427388000
}
},
"stock": 1073741823
}
'{
"id": "linc_abc123def456",
"name": "<string>",
"stock": 1073741823,
"created_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"points": {
"value": 4611686018427388000,
"card_definition_id": "<string>"
},
"points_proportional": {
"card_definition_id": "<string>",
"order": {
"amount": {
"every": 4611686018427388000,
"value": 4611686018427388000
},
"total_amount": {
"every": 4611686018427388000,
"value": 4611686018427388000
},
"metadata": {
"every": 4611686018427388000,
"value": 4611686018427388000,
"property": "<string>"
}
},
"customer": {
"metadata": {
"every": 4611686018427388000,
"value": 4611686018427388000,
"property": "<string>"
}
},
"order_items": {
"amount": {
"every": 4611686018427388000,
"value": 4611686018427388000,
"applicable_to": [
{
"product": {
"id": "<string>"
},
"sku": {
"id": "<string>"
},
"products_collection": {
"id": "<string>"
}
}
]
},
"subtotal_amount": {
"every": 4611686018427388000,
"value": 4611686018427388000,
"applicable_to": [
{
"product": {
"id": "<string>"
},
"sku": {
"id": "<string>"
},
"products_collection": {
"id": "<string>"
}
}
]
},
"quantity": {
"every": 4611686018427388000,
"value": 4611686018427388000,
"applicable_to": [
{
"product": {
"id": "<string>"
},
"sku": {
"id": "<string>"
},
"products_collection": {
"id": "<string>"
}
}
]
}
}
},
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 4611686018427388000
}
},
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique incentive identifier (prefix: linc_).
^linc_[a-f0-9]+$"linc_abc123def456"
Body
Request body for updating an incentive. At least one property must be provided. When the incentive is ACTIVE, only name and stock are allowed. When DRAFT, all properties may be updated. If type changes the corresponding detail object must also be provided.
1 - 200Type of incentive. Determines which detail object is present in the response and required in create/update requests.
POINTS, POINTS_PROPORTIONAL, MATERIAL, DIGITAL Fixed-points incentive configuration.
Show child attributes
Show child attributes
Proportional-points incentive configuration. The calculation_type determines which sub-object is required: - PRE_DISCOUNT_ORDER_AMOUNT -> order.amount - POST_DISCOUNT_ORDER_AMOUNT -> order.total_amount - ORDER_METADATA_VALUE -> order.metadata - CUSTOMER_METADATA_VALUE -> customer.metadata - PRE_DISCOUNT_ORDER_ITEMS_AMOUNT -> order_items.amount - POST_DISCOUNT_ORDER_ITEMS_AMOUNT -> order_items.subtotal_amount - ORDER_ITEMS_QUANTITY -> order_items.quantity
Show child attributes
Show child attributes
Material incentive configuration. Exactly one of product or sku must be provided based on type.
Show child attributes
Show child attributes
Digital incentive configuration. Exactly one of discount_coupons or gift_vouchers must be provided based on type.
Show child attributes
Show child attributes
0 <= x <= 2147483647Response
The updated incentive.
Incentive response object.
Unique incentive identifier.
^linc_[a-f0-9]+$"linc_abc123def456"
Human-readable name.
200Type of incentive. Determines which detail object is present in the response and required in create/update requests.
POINTS, POINTS_PROPORTIONAL, MATERIAL, DIGITAL Current lifecycle status of the incentive.
DRAFT, ACTIVE, DELETED Remaining stock count.
0 <= x <= 2147483647ISO 8601 creation timestamp.
Object type discriminator.
"incentive"Fixed-points incentive configuration.
Show child attributes
Show child attributes
Proportional-points incentive configuration. The calculation_type determines which sub-object is required: - PRE_DISCOUNT_ORDER_AMOUNT -> order.amount - POST_DISCOUNT_ORDER_AMOUNT -> order.total_amount - ORDER_METADATA_VALUE -> order.metadata - CUSTOMER_METADATA_VALUE -> customer.metadata - PRE_DISCOUNT_ORDER_ITEMS_AMOUNT -> order_items.amount - POST_DISCOUNT_ORDER_ITEMS_AMOUNT -> order_items.subtotal_amount - ORDER_ITEMS_QUANTITY -> order_items.quantity
Show child attributes
Show child attributes
Material incentive configuration. Exactly one of product or sku must be provided based on type.
Show child attributes
Show child attributes
Digital incentive configuration. Exactly one of discount_coupons or gift_vouchers must be provided based on type.
Show child attributes
Show child attributes
ISO 8601 last-update timestamp, or null if never updated.
Was this page helpful?

