Apply template
curl --request POST \
--url https://tapcoupon.at/api/v1/cards/apply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Device-ID: <x-device-id>' \
--header 'X-Employee-Token: <api-key>' \
--data '
{
"cardId": "9866191586296",
"templateId": "693869428d49e641ba110e17",
"customer": {
"email": "bob@example.com",
"contact": {
"fullName": "Bob Example",
"phone": "+43123456789"
},
"address": {
"line1": "Bakers Street 41",
"city": "Vienna",
"postalCode": "1010",
"countryCode": "AT"
},
"birthdate": "1990-06-15T00:00:00Z",
"privacyConsentGiven": true
}
}
'import requests
url = "https://tapcoupon.at/api/v1/cards/apply"
payload = {
"cardId": "9866191586296",
"templateId": "693869428d49e641ba110e17",
"customer": {
"email": "bob@example.com",
"contact": {
"fullName": "Bob Example",
"phone": "+43123456789"
},
"address": {
"line1": "Bakers Street 41",
"city": "Vienna",
"postalCode": "1010",
"countryCode": "AT"
},
"birthdate": "1990-06-15T00:00:00Z",
"privacyConsentGiven": True
}
}
headers = {
"X-Device-ID": "<x-device-id>",
"Authorization": "Bearer <token>",
"X-Employee-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Device-ID': '<x-device-id>',
Authorization: 'Bearer <token>',
'X-Employee-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cardId: '9866191586296',
templateId: '693869428d49e641ba110e17',
customer: {
email: 'bob@example.com',
contact: {fullName: 'Bob Example', phone: '+43123456789'},
address: {
line1: 'Bakers Street 41',
city: 'Vienna',
postalCode: '1010',
countryCode: 'AT'
},
birthdate: '1990-06-15T00:00:00Z',
privacyConsentGiven: true
}
})
};
fetch('https://tapcoupon.at/api/v1/cards/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tapcoupon.at/api/v1/cards/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cardId' => '9866191586296',
'templateId' => '693869428d49e641ba110e17',
'customer' => [
'email' => 'bob@example.com',
'contact' => [
'fullName' => 'Bob Example',
'phone' => '+43123456789'
],
'address' => [
'line1' => 'Bakers Street 41',
'city' => 'Vienna',
'postalCode' => '1010',
'countryCode' => 'AT'
],
'birthdate' => '1990-06-15T00:00:00Z',
'privacyConsentGiven' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Device-ID: <x-device-id>",
"X-Employee-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tapcoupon.at/api/v1/cards/apply"
payload := strings.NewReader("{\n \"cardId\": \"9866191586296\",\n \"templateId\": \"693869428d49e641ba110e17\",\n \"customer\": {\n \"email\": \"bob@example.com\",\n \"contact\": {\n \"fullName\": \"Bob Example\",\n \"phone\": \"+43123456789\"\n },\n \"address\": {\n \"line1\": \"Bakers Street 41\",\n \"city\": \"Vienna\",\n \"postalCode\": \"1010\",\n \"countryCode\": \"AT\"\n },\n \"birthdate\": \"1990-06-15T00:00:00Z\",\n \"privacyConsentGiven\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Device-ID", "<x-device-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Employee-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://tapcoupon.at/api/v1/cards/apply")
.header("X-Device-ID", "<x-device-id>")
.header("Authorization", "Bearer <token>")
.header("X-Employee-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cardId\": \"9866191586296\",\n \"templateId\": \"693869428d49e641ba110e17\",\n \"customer\": {\n \"email\": \"bob@example.com\",\n \"contact\": {\n \"fullName\": \"Bob Example\",\n \"phone\": \"+43123456789\"\n },\n \"address\": {\n \"line1\": \"Bakers Street 41\",\n \"city\": \"Vienna\",\n \"postalCode\": \"1010\",\n \"countryCode\": \"AT\"\n },\n \"birthdate\": \"1990-06-15T00:00:00Z\",\n \"privacyConsentGiven\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tapcoupon.at/api/v1/cards/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Device-ID"] = '<x-device-id>'
request["Authorization"] = 'Bearer <token>'
request["X-Employee-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cardId\": \"9866191586296\",\n \"templateId\": \"693869428d49e641ba110e17\",\n \"customer\": {\n \"email\": \"bob@example.com\",\n \"contact\": {\n \"fullName\": \"Bob Example\",\n \"phone\": \"+43123456789\"\n },\n \"address\": {\n \"line1\": \"Bakers Street 41\",\n \"city\": \"Vienna\",\n \"postalCode\": \"1010\",\n \"countryCode\": \"AT\"\n },\n \"birthdate\": \"1990-06-15T00:00:00Z\",\n \"privacyConsentGiven\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Template applied to card successfully"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}Cards
Apply template
Activate a blank card or reconfigure an eligible existing card.
POST
/
cards
/
apply
Apply template
curl --request POST \
--url https://tapcoupon.at/api/v1/cards/apply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Device-ID: <x-device-id>' \
--header 'X-Employee-Token: <api-key>' \
--data '
{
"cardId": "9866191586296",
"templateId": "693869428d49e641ba110e17",
"customer": {
"email": "bob@example.com",
"contact": {
"fullName": "Bob Example",
"phone": "+43123456789"
},
"address": {
"line1": "Bakers Street 41",
"city": "Vienna",
"postalCode": "1010",
"countryCode": "AT"
},
"birthdate": "1990-06-15T00:00:00Z",
"privacyConsentGiven": true
}
}
'import requests
url = "https://tapcoupon.at/api/v1/cards/apply"
payload = {
"cardId": "9866191586296",
"templateId": "693869428d49e641ba110e17",
"customer": {
"email": "bob@example.com",
"contact": {
"fullName": "Bob Example",
"phone": "+43123456789"
},
"address": {
"line1": "Bakers Street 41",
"city": "Vienna",
"postalCode": "1010",
"countryCode": "AT"
},
"birthdate": "1990-06-15T00:00:00Z",
"privacyConsentGiven": True
}
}
headers = {
"X-Device-ID": "<x-device-id>",
"Authorization": "Bearer <token>",
"X-Employee-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Device-ID': '<x-device-id>',
Authorization: 'Bearer <token>',
'X-Employee-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cardId: '9866191586296',
templateId: '693869428d49e641ba110e17',
customer: {
email: 'bob@example.com',
contact: {fullName: 'Bob Example', phone: '+43123456789'},
address: {
line1: 'Bakers Street 41',
city: 'Vienna',
postalCode: '1010',
countryCode: 'AT'
},
birthdate: '1990-06-15T00:00:00Z',
privacyConsentGiven: true
}
})
};
fetch('https://tapcoupon.at/api/v1/cards/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tapcoupon.at/api/v1/cards/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cardId' => '9866191586296',
'templateId' => '693869428d49e641ba110e17',
'customer' => [
'email' => 'bob@example.com',
'contact' => [
'fullName' => 'Bob Example',
'phone' => '+43123456789'
],
'address' => [
'line1' => 'Bakers Street 41',
'city' => 'Vienna',
'postalCode' => '1010',
'countryCode' => 'AT'
],
'birthdate' => '1990-06-15T00:00:00Z',
'privacyConsentGiven' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Device-ID: <x-device-id>",
"X-Employee-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tapcoupon.at/api/v1/cards/apply"
payload := strings.NewReader("{\n \"cardId\": \"9866191586296\",\n \"templateId\": \"693869428d49e641ba110e17\",\n \"customer\": {\n \"email\": \"bob@example.com\",\n \"contact\": {\n \"fullName\": \"Bob Example\",\n \"phone\": \"+43123456789\"\n },\n \"address\": {\n \"line1\": \"Bakers Street 41\",\n \"city\": \"Vienna\",\n \"postalCode\": \"1010\",\n \"countryCode\": \"AT\"\n },\n \"birthdate\": \"1990-06-15T00:00:00Z\",\n \"privacyConsentGiven\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Device-ID", "<x-device-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Employee-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://tapcoupon.at/api/v1/cards/apply")
.header("X-Device-ID", "<x-device-id>")
.header("Authorization", "Bearer <token>")
.header("X-Employee-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cardId\": \"9866191586296\",\n \"templateId\": \"693869428d49e641ba110e17\",\n \"customer\": {\n \"email\": \"bob@example.com\",\n \"contact\": {\n \"fullName\": \"Bob Example\",\n \"phone\": \"+43123456789\"\n },\n \"address\": {\n \"line1\": \"Bakers Street 41\",\n \"city\": \"Vienna\",\n \"postalCode\": \"1010\",\n \"countryCode\": \"AT\"\n },\n \"birthdate\": \"1990-06-15T00:00:00Z\",\n \"privacyConsentGiven\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tapcoupon.at/api/v1/cards/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Device-ID"] = '<x-device-id>'
request["Authorization"] = 'Bearer <token>'
request["X-Employee-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cardId\": \"9866191586296\",\n \"templateId\": \"693869428d49e641ba110e17\",\n \"customer\": {\n \"email\": \"bob@example.com\",\n \"contact\": {\n \"fullName\": \"Bob Example\",\n \"phone\": \"+43123456789\"\n },\n \"address\": {\n \"line1\": \"Bakers Street 41\",\n \"city\": \"Vienna\",\n \"postalCode\": \"1010\",\n \"countryCode\": \"AT\"\n },\n \"birthdate\": \"1990-06-15T00:00:00Z\",\n \"privacyConsentGiven\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Template applied to card successfully"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}POST /cards/apply
Activate a blank card or reconfigure an eligible existing card.
Send Authorization: Bearer YOUR_API_KEY and X-Device-ID: YOUR_DEVICE_ID. Also send X-Employee-Token: YOUR_EMPLOYEE_TOKEN. See authentication.
A blank card can receive its first template. An existing card must be activated and fully used before normal reconfiguration.
To replace a freshly issued card, set cancelPrevious: true. This is rejected for blank cards, cards already used (422 CANNOT_CANCEL_USED_CARD), or cards already billed (422 CARD_ALREADY_BILLED). An unfinished card without cancellation returns 422 CARD_NOT_FINISHED. See card lifecycle.
For coupon templates, isAmountSpecified: true uses the fixed template amount. When false, supply a positive amount in cents. Supplying a nonpositive amount returns 400.
customer is optional. When supplied, it must use the nested customer format and satisfy the account’s mandatory fields. testCard defaults to false. Test issuance is subject to test-window and count limits. Activation can generate a billing event.
Example request
curl -X POST "https://tapcoupon.at/api/v1/cards/apply" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Device-ID: YOUR_DEVICE_ID" \
-H "X-Employee-Token: YOUR_EMPLOYEE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cardId": "9866191586296",
"templateId": "693869428d49e641ba110e17",
"customer": {
"email": "bob@example.com",
"contact": {
"fullName": "Bob Example",
"phone": "+43123456789"
},
"address": {
"line1": "Bakers Street 41",
"city": "Vienna",
"postalCode": "1010",
"countryCode": "AT"
},
"birthdate": "1990-06-15T00:00:00Z",
"privacyConsentGiven": true
}
}'
Example response
{
"success": true,
"message": "Template applied to card successfully"
}
Authorizations
Location API key. Also requires X-Device-ID.
Employee session token from /employee/login.
Headers
Stable device identifier. API key binds to this value on first use.
Body
application/json
MongoDB object id.
Pattern:
^[a-fA-F0-9]{24}$Positive coupon amount in cents. Required for variable-value coupon templates.
Required range:
x >= 1Request a test card, subject to the account test period and card limit.
Show child attributes
Show child attributes
