Vincent is here! Just say the word, and Vincent will build the campaigns for you! Get early access.
curl --request POST \
--url https://api.voucherify.io/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",
"status": "DRAFT",
"code_config": {
"length": 123,
"charset": "<string>",
"prefix": "<string>",
"postfix": "<string>",
"pattern": "<string>"
},
"points_expiration": {
"type": "NO_EXPIRATION",
"rolling_expiration": {
"period": {
"unit": "DAY",
"value": 2
},
"rounding": {
"type": "END_OF_MONTH",
"value": 6
}
},
"calendar_expiration": {
"expiration_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"period": {
"value": 2,
"unit": "DAY"
},
"earning_activity": true,
"spending_activity": true,
"custom_activity": true,
"custom_activity_types": [
"<string>"
]
}
},
"pending_points": {
"type": "IMMEDIATE",
"period_based": {
"period": {
"unit": "DAY",
"value": 2
}
},
"fixed_dates": {
"dates": [
{
"day": 16,
"month": 6
}
]
},
"event_based": {
"event_types": [
"<string>"
],
"cancel_period": {
"value": 2,
"unit": "DAY"
}
}
},
"earning_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "BALANCE_BASED",
"max": 2
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 2,
"min_amount": 2
}
]
}
},
"spending_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "SPENDING_BASED",
"max": 2
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 2
}
]
}
},
"refunds": {
"spent_points": {
"type": "NONE",
"methods": [
{
"type": "RETURN_POINTS",
"mode": "REFUND_ALL"
}
]
},
"earned_points": {
"type": "NONE",
"methods": [
{
"type": "REVOKE_FROM_PENDING",
"mode": "REVOKE_TO_ZERO"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"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": 2,
"unit": "DAY"
},
"rounding": {
"type": "END_OF_MONTH",
"value": 6
}
},
"calendar_expiration": {
"expiration_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"earning_activity": true,
"spending_activity": true,
"custom_activity": true,
"custom_activity_types": [
"<string>"
],
"period": {
"value": 2,
"unit": "DAY"
}
}
},
"pending_points": {
"type": "IMMEDIATE",
"period_based": {
"period": {
"value": 2,
"unit": "DAY"
}
},
"fixed_dates": {
"dates": [
{
"day": 16,
"month": 6
}
]
},
"event_based": {
"event_types": [
"<string>"
],
"cancel_period": {
"value": 2,
"unit": "DAY"
}
}
},
"earning_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "BALANCE_BASED",
"max": 2,
"period": {
"type": "CURRENT_PERIOD",
"current_period": {
"unit": "DAY"
}
},
"points": {
"max": 1073741824
}
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 2,
"min_amount": 2
}
]
}
},
"spending_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "SPENDING_BASED",
"max": 2,
"period": {
"type": "CURRENT_PERIOD",
"current_period": {
"unit": "DAY"
}
},
"points": {
"max": 1073741824
}
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 2
}
]
}
},
"refunds": {
"spent_points": {
"type": "NONE",
"methods": [
{
"type": "RETURN_POINTS",
"mode": "REFUND_ALL"
}
]
},
"earned_points": {
"type": "NONE",
"methods": [
{
"type": "REVOKE_FROM_PENDING",
"mode": "REVOKE_TO_ZERO"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}⚠️ 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 with the specified configuration.
Required fields: name, type. All other fields have sensible defaults.
The code_config is optional on input but required internally (defaults are generated).
Custom validators applied:
createCardDefinitionBalanceSettings: balance_settings.allow_negative can only be true when points_expiration.type is NO_EXPIRATION.createCardDefinitionRefunds: refunds.earned_points.methods with type REVOKE_BELOW_ZERO requires balance_settings.allow_negative: true. Method type REVOKE_FROM_PENDING requires pending_points.type to be one of PERIOD_BASED, FIXED_DATES, or EVENT_BASED.curl --request POST \
--url https://api.voucherify.io/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",
"status": "DRAFT",
"code_config": {
"length": 123,
"charset": "<string>",
"prefix": "<string>",
"postfix": "<string>",
"pattern": "<string>"
},
"points_expiration": {
"type": "NO_EXPIRATION",
"rolling_expiration": {
"period": {
"unit": "DAY",
"value": 2
},
"rounding": {
"type": "END_OF_MONTH",
"value": 6
}
},
"calendar_expiration": {
"expiration_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"period": {
"value": 2,
"unit": "DAY"
},
"earning_activity": true,
"spending_activity": true,
"custom_activity": true,
"custom_activity_types": [
"<string>"
]
}
},
"pending_points": {
"type": "IMMEDIATE",
"period_based": {
"period": {
"unit": "DAY",
"value": 2
}
},
"fixed_dates": {
"dates": [
{
"day": 16,
"month": 6
}
]
},
"event_based": {
"event_types": [
"<string>"
],
"cancel_period": {
"value": 2,
"unit": "DAY"
}
}
},
"earning_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "BALANCE_BASED",
"max": 2
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 2,
"min_amount": 2
}
]
}
},
"spending_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "SPENDING_BASED",
"max": 2
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 2
}
]
}
},
"refunds": {
"spent_points": {
"type": "NONE",
"methods": [
{
"type": "RETURN_POINTS",
"mode": "REFUND_ALL"
}
]
},
"earned_points": {
"type": "NONE",
"methods": [
{
"type": "REVOKE_FROM_PENDING",
"mode": "REVOKE_TO_ZERO"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"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": 2,
"unit": "DAY"
},
"rounding": {
"type": "END_OF_MONTH",
"value": 6
}
},
"calendar_expiration": {
"expiration_dates": [
{
"day": 16,
"month": 6
}
]
},
"sliding_expiration": {
"earning_activity": true,
"spending_activity": true,
"custom_activity": true,
"custom_activity_types": [
"<string>"
],
"period": {
"value": 2,
"unit": "DAY"
}
}
},
"pending_points": {
"type": "IMMEDIATE",
"period_based": {
"period": {
"value": 2,
"unit": "DAY"
}
},
"fixed_dates": {
"dates": [
{
"day": 16,
"month": 6
}
]
},
"event_based": {
"event_types": [
"<string>"
],
"cancel_period": {
"value": 2,
"unit": "DAY"
}
}
},
"earning_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "BALANCE_BASED",
"max": 2,
"period": {
"type": "CURRENT_PERIOD",
"current_period": {
"unit": "DAY"
}
},
"points": {
"max": 1073741824
}
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 2,
"min_amount": 2
}
]
}
},
"spending_limits": {
"global": {
"type": "NO_LIMIT",
"limits": [
{
"type": "SPENDING_BASED",
"max": 2,
"period": {
"type": "CURRENT_PERIOD",
"current_period": {
"unit": "DAY"
}
},
"points": {
"max": 1073741824
}
}
]
},
"transactions": {
"type": "NO_LIMIT",
"limits": [
{
"type": "POINTS",
"max": 2
}
]
}
},
"refunds": {
"spent_points": {
"type": "NONE",
"methods": [
{
"type": "RETURN_POINTS",
"mode": "REFUND_ALL"
}
]
},
"earned_points": {
"type": "NONE",
"methods": [
{
"type": "REVOKE_FROM_PENDING",
"mode": "REVOKE_TO_ZERO"
}
]
}
},
"balance_settings": {
"allow_negative": true
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}Documentation Index
Fetch the complete documentation index at: https://docs.voucherify.io/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
1 - 200INDIVIDUAL Initial status. Defaults to DRAFT if not provided.
DRAFT, ACTIVE, null Code generation configuration. Defaults to 10-character alphanumeric pattern if not provided.
Show child attributes
Points expiration policy. Defaults to NO_EXPIRATION.
Show child attributes
Pending points policy. Defaults to IMMEDIATE.
Show child attributes
Earning limits configuration. Defaults to no limits.
Show child attributes
Spending limits configuration. Defaults to no limits.
Show child attributes
Refund policies. Defaults to no refunds.
Show child attributes
Balance settings. Defaults to allow_negative: false.
Show child attributes
Created card definition
Full card definition DTO returned by all CRUD endpoints.
INDIVIDUAL DRAFT, ACTIVE, INACTIVE, DELETED Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"card_definition"Was this page helpful?