curl --request POST \
--url https://api.kemycard.com/v1/cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_code": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"product_code": "019abc12-3456-7890-abcd-ef0123456789",
"name_on_card": "John Doe",
"amount": 100
}
'import requests
url = "https://api.kemycard.com/v1/cards"
payload = {
"customer_code": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"product_code": "019abc12-3456-7890-abcd-ef0123456789",
"name_on_card": "John Doe",
"amount": 100
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_code: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
product_code: '019abc12-3456-7890-abcd-ef0123456789',
name_on_card: 'John Doe',
amount: 100
})
};
fetch('https://api.kemycard.com/v1/cards', 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://api.kemycard.com/v1/cards",
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([
'customer_code' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'product_code' => '019abc12-3456-7890-abcd-ef0123456789',
'name_on_card' => 'John Doe',
'amount' => 100
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.kemycard.com/v1/cards"
payload := strings.NewReader("{\n \"customer_code\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"product_code\": \"019abc12-3456-7890-abcd-ef0123456789\",\n \"name_on_card\": \"John Doe\",\n \"amount\": 100\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.kemycard.com/v1/cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_code\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"product_code\": \"019abc12-3456-7890-abcd-ef0123456789\",\n \"name_on_card\": \"John Doe\",\n \"amount\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kemycard.com/v1/cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_code\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"product_code\": \"019abc12-3456-7890-abcd-ef0123456789\",\n \"name_on_card\": \"John Doe\",\n \"amount\": 100\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand": "MASTERCARD",
"category": "<string>",
"name_on_card": "John Doe",
"status": "pending",
"balance": 123,
"currency": "<string>",
"last_four": "<string>",
"expiry": "12/29",
"fees": {
"card_fee": 30,
"service_fee": 5,
"total_charged": 135
},
"created_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Insufficient ops balance.",
"details": {
"required": 50,
"available": 10,
"balance_type": "cards_mastercard"
}
}
}{
"success": false,
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found.",
"details": null
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required fields.",
"details": {}
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}Create a Card
Creates a card for a customer from a card product (see GET /cards/products).
Your ops balance (cards_visa or cards_mastercard, depending on the product brand) is debited of the
initial load plus the product fees: card_fee and the service fee on the load. The KYC tariff applies when
the customer’s KYC is approved.
The card is returned with status: pending and issued asynchronously. You are notified by webhook:
card.activated when the card is ready, or card.creation_failed if it could not be issued — in that case
the full amount is refunded to the same cards_visa or cards_mastercard balance.
The call is refused when the customer is not active, when its verification level is below the product’s
required_level, when it already holds the maximum number of cards for this product, or when the amount is
outside the product’s initial load range.
curl --request POST \
--url https://api.kemycard.com/v1/cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_code": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"product_code": "019abc12-3456-7890-abcd-ef0123456789",
"name_on_card": "John Doe",
"amount": 100
}
'import requests
url = "https://api.kemycard.com/v1/cards"
payload = {
"customer_code": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"product_code": "019abc12-3456-7890-abcd-ef0123456789",
"name_on_card": "John Doe",
"amount": 100
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_code: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
product_code: '019abc12-3456-7890-abcd-ef0123456789',
name_on_card: 'John Doe',
amount: 100
})
};
fetch('https://api.kemycard.com/v1/cards', 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://api.kemycard.com/v1/cards",
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([
'customer_code' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'product_code' => '019abc12-3456-7890-abcd-ef0123456789',
'name_on_card' => 'John Doe',
'amount' => 100
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.kemycard.com/v1/cards"
payload := strings.NewReader("{\n \"customer_code\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"product_code\": \"019abc12-3456-7890-abcd-ef0123456789\",\n \"name_on_card\": \"John Doe\",\n \"amount\": 100\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.kemycard.com/v1/cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_code\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"product_code\": \"019abc12-3456-7890-abcd-ef0123456789\",\n \"name_on_card\": \"John Doe\",\n \"amount\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kemycard.com/v1/cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_code\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"product_code\": \"019abc12-3456-7890-abcd-ef0123456789\",\n \"name_on_card\": \"John Doe\",\n \"amount\": 100\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand": "MASTERCARD",
"category": "<string>",
"name_on_card": "John Doe",
"status": "pending",
"balance": 123,
"currency": "<string>",
"last_four": "<string>",
"expiry": "12/29",
"fees": {
"card_fee": 30,
"service_fee": 5,
"total_charged": 135
},
"created_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Insufficient ops balance.",
"details": {
"required": 50,
"available": 10,
"balance_type": "cards_mastercard"
}
}
}{
"success": false,
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found.",
"details": null
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required fields.",
"details": {}
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
API key (sk_test_... or sk_live_...)
Body
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Code of the card product, from GET /cards/products
"019abc12-3456-7890-abcd-ef0123456789"
Label of the card, 3 to 20 characters
3 - 20"John Doe"
Initial load in USD. Required when the product has initial_load.required: true, within
initial_load.min and initial_load.max. Ignored otherwise.
100