Batch Create Gift Card
The Dintero wallet services support batch creation of gift cards. Use this when you need to pre-generate cards for printing before they are sold and activated.
A typical example is a retail chain ordering a batch of physical gift cards from a card manufacturer. The cards are printed with the token and PIN, distributed to stores, and activated individually at the point of sale when a customer purchases one.
Create a batch of gift cards
Create 2 unactivated gift cards for printing
POST https://api.dintero.com/v1/accounts/{aid}/wallets/cards/batch
Authorization: Bearer <token>
Content-Type: application/json
{
"cards": [
{
"card_id": "card-01",
"type": "gift_card"
},
{
"card_id": "card-02",
"type": "gift_card"
}
],
"options": {
"pin": {
"format": {
"length": 36,
"prefix": "DINCARD:",
"symbols": true,
"numbers": true,
"characters": true,
"barcode": false
}
},
"card_token": {
"format": {
"length": 36,
"prefix": "DINCARD:",
"symbols": true,
"numbers": true,
"characters": true,
"barcode": false
}
}
}
}
Cards created via batch are assigned status inactive and carry no balance.
The card_token and pin for each card are included in the response and will
not be retrievable again after this call. Store or forward them immediately
for printing.
Activate a gift card
When a card is sold, activate it using:
POST https://api.dintero.com/v1/accounts/{aid}/wallets/cards/{card_id}/activate
Authorization: Bearer <token>
Content-Type: application/json
{
"customer_id": "string",
"name": "string",
"amount": 50000,
"currency": "NOK",
"originated_by": "string",
"active_from": "2019-08-24T14:15:22Z",
"expires_at": "2019-08-24T14:15:22Z",
"metadata": {
"dintero_transaction_id": "P12345678.xxxxx"
}
}
This transitions the card from inactive to unused and sets the balance. All
fields are optional except amount and currency:
| Field | Description |
|---|---|
| amount / currency | Required. Initial balance loaded onto the card |
| customer_id | Associate the card with a customer at point of sale |
| active_from | Defaults to the time of activation if omitted |
| expires_at | Omit if the card should not expire |
| metadata | Recommended — include the transaction that sold the card |
Cards in inactive status cannot be used for payment.