Create digital card
curl --request POST \
--url https://tapcoupon.at/api/v1/cards/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Device-ID: <x-device-id>' \
--header 'X-Employee-Token: <api-key>' \
--data '
{
"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/create"
payload = {
"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({
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/create', 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/create",
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([
'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/create"
payload := strings.NewReader("{\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/create")
.header("X-Device-ID", "<x-device-id>")
.header("Authorization", "Bearer <token>")
.header("X-Employee-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\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/create")
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 \"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{
"cardId": "2945823033425",
"cardType": "couponCard",
"activated": true,
"amount": 5000,
"amountLeft": 5000,
"customerEmail": "bob@example.com",
"testCard": false
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}Cards
Create digital card
Issue a card from a template and email its QR code to the customer.
POST
/
cards
/
create
Create digital card
curl --request POST \
--url https://tapcoupon.at/api/v1/cards/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Device-ID: <x-device-id>' \
--header 'X-Employee-Token: <api-key>' \
--data '
{
"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/create"
payload = {
"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({
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/create', 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/create",
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([
'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/create"
payload := strings.NewReader("{\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/create")
.header("X-Device-ID", "<x-device-id>")
.header("Authorization", "Bearer <token>")
.header("X-Employee-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\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/create")
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 \"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{
"cardId": "2945823033425",
"cardType": "couponCard",
"activated": true,
"amount": 5000,
"amountLeft": 5000,
"customerEmail": "bob@example.com",
"testCard": false
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}{
"error": "<string>",
"errorCode": "<string>"
}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
curl -X POST "https://tapcoupon.at/api/v1/cards/create" \
-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 '{
"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 fields
{
"cardId": "2945823033425",
"cardType": "couponCard",
"activated": true,
"amount": 5000,
"amountLeft": 5000,
"customerEmail": "bob@example.com",
"testCard": false
}
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}$Show child attributes
Show child attributes
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.
Response
Success
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Available options:
blankCard MongoDB object id.
Pattern:
^[a-fA-F0-9]{24}$Reusable printed or digital card identifier.
Lifetime in hours, measured from createdAt; 0 means unlimited.
Required range:
x >= 0Original coupon value in cents, or template amount for other types.
Show child attributes
Show child attributes
MongoDB object id.
Pattern:
^[a-fA-F0-9]{24}$When true, use is restricted to the issuing location.
MongoDB object id.
Pattern:
^[a-fA-F0-9]{24}$Show child attributes
Show child attributes
