# TapSenior Partner API Guide (Create / Resend Card)
Version: 1.0
Last updated: 2026-01-19
Owner: TapSenior Team
1) Purpose
Partners can automatically **create a TapSenior Card** (or **re-send** an existing card) for their customers using the TapSenior API.
How it works:
– If the customer email does **not** have a card yet → TapSenior creates a new card, generates the PNG, and emails it to the customer.
– If the customer email **already** has a card → TapSenior automatically re-sends the email (and regenerates the PNG if the file is missing).
2) Endpoint
**Method:** POST
**URL:**
`https://tapsenior.com/wp-json/tapsenior/v1/create-card`
**Content-Type:** `application/json`
3) Authentication (Required)
Each partner receives a unique **Partner API Key** from TapSenior.
Send it in this header:
`X-TapSenior-Key: ts_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXX`
Important:
– Your API Key is confidential. Do not share it publicly.
– If you suspect the key is exposed, contact TapSenior to disable it and issue a new one.
4) Request Body (JSON)
### Required fields
– `full_name` (string) — Customer full name
– `email` (string) — Customer email (used to create/find the card)
### Optional fields
– `phone` (string)
– `birth_year` (string)
– `address` (string)
**Example JSON**
“`json
{
“full_name”: “John Anderson”,
“email”: “john@email.com”,
“phone”: “780-000-0000”,
“birth_year”: “1958”,
“address”: “2119 Laurier Cres, Regina”
}
5) Success Response
HTTP 200
json
Copy code
{
“success”: true,
“message”: “Done! Your TapSenior Card has been emailed to you.”,
“card_id”: “TS-12345”,
“verify_url”: “https://tapsenior.com/verify-card/?card=TS-12345”,
“image_url”: “https://tapsenior.com/wp-content/uploads/tapsenior-cards/TS-12345.png”,
“partner”: {
“id”: 3,
“label”: “Partner ABC”
}
}
Field meaning:
card_id: The customer’s TapSenior Card ID
verify_url: A quick verification link for staff/partners
image_url: The public PNG link (the customer also receives it as an email attachment)
6) API Call Examples
6.1) cURL (Linux / macOS / Windows Git Bash)
bash
Copy code
curl -X POST “https://tapsenior.com/wp-json/tapsenior/v1/create-card” \
-H “Content-Type: application/json” \
-H “X-TapSenior-Key: ts_live_YOUR_PARTNER_KEY” \
-d ‘{“full_name”:”John Anderson”,”email”:”john@email.com”,”phone”:”780-000-0000″}’
6.2) JavaScript (fetch)
js
Copy code
fetch(“https://tapsenior.com/wp-json/tapsenior/v1/create-card”, {
method: “POST”,
headers: {
“Content-Type”: “application/json”,
“X-TapSenior-Key”: “ts_live_YOUR_PARTNER_KEY”
},
body: JSON.stringify({
full_name: “John Anderson”,
email: “john@email.com”,
phone: “780-000-0000”
})
})
.then(r => r.json())
.then(data => console.log(“TapSenior API:”, data))
.catch(err => console.error(“Error:”, err));
6.3) PHP (WordPress / Server-side)
php
Copy code
$endpoint = ‘https://tapsenior.com/wp-json/tapsenior/v1/create-card’;
$payload = [
‘full_name’ => ‘John Anderson’,
’email’ => ‘john@email.com’,
‘phone’ => ‘780-000-0000’,
];
$response = wp_remote_post($endpoint, [
‘timeout’ => 20,
‘headers’ => [
‘Content-Type’ => ‘application/json’,
‘X-TapSenior-Key’ => ‘ts_live_YOUR_PARTNER_KEY’,
],
‘body’ => wp_json_encode($payload),
]);
$code = wp_remote_retrieve_response_code($response);
$body = wp_remote_retrieve_body($response);
echo “HTTP: $code\n”;
echo $body;
7) Common Errors & Troubleshooting
7.1) Unauthorized
HTTP 401
json
Copy code
{“success”:false,”message”:”Unauthorized”}
Causes:
Missing X-TapSenior-Key header
Invalid/disabled API Key
Fix:
Check your headers
Contact TapSenior if you need a new key
7.2) Invalid name/email
HTTP 400
json
Copy code
{“success”:false,”message”:”Invalid name/email”}
Causes:
Missing full_name or email
Invalid email format
Fix:
Ensure full_name and a valid email are provided
7.3) Rate limit exceeded
HTTP 429
json
Copy code
{“success”:false,”message”:”Rate limit exceeded”}
Cause:
Too many requests per minute for your key (limit depends on your plan)
Fix:
Wait 30–60 seconds and retry
Reduce request frequency (queue/batch calls)
7.4) Server error / Template issues
HTTP 500 (or an error message about template/image generation)
Possible causes:
Temporary server issue
Card template not configured or not reachable
Fix:
Retry after a few minutes
Contact TapSenior if it continues
8) Best Practices (Recommended)
Only call the API after validating the customer’s email.
To re-send a card, simply call the endpoint again with the same email (the API automatically re-sends).
Do not store API keys in front-end JavaScript. Call the API from your server instead.
Log responses on your side (email + timestamp + response JSON) to help support if needed.
9) Support
If you need technical support, contact TapSenior Support and include:
Customer email
Time of your API call
The response JSON you received (if available)
