curl --request PUT \
--url https://{cluster}.voucherify.io/v2/loyalties/card-definitions/{cardDefinitionId} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "<string>",
"code_config": {
"length": 123,
"charset": "<string>",
"prefix": "<string>",
"postfix": "<string>",
"pattern": "<string>"
},
"points_expiration": {
"rolling_expiration": {
"period": {
"value": 45
},
"rounding": {
"value": 6
}
},
"calendar_expiration": {
"expiration_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"period": {
"value": 45
},
"earning_activity": true,
"spending_activity": true,
"custom_activity": true,
"custom_activity_types": [
"<string>"
]
}
},
"pending_points": {
"period_based": {
"period": {
"value": 45
}
},
"fixed_dates": {
"dates": [
{
"day": 16,
"month": 6
}
]
},
"event_based": {
"event_types": [
"<string>"
],
"cancel_period": {
"value": 45
}
}
},
"earning_limits": {
"global": {
"limits": [
{
"type": "BALANCE_BASED",
"max": 2
}
]
},
"transactions": {
"limits": [
{
"type": "POINTS",
"max": 2
}
]
}
},
"spending_limits": {
"global": {
"limits": [
{
"type": "SPENDING_BASED",
"max": 2
}
]
},
"transactions": {
"limits": [
{
"type": "POINTS",
"max": 2
}
]
}
},
"refunds": {
"spent_points": {
"methods": [
{
"type": "RETURN_POINTS"
}
]
},
"earned_points": {
"methods": [
{
"type": "REVOKE_FROM_PENDING"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"pay_with_points": {
"type": "NO_PAYMENTS"
},
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"type": "INDIVIDUAL",
"status": "DRAFT",
"code_config": {
"pattern": "<string>",
"length": 123,
"charset": "<string>",
"prefix": "<string>",
"postfix": "<string>"
},
"points_expiration": {
"type": "NO_EXPIRATION",
"rolling_expiration": {
"period": {
"value": 123,
"unit": "DAY"
},
"rounding": {
"type": "END_OF_MONTH",
"value": 6
}
},
"calendar_expiration": {
"expiration_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"custom_activity_types": [
"<string>"
],
"period": {
"value": 123,
"unit": "DAY"
},
"earning_activity": true,
"spending_activity": true,
"custom_activity": true
}
},
"pending_points": {
"type": "IMMEDIATE",
"period_based": {
"period": {
"value": 123,
"unit": "DAY"
}
},
"fixed_dates": {
"dates": [
{
"day": 16,
"month": 6
}
]
},
"event_based": {
"event_types": [
"<string>"
],
"cancel_period": {
"value": 123,
"unit": "DAY"
}
}
},
"earning_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "BALANCE_BASED",
"max": 123
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 123
}
]
}
},
"spending_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "SPENDING_BASED",
"max": 123
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 123
}
]
}
},
"refunds": {
"spent_points": {
"type": "NONE",
"methods": [
{
"type": "RETURN_POINTS",
"mode": "REFUND_ALL"
}
]
},
"earned_points": {
"type": "NONE",
"methods": [
{
"type": "REVOKE_FROM_PENDING"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"pay_with_points": {
"type": "NO_PAYMENTS",
"exchange_ratio": {
"formula": "<string>"
}
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "card_definition"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 500,
"key": "api_error",
"message": "Something went wrong. Don't worry, your campaigns are still safe and the Voucherify Team has been notified. Check out our Help Center and forums for help, or head back to home."
}Update Card Definition
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact Voucherify support or your Technical Account Manager.
Updates a card definition. This is a partial update: properties you don’t send keep their current values, and the body must include at least one property. type and status cannot be changed through this endpoint (status transitions are performed via the activate/draft endpoints).
Rules for the properties you send:
code_config,points_expiration,pending_points,earning_limits,spending_limits,refunds,balance_settings, andpay_with_pointsreplace the stored object as a whole. They are not merged. A field you leave out inside the object takes its default value, not the stored one. For example, a side ofrefundsyou leave out (spent_pointsorearned_points) is reset toNONE.metadatais merged. Keys you send are added or overwritten (a nested object under a key is replaced as a whole), and other keys are kept.
How null works:
namecannot benull. The request is rejected.code_config,points_expiration,pending_points,earning_limits,spending_limits,refunds,balance_settings, andpay_with_points:nullis treated as not sent and keeps the current value.metadata:nullremoves all metadata. The request is rejected if the project’s metadata schema for this object has required properties.
When the card definition is in use (e.g. assigned to a program with existing cards),
updates to restricted sections may be rejected with a resource-locked error;
only name, metadata and pay_with_points are always updatable.
A successful call records vl.card_definition.updated.
curl --request PUT \
--url https://{cluster}.voucherify.io/v2/loyalties/card-definitions/{cardDefinitionId} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "<string>",
"code_config": {
"length": 123,
"charset": "<string>",
"prefix": "<string>",
"postfix": "<string>",
"pattern": "<string>"
},
"points_expiration": {
"rolling_expiration": {
"period": {
"value": 45
},
"rounding": {
"value": 6
}
},
"calendar_expiration": {
"expiration_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"period": {
"value": 45
},
"earning_activity": true,
"spending_activity": true,
"custom_activity": true,
"custom_activity_types": [
"<string>"
]
}
},
"pending_points": {
"period_based": {
"period": {
"value": 45
}
},
"fixed_dates": {
"dates": [
{
"day": 16,
"month": 6
}
]
},
"event_based": {
"event_types": [
"<string>"
],
"cancel_period": {
"value": 45
}
}
},
"earning_limits": {
"global": {
"limits": [
{
"type": "BALANCE_BASED",
"max": 2
}
]
},
"transactions": {
"limits": [
{
"type": "POINTS",
"max": 2
}
]
}
},
"spending_limits": {
"global": {
"limits": [
{
"type": "SPENDING_BASED",
"max": 2
}
]
},
"transactions": {
"limits": [
{
"type": "POINTS",
"max": 2
}
]
}
},
"refunds": {
"spent_points": {
"methods": [
{
"type": "RETURN_POINTS"
}
]
},
"earned_points": {
"methods": [
{
"type": "REVOKE_FROM_PENDING"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"pay_with_points": {
"type": "NO_PAYMENTS"
},
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"type": "INDIVIDUAL",
"status": "DRAFT",
"code_config": {
"pattern": "<string>",
"length": 123,
"charset": "<string>",
"prefix": "<string>",
"postfix": "<string>"
},
"points_expiration": {
"type": "NO_EXPIRATION",
"rolling_expiration": {
"period": {
"value": 123,
"unit": "DAY"
},
"rounding": {
"type": "END_OF_MONTH",
"value": 6
}
},
"calendar_expiration": {
"expiration_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"custom_activity_types": [
"<string>"
],
"period": {
"value": 123,
"unit": "DAY"
},
"earning_activity": true,
"spending_activity": true,
"custom_activity": true
}
},
"pending_points": {
"type": "IMMEDIATE",
"period_based": {
"period": {
"value": 123,
"unit": "DAY"
}
},
"fixed_dates": {
"dates": [
{
"day": 16,
"month": 6
}
]
},
"event_based": {
"event_types": [
"<string>"
],
"cancel_period": {
"value": 123,
"unit": "DAY"
}
}
},
"earning_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "BALANCE_BASED",
"max": 123
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 123
}
]
}
},
"spending_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "SPENDING_BASED",
"max": 123
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 123
}
]
}
},
"refunds": {
"spent_points": {
"type": "NONE",
"methods": [
{
"type": "RETURN_POINTS",
"mode": "REFUND_ALL"
}
]
},
"earned_points": {
"type": "NONE",
"methods": [
{
"type": "REVOKE_FROM_PENDING"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"pay_with_points": {
"type": "NO_PAYMENTS",
"exchange_ratio": {
"formula": "<string>"
}
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "card_definition"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 500,
"key": "api_error",
"message": "Something went wrong. Don't worry, your campaigns are still safe and the Voucherify Team has been notified. Check out our Help Center and forums for help, or head back to home."
}Authorizations
Path Parameters
Body
Request body schema for PUT /v2/loyalties/card-definitions/{cardDefinitionId}.
Response
The updated card definition.
Response body schema for PUT /v2/loyalties/card-definitions/{cardDefinitionId}.

