Créer une session de checkout (widget embarqueable)
curl --request POST \
--url http://localhost/v1/checkout-sessions/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amountFiat": "<string>",
"description": "<string>",
"customer": {
"name": "<string>",
"email": "jsmith@example.com",
"msisdn": "<string>"
},
"webhookUrl": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"allowedOrigins": [
"<string>"
],
"expiresInSec": 302430,
"metadata": {}
}
'import requests
url = "http://localhost/v1/checkout-sessions/"
payload = {
"amountFiat": "<string>",
"description": "<string>",
"customer": {
"name": "<string>",
"email": "jsmith@example.com",
"msisdn": "<string>"
},
"webhookUrl": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"allowedOrigins": ["<string>"],
"expiresInSec": 302430,
"metadata": {}
}
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({
amountFiat: '<string>',
description: '<string>',
customer: {name: '<string>', email: 'jsmith@example.com', msisdn: '<string>'},
webhookUrl: '<string>',
successUrl: '<string>',
cancelUrl: '<string>',
allowedOrigins: ['<string>'],
expiresInSec: 302430,
metadata: {}
})
};
fetch('http://localhost/v1/checkout-sessions/', 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 => "http://localhost/v1/checkout-sessions/",
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([
'amountFiat' => '<string>',
'description' => '<string>',
'customer' => [
'name' => '<string>',
'email' => 'jsmith@example.com',
'msisdn' => '<string>'
],
'webhookUrl' => '<string>',
'successUrl' => '<string>',
'cancelUrl' => '<string>',
'allowedOrigins' => [
'<string>'
],
'expiresInSec' => 302430,
'metadata' => [
]
]),
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 := "http://localhost/v1/checkout-sessions/"
payload := strings.NewReader("{\n \"amountFiat\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"msisdn\": \"<string>\"\n },\n \"webhookUrl\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"expiresInSec\": 302430,\n \"metadata\": {}\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("http://localhost/v1/checkout-sessions/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountFiat\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"msisdn\": \"<string>\"\n },\n \"webhookUrl\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"expiresInSec\": 302430,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/v1/checkout-sessions/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountFiat\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"msisdn\": \"<string>\"\n },\n \"webhookUrl\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"expiresInSec\": 302430,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"id": "<string>",
"token": "<string>",
"status": "<string>",
"embedUrl": "<string>",
"amountFiat": "<string>",
"expiresAt": "<string>",
"webhookSecret": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}checkout-sessions
Créer une session de checkout (widget embarqueable)
POST
/
v1
/
checkout-sessions
/
Créer une session de checkout (widget embarqueable)
curl --request POST \
--url http://localhost/v1/checkout-sessions/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amountFiat": "<string>",
"description": "<string>",
"customer": {
"name": "<string>",
"email": "jsmith@example.com",
"msisdn": "<string>"
},
"webhookUrl": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"allowedOrigins": [
"<string>"
],
"expiresInSec": 302430,
"metadata": {}
}
'import requests
url = "http://localhost/v1/checkout-sessions/"
payload = {
"amountFiat": "<string>",
"description": "<string>",
"customer": {
"name": "<string>",
"email": "jsmith@example.com",
"msisdn": "<string>"
},
"webhookUrl": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"allowedOrigins": ["<string>"],
"expiresInSec": 302430,
"metadata": {}
}
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({
amountFiat: '<string>',
description: '<string>',
customer: {name: '<string>', email: 'jsmith@example.com', msisdn: '<string>'},
webhookUrl: '<string>',
successUrl: '<string>',
cancelUrl: '<string>',
allowedOrigins: ['<string>'],
expiresInSec: 302430,
metadata: {}
})
};
fetch('http://localhost/v1/checkout-sessions/', 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 => "http://localhost/v1/checkout-sessions/",
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([
'amountFiat' => '<string>',
'description' => '<string>',
'customer' => [
'name' => '<string>',
'email' => 'jsmith@example.com',
'msisdn' => '<string>'
],
'webhookUrl' => '<string>',
'successUrl' => '<string>',
'cancelUrl' => '<string>',
'allowedOrigins' => [
'<string>'
],
'expiresInSec' => 302430,
'metadata' => [
]
]),
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 := "http://localhost/v1/checkout-sessions/"
payload := strings.NewReader("{\n \"amountFiat\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"msisdn\": \"<string>\"\n },\n \"webhookUrl\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"expiresInSec\": 302430,\n \"metadata\": {}\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("http://localhost/v1/checkout-sessions/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountFiat\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"msisdn\": \"<string>\"\n },\n \"webhookUrl\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"expiresInSec\": 302430,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/v1/checkout-sessions/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountFiat\": \"<string>\",\n \"description\": \"<string>\",\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"msisdn\": \"<string>\"\n },\n \"webhookUrl\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"expiresInSec\": 302430,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"id": "<string>",
"token": "<string>",
"status": "<string>",
"embedUrl": "<string>",
"amountFiat": "<string>",
"expiresAt": "<string>",
"webhookSecret": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
bearerAuthcookieAuth
JWT utilisateur ou clé API kp_<env>_xxx
Body
application/json
Decimal amount with up to 8 fractional digits, e.g. "1500" or "1500.75"
Pattern:
^\d+(\.\d{1,8})?$Available options:
XOF, XAF, NGN, GHS, CDF, EUR, USD, USDC, USDT Maximum string length:
500Show child attributes
Show child attributes
Maximum array length:
10Required range:
60 <= x <= 604800Show child attributes
Show child attributes
⌘I
