Skip to main content
POST
Create digital card

POST /cards/create

Issue a card from a template and email its QR code to the customer. Send Authorization: Bearer YOUR_API_KEY and X-Device-ID: YOUR_DEVICE_ID. Also send X-Employee-Token: YOUR_EMPLOYEE_TOKEN. See authentication. Returns 201 Created with the card object. The identifier is cardId; customer data is stored separately and the card includes customerEmail. Supply customer.email and customer.contact.fullName, plus any mandatory customer fields configured for the account. Use nested contact and address objects. For variable-value coupon templates (isAmountSpecified: false), supply a positive amount in cents. Fixed-value coupon templates use their configured amount. testCard defaults to false. Real issuance requires an active subscription and can generate a billing event; test issuance has a limited window and card count.

Example request

Example response fields

Authorizations

Authorization
string
header
required

Location API key. Also requires X-Device-ID.

X-Employee-Token
string
header
required

Employee session token from /employee/login.

Headers

X-Device-ID
string
required

Stable device identifier. API key binds to this value on first use.

Body

application/json
templateId
string
required

MongoDB object id.

Pattern: ^[a-fA-F0-9]{24}$
customer
object
required
amount
integer

Positive coupon amount in cents. Required for variable-value coupon templates.

Required range: x >= 1
testCard
boolean

Request a test card, subject to the account test period and card limit.

Response

Success

cardType
enum<string>
required
Available options:
blankCard
id
string

MongoDB object id.

Pattern: ^[a-fA-F0-9]{24}$
cardId
string

Reusable printed or digital card identifier.

serialNumber
integer
pocketId
string
createdAt
string<date-time>
updatedAt
string<date-time>
activatedAt
string<date-time>
canceledAt
string<date-time>
activated
boolean
lifetime
integer

Lifetime in hours, measured from createdAt; 0 means unlimited.

Required range: x >= 0
description
string
amount
integer

Original coupon value in cents, or template amount for other types.

location
object
createdByEmployeeId
string

MongoDB object id.

Pattern: ^[a-fA-F0-9]{24}$
archived
boolean
testCard
boolean
isLocationBound
boolean

When true, use is restricted to the issuing location.

customerEmail
string
templateId
string

MongoDB object id.

Pattern: ^[a-fA-F0-9]{24}$
logs
object[]