curl --request POST \
--url https://api.kemycard.com/v1/payouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quote_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "order-1001"
}
'import requests
url = "https://api.kemycard.com/v1/payouts"
payload = {
"quote_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "order-1001"
}
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({quote_code: '3c90c3cc-0d44-4b50-8888-8dd25736052a', reference: 'order-1001'})
};
fetch('https://api.kemycard.com/v1/payouts', 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/payouts",
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([
'quote_code' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'reference' => 'order-1001'
]),
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/payouts"
payload := strings.NewReader("{\n \"quote_code\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reference\": \"order-1001\"\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/payouts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"quote_code\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reference\": \"order-1001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kemycard.com/v1/payouts")
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 \"quote_code\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reference\": \"order-1001\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "order-1001",
"rail": "sepa",
"status": "pending",
"customer_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"beneficiary": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "JANE DOE",
"iban_masked": "DE89 **** 3000",
"account_number_masked": "**** 9012",
"routing_number": "021000021",
"bank_name": "Test Bank",
"country": "DE"
},
"amount_usd": 100,
"fee_usd": 7,
"total_debited_usd": 107,
"received_amount": 86,
"received_currency": "EUR",
"amount_eur": 86,
"exchange_rate": 0.86,
"balance_type": "payout_sepa",
"failure_reason": null,
"created_at": "2023-11-07T05:31:56Z",
"confirmed_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"refunded_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": true,
"data": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "order-1001",
"rail": "sepa",
"status": "pending",
"customer_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"beneficiary": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "JANE DOE",
"iban_masked": "DE89 **** 3000",
"account_number_masked": "**** 9012",
"routing_number": "021000021",
"bank_name": "Test Bank",
"country": "DE"
},
"amount_usd": 100,
"fee_usd": 7,
"total_debited_usd": 107,
"received_amount": 86,
"received_currency": "EUR",
"amount_eur": 86,
"exchange_rate": 0.86,
"balance_type": "payout_sepa",
"failure_reason": null,
"created_at": "2023-11-07T05:31:56Z",
"confirmed_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"refunded_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required fields.",
"details": {}
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required fields.",
"details": {}
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found.",
"details": null
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "This reference is already used by another payout.",
"details": {
"reference": "order-1001",
"payout_code": "0199e3a1-7c2b-7d40-9a51-3f6e2b8c4d10"
}
}
}Send a Payout
Confirms an open quote: the total of the quote (total_debited_usd) is debited from the balance of the rail
(payout_sepa for SEPA, others for ACH) and the payout is created with status pending (HTTP 202). It is then sent to the bank asynchronously:
follow it with the payout.* webhooks or GET /payouts/{code}. The code of the payout is the quote_code.
reference is required and unique per partner account: 1 to 100 characters among letters, digits and
- _ . : / (for example your order ID). Sending the same quote_code with the same reference again returns
the payout already created with HTTP 200, and nothing is debited twice. A reference already used by
another payout returns 422 VALIDATION_ERROR.
If the quote has expired when the payout is sent to the bank, KemyCard requests a new quote automatically. If the amount received would be more than 1% lower than the accepted quote, the payout fails and is refunded.
curl --request POST \
--url https://api.kemycard.com/v1/payouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quote_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "order-1001"
}
'import requests
url = "https://api.kemycard.com/v1/payouts"
payload = {
"quote_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "order-1001"
}
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({quote_code: '3c90c3cc-0d44-4b50-8888-8dd25736052a', reference: 'order-1001'})
};
fetch('https://api.kemycard.com/v1/payouts', 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/payouts",
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([
'quote_code' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'reference' => 'order-1001'
]),
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/payouts"
payload := strings.NewReader("{\n \"quote_code\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reference\": \"order-1001\"\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/payouts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"quote_code\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reference\": \"order-1001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kemycard.com/v1/payouts")
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 \"quote_code\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reference\": \"order-1001\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "order-1001",
"rail": "sepa",
"status": "pending",
"customer_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"beneficiary": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "JANE DOE",
"iban_masked": "DE89 **** 3000",
"account_number_masked": "**** 9012",
"routing_number": "021000021",
"bank_name": "Test Bank",
"country": "DE"
},
"amount_usd": 100,
"fee_usd": 7,
"total_debited_usd": 107,
"received_amount": 86,
"received_currency": "EUR",
"amount_eur": 86,
"exchange_rate": 0.86,
"balance_type": "payout_sepa",
"failure_reason": null,
"created_at": "2023-11-07T05:31:56Z",
"confirmed_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"refunded_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": true,
"data": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "order-1001",
"rail": "sepa",
"status": "pending",
"customer_code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"beneficiary": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "JANE DOE",
"iban_masked": "DE89 **** 3000",
"account_number_masked": "**** 9012",
"routing_number": "021000021",
"bank_name": "Test Bank",
"country": "DE"
},
"amount_usd": 100,
"fee_usd": 7,
"total_debited_usd": 107,
"received_amount": 86,
"received_currency": "EUR",
"amount_eur": 86,
"exchange_rate": 0.86,
"balance_type": "payout_sepa",
"failure_reason": null,
"created_at": "2023-11-07T05:31:56Z",
"confirmed_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"refunded_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required fields.",
"details": {}
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required fields.",
"details": {}
},
"meta": {
"request_id": "a4f8e2c1b3d97056",
"mode": "test",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found.",
"details": null
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "This reference is already used by another payout.",
"details": {
"reference": "order-1001",
"payout_code": "0199e3a1-7c2b-7d40-9a51-3f6e2b8c4d10"
}
}
}Authorizations
API key (sk_test_... or sk_live_...)
Body
The quote_code of an open quote
Your own reference, unique per partner account (for example your order ID): 1 to 100 characters among
letters, digits and - _ . : /. It makes the call safe to retry.
1 - 100^[A-Za-z0-9_\-.:/]{1,100}$"order-1001"