Issue Card
curl --request POST \
--url https://api.yativo.com/api/v1/corporate-card/employees/cards \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Api-Secret: <api-key>' \
--data '
{
"customer_id": "cus_123",
"employee_id": "emp_456",
"card_type": "Virtual"
}
'import requests
url = "https://api.yativo.com/api/v1/corporate-card/employees/cards"
payload = {
"customer_id": "cus_123",
"employee_id": "emp_456",
"card_type": "Virtual"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Api-Key": "<api-key>",
"X-Api-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Api-Key': '<api-key>',
'X-Api-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({customer_id: 'cus_123', employee_id: 'emp_456', card_type: 'Virtual'})
};
fetch('https://api.yativo.com/api/v1/corporate-card/employees/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.yativo.com/api/v1/corporate-card/employees/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_id' => 'cus_123',
'employee_id' => 'emp_456',
'card_type' => 'Virtual'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Api-Key: <api-key>",
"X-Api-Secret: <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://api.yativo.com/api/v1/corporate-card/employees/cards"
payload := strings.NewReader("{\n \"customer_id\": \"cus_123\",\n \"employee_id\": \"emp_456\",\n \"card_type\": \"Virtual\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("X-Api-Secret", "<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://api.yativo.com/api/v1/corporate-card/employees/cards")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Api-Key", "<api-key>")
.header("X-Api-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"cus_123\",\n \"employee_id\": \"emp_456\",\n \"card_type\": \"Virtual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yativo.com/api/v1/corporate-card/employees/cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Api-Key"] = '<api-key>'
request["X-Api-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"cus_123\",\n \"employee_id\": \"emp_456\",\n \"card_type\": \"Virtual\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"status_code": 200,
"message": "Request successful",
"data": {
"card": {
"card_id": "9b1f6a52-3c1e-4d0b-a8c4-2f6f0d1e7a11",
"customer_id": "cus_123",
"issuance_type": "Virtual",
"status": "ACTIVE",
"masked_pan": "**** **** **** 4242",
"expiration_date": "2029-10",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}Corporate Cards
Issue Card
Issue a virtual or physical card to an employee
POST
/
corporate-card
/
employees
/
cards
Issue Card
curl --request POST \
--url https://api.yativo.com/api/v1/corporate-card/employees/cards \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Api-Secret: <api-key>' \
--data '
{
"customer_id": "cus_123",
"employee_id": "emp_456",
"card_type": "Virtual"
}
'import requests
url = "https://api.yativo.com/api/v1/corporate-card/employees/cards"
payload = {
"customer_id": "cus_123",
"employee_id": "emp_456",
"card_type": "Virtual"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Api-Key": "<api-key>",
"X-Api-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Api-Key': '<api-key>',
'X-Api-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({customer_id: 'cus_123', employee_id: 'emp_456', card_type: 'Virtual'})
};
fetch('https://api.yativo.com/api/v1/corporate-card/employees/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.yativo.com/api/v1/corporate-card/employees/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_id' => 'cus_123',
'employee_id' => 'emp_456',
'card_type' => 'Virtual'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Api-Key: <api-key>",
"X-Api-Secret: <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://api.yativo.com/api/v1/corporate-card/employees/cards"
payload := strings.NewReader("{\n \"customer_id\": \"cus_123\",\n \"employee_id\": \"emp_456\",\n \"card_type\": \"Virtual\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("X-Api-Secret", "<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://api.yativo.com/api/v1/corporate-card/employees/cards")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Api-Key", "<api-key>")
.header("X-Api-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"cus_123\",\n \"employee_id\": \"emp_456\",\n \"card_type\": \"Virtual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yativo.com/api/v1/corporate-card/employees/cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Api-Key"] = '<api-key>'
request["X-Api-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"cus_123\",\n \"employee_id\": \"emp_456\",\n \"card_type\": \"Virtual\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"status_code": 200,
"message": "Request successful",
"data": {
"card": {
"card_id": "9b1f6a52-3c1e-4d0b-a8c4-2f6f0d1e7a11",
"customer_id": "cus_123",
"issuance_type": "Virtual",
"status": "ACTIVE",
"masked_pan": "**** **** **** 4242",
"expiration_date": "2029-10",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}Authorizations
Your API key (yativo_pk_...) from Developers → API Keys. Send together with X-Api-Secret.
Your API secret (yativo_sk_...), shown once when the key is created.
Headers
A unique string per request to ensure idempotent processing.
Body
application/json

