A valid request URL is required to generate request examples{
"id": "<string>",
"name": "<string>",
"type": "INDIVIDUAL",
"code_config": {
"pattern": "<string>",
"length": 123,
"charset": "<string>",
"prefix": "<string>",
"postfix": "<string>"
},
"points_expiration": {
"rolling_expiration": {
"period": {
"value": 123
},
"rounding": {
"value": 6
}
},
"calendar_expiration": {
"expiration_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"custom_activity_types": [
"<string>"
],
"period": {
"value": 123
},
"earning_activity": true,
"spending_activity": true,
"custom_activity": true
}
},
"pending_points": {
"period_based": {
"period": {
"value": 123
}
},
"fixed_dates": {
"dates": [
{
"day": 16,
"month": 6
}
]
},
"event_based": {
"event_types": [
"<string>"
],
"cancel_period": {
"value": 123
}
}
},
"earning_limits": {
"global": {
"limits": [
{
"type": "<string>",
"max": 123
}
]
},
"transactions": {
"limits": [
{
"type": "<string>",
"max": 123
}
]
}
},
"spending_limits": {
"global": {
"limits": [
{
"type": "<string>",
"max": 123
}
]
},
"transactions": {
"limits": [
{
"type": "<string>",
"max": 123
}
]
}
},
"refunds": {
"spent_points": {
"methods": [
{
"type": "<string>"
}
]
},
"earned_points": {
"methods": [
{
"type": "<string>"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"pay_with_points": {
"exchange_ratio": {
"formula": "<string>"
}
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}Create Card Definition
⚠️ 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.
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.
curl --request POST \
--url {protocol}://{host}/v2/loyalties/card-definitions \
--header 'Authorization: Bearer <token>' \
--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": "<string>",
"max": 2
}
]
},
"transactions": {
"limits": [
{
"type": "<string>",
"max": 2
}
]
}
},
"spending_limits": {
"global": {
"limits": [
{
"type": "<string>",
"max": 2
}
]
},
"transactions": {
"limits": [
{
"type": "<string>",
"max": 2
}
]
}
},
"refunds": {
"spent_points": {
"methods": [
{
"type": "<string>"
}
]
},
"earned_points": {
"methods": [
{
"type": "<string>"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"pay_with_points": {
"type": "<string>"
},
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"type": "INDIVIDUAL",
"code_config": {
"pattern": "<string>",
"length": 123,
"charset": "<string>",
"prefix": "<string>",
"postfix": "<string>"
},
"points_expiration": {
"rolling_expiration": {
"period": {
"value": 123
},
"rounding": {
"value": 6
}
},
"calendar_expiration": {
"expiration_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"custom_activity_types": [
"<string>"
],
"period": {
"value": 123
},
"earning_activity": true,
"spending_activity": true,
"custom_activity": true
}
},
"pending_points": {
"period_based": {
"period": {
"value": 123
}
},
"fixed_dates": {
"dates": [
{
"day": 16,
"month": 6
}
]
},
"event_based": {
"event_types": [
"<string>"
],
"cancel_period": {
"value": 123
}
}
},
"earning_limits": {
"global": {
"limits": [
{
"type": "<string>",
"max": 123
}
]
},
"transactions": {
"limits": [
{
"type": "<string>",
"max": 123
}
]
}
},
"spending_limits": {
"global": {
"limits": [
{
"type": "<string>",
"max": 123
}
]
},
"transactions": {
"limits": [
{
"type": "<string>",
"max": 123
}
]
}
},
"refunds": {
"spent_points": {
"methods": [
{
"type": "<string>"
}
]
},
"earned_points": {
"methods": [
{
"type": "<string>"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"pay_with_points": {
"exchange_ratio": {
"formula": "<string>"
}
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for creating a card definition.
Cross-field rules apply: balance_settings.allow_negative: true requires
points_expiration.type to be NO_EXPIRATION; the earned points refund mode
REVOKE_BELOW_ZERO requires allow_negative: true; and the earned points refund
method REVOKE_FROM_PENDING requires pending_points.type to be PERIOD_BASED,
FIXED_DATES or EVENT_BASED.
Card definition name.
1 - 200Card definition type. Currently only INDIVIDUAL is supported.
INDIVIDUAL Initial status. Allowed values on create are DRAFT and ACTIVE. Defaults to DRAFT when omitted.
DRAFT, ACTIVE, null Card code generation configuration. Defaults to a 10-character alphanumeric pattern.
Show child attributes
Show child attributes
Points expiration policy. Defaults to NO_EXPIRATION.
Show child attributes
Show child attributes
Pending points activation policy. Defaults to IMMEDIATE.
Show child attributes
Show child attributes
Points earning limits. Defaults to NO_LIMIT for both global and transaction limits.
Show child attributes
Show child attributes
Points spending limits. Defaults to NO_LIMIT for both global and transaction limits.
Show child attributes
Show child attributes
Refund handling configuration. Defaults to NONE for both spent and earned points.
Show child attributes
Show child attributes
Card balance settings. Defaults to allow_negative: false.
Show child attributes
Show child attributes
Pay-with-points configuration. Defaults to NO_PAYMENTS.
- Option 1
- Option 2
Show child attributes
Show child attributes
Arbitrary key-value metadata attached to the card definition.
Response
The created card definition.
A card definition.
Unique card definition ID.
^lcdef_[a-f0-9]+$Card definition name.
Card definition type.
INDIVIDUAL Current card definition status.
DRAFT, ACTIVE, DELETED Card code generation configuration. Always present with server-side defaults applied.
Show child attributes
Show child attributes
Points expiration policy. Always present; defaults to NO_EXPIRATION.
Show child attributes
Show child attributes
Pending points activation policy. Always present; defaults to IMMEDIATE.
Show child attributes
Show child attributes
Points earning limits. Always present; defaults to NO_LIMIT for both scopes.
Show child attributes
Show child attributes
Points spending limits. Always present; defaults to NO_LIMIT for both scopes.
Show child attributes
Show child attributes
Refund handling configuration. Always present; defaults to NONE for both scopes.
Show child attributes
Show child attributes
Card balance settings. Always present; defaults to allow_negative: false.
Show child attributes
Show child attributes
Pay-with-points configuration. Always present; defaults to NO_PAYMENTS.
Show child attributes
Show child attributes
Arbitrary key-value metadata. Empty object when not set.
Creation timestamp (ISO 8601).
Last update timestamp (ISO 8601). Null when the card definition has never been updated.
Object type marker. Always card_definition.
"card_definition"Was this page helpful?

