Issue multiple gift cards
curl --request POST \
--url https://api.loyalty.dog/v2/giftcards/programs/{programId}/cards/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"initialValue": 5000.005
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({initialValue: 5000.005})
};
fetch('https://api.loyalty.dog/v2/giftcards/programs/{programId}/cards/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.loyalty.dog/v2/giftcards/programs/{programId}/cards/bulk"
payload = { "initialValue": 5000.005 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"issuedCount": 123,
"cards": [
{
"id": "<string>",
"cardNumber": "<string>",
"lastFourDigits": "<string>"
}
],
"csvDownloadUrl": "<string>",
"failedCount": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Gift Cards
Issue multiple gift cards
Bulk Issue Gift Cards
Issues multiple gift cards in a single request. For counts up to the sync
threshold (gift_card_bulk_issue_sync_threshold, default 50) the cards are
created synchronously and returned immediately. For larger batches the request
is accepted asynchronously and a task ID is returned for polling.
Issuance modes:
count(integer) — count-only: cards have no recipient data; a CSV download link is returned so the merchant can distribute the numbers.recipients(list) — per-recipient: each card is optionally pre-populated with the given customer info and a notification is dispatched.
Path Parameters:
programId: MongoDB ObjectId of the loyalty program
Request Body (BulkIssueGiftCardRequest):
initialValue: Starting balance (0.01 – 10,000.00)isPhysical:truefor physical cardsdesignTemplate: Optional design-template slugexpiresAt: Optional explicit expiry; defaults to +365 dayscountorrecipients: Mutually exclusive
Response (sync ≤ threshold):
- HTTP 201 with
BulkIssuanceSyncResponse
Response (async > threshold):
- HTTP 202 with
BulkIssuanceAsyncResponse(taskId,status)
Idempotency:
- Pass
Idempotency-Keyheader to make the request safely retryable.
POST
/
v2
/
giftcards
/
programs
/
{programId}
/
cards
/
bulk
Issue multiple gift cards
curl --request POST \
--url https://api.loyalty.dog/v2/giftcards/programs/{programId}/cards/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"initialValue": 5000.005
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({initialValue: 5000.005})
};
fetch('https://api.loyalty.dog/v2/giftcards/programs/{programId}/cards/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.loyalty.dog/v2/giftcards/programs/{programId}/cards/bulk"
payload = { "initialValue": 5000.005 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"issuedCount": 123,
"cards": [
{
"id": "<string>",
"cardNumber": "<string>",
"lastFourDigits": "<string>"
}
],
"csvDownloadUrl": "<string>",
"failedCount": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
JWT access token obtained from POST /v2/token.
Headers
Path Parameters
Required string length:
24Pattern:
^[0-9a-f]{24}$Example:
"5eb7cf5a86d9755df3a6c593"
Query Parameters
Required string length:
24Pattern:
^[0-9a-f]{24}$Example:
"5eb7cf5a86d9755df3a6c593"
Body
application/json
