Transfergiftcardbalance
curl --request POST \
--url https://api.loyalty.dog/v2/giftcards/programs/{programId}/cards/{cardId}/transfer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"securityCode": "<string>",
"destinationCardNumber": "<string>",
"amount": 2500.005
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({securityCode: '<string>', destinationCardNumber: '<string>', amount: 2500.005})
};
fetch('https://api.loyalty.dog/v2/giftcards/programs/{programId}/cards/{cardId}/transfer', 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/{cardId}/transfer"
payload = {
"securityCode": "<string>",
"destinationCardNumber": "<string>",
"amount": 2500.005
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"message": "<string>",
"transferId": "<string>",
"sourceCard": {
"id": "5eb7cf5a86d9755df3a6c593",
"cardNumber": "<string>",
"remainingBalance": "<string>",
"status": "pending"
},
"destinationCard": {
"id": "5eb7cf5a86d9755df3a6c593",
"cardNumber": "<string>",
"newBalance": "<string>"
},
"amountTransferred": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Gift Cards
Transfergiftcardbalance
Transfer Balance Between Gift Cards
Moves a specified amount from a source gift card to a destination gift card within the same program. The source card’s security code is required to authorise the transfer.
Both cards must be active and belong to the same program. A TRANSFER_OUT transaction is recorded
on the source card and a TRANSFER_IN transaction on the destination card.
Business Rules:
- Source and destination cards must be different
- Both cards must have status
active - Source card balance must be >= transfer amount
- Destination card balance after transfer must not exceed £10,000.00
- Source card security code must match (constant-time comparison)
- Transfer depletes source card if resulting balance reaches zero
Status Codes:
- 200: Transfer completed successfully
- 400: Invalid amount, insufficient balance, or cards not eligible
- 401: Incorrect security code
- 404: Source or destination card not found
- 409: Card currently locked by another operation
Idempotency Scope:
- Idempotency keys are scoped to
programId + transfer + sourceCardId + destinationCardId - The same key may be reused for different source/destination pairs or other gift card actions
POST
/
v2
/
giftcards
/
programs
/
{programId}
/
cards
/
{cardId}
/
transfer
Transfergiftcardbalance
curl --request POST \
--url https://api.loyalty.dog/v2/giftcards/programs/{programId}/cards/{cardId}/transfer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"securityCode": "<string>",
"destinationCardNumber": "<string>",
"amount": 2500.005
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({securityCode: '<string>', destinationCardNumber: '<string>', amount: 2500.005})
};
fetch('https://api.loyalty.dog/v2/giftcards/programs/{programId}/cards/{cardId}/transfer', 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/{cardId}/transfer"
payload = {
"securityCode": "<string>",
"destinationCardNumber": "<string>",
"amount": 2500.005
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"message": "<string>",
"transferId": "<string>",
"sourceCard": {
"id": "5eb7cf5a86d9755df3a6c593",
"cardNumber": "<string>",
"remainingBalance": "<string>",
"status": "pending"
},
"destinationCard": {
"id": "5eb7cf5a86d9755df3a6c593",
"cardNumber": "<string>",
"newBalance": "<string>"
},
"amountTransferred": "<string>"
}{
"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"
Required string length:
24Pattern:
^[0-9a-f]{24}$Example:
"5eb7cf5a86d9755df3a6c593"
Body
application/json
