Create Card Definition
curl --request POST \
--url https://{cluster}.voucherify.io/v2/loyalties/card-definitions \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "<string>",
"type": "INDIVIDUAL",
"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."
}Create Card Definition
Documentation in progress
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.
Creates a new card definition. Only name and type are required; all other
sections default server-side as follows:
code_config: 10-character alphanumeric code pattern (##########)points_expiration:NO_EXPIRATIONpending_points:IMMEDIATEearning_limits: globalNO_LIMIT, transactionsNO_LIMITspending_limits: globalNO_LIMIT, transactionsNO_LIMITrefunds: spent pointsNONE, earned pointsNONEbalance_settings:allow_negative: falsepay_with_points:NO_PAYMENTS
Cross-field rules:
balance_settings.allow_negativecan only betruewhenpoints_expiration.typeisNO_EXPIRATION. Additionally, the earned points refund modeREVOKE_BELOW_ZEROrequiresbalance_settings.allow_negativeto betrue.- The earned points refund method
REVOKE_FROM_PENDINGrequirespending_points.typeto be one ofPERIOD_BASED,FIXED_DATES,EVENT_BASED.
A successful call records vl.card_definition.created.
POST
/
v2
/
loyalties
/
card-definitions
Create Card Definition
curl --request POST \
--url https://{cluster}.voucherify.io/v2/loyalties/card-definitions \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "<string>",
"type": "INDIVIDUAL",
"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
X-App-Id & X-App-TokenbearerAuth
Body
application/json
Request body schema for POST /v2/loyalties/card-definitions.
Response
The created card definition.
Response body schema for POST /v2/loyalties/card-definitions.

