Creates a payment. This is where most implementations start.
curl --request POST \
--url https://api.example.com/payments \
--header 'Content-Type: application/json' \
--header 'x-digest-key: <api-key>' \
--header 'x-digest-signature: <x-digest-signature>' \
--header 'x-digest-timestamp: <x-digest-timestamp>' \
--data '
{
"amount": {
"currency": "USD",
"value": 1000
},
"description": "Payment for order 12345",
"redirectUrl": "https://example.com/redirect",
"name": "Example Store",
"cancelUrl": "https://example.com/cancel",
"webhookUrl": "https://example.com/webhook",
"locale": "en",
"metadata": {
"orderId": 12345
},
"partnerId": "4cfad08e-1b41-4283-b4cc-f916cd4beba0",
"escrowPayee": "GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"escrowPlatformFee": 500,
"expiresInHours": 168,
"storeId": "store_8821",
"escrowExpiresAt": "2026-12-31T23:59:59Z"
}
'import requests
url = "https://api.example.com/payments"
payload = {
"amount": {
"currency": "USD",
"value": 1000
},
"description": "Payment for order 12345",
"redirectUrl": "https://example.com/redirect",
"name": "Example Store",
"cancelUrl": "https://example.com/cancel",
"webhookUrl": "https://example.com/webhook",
"locale": "en",
"metadata": { "orderId": 12345 },
"partnerId": "4cfad08e-1b41-4283-b4cc-f916cd4beba0",
"escrowPayee": "GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"escrowPlatformFee": 500,
"expiresInHours": 168,
"storeId": "store_8821",
"escrowExpiresAt": "2026-12-31T23:59:59Z"
}
headers = {
"x-digest-timestamp": "<x-digest-timestamp>",
"x-digest-key": "<api-key>",
"x-digest-signature": "<x-digest-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-digest-timestamp': '<x-digest-timestamp>',
'x-digest-key': '<api-key>',
'x-digest-signature': '<x-digest-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: {currency: 'USD', value: 1000},
description: 'Payment for order 12345',
redirectUrl: 'https://example.com/redirect',
name: 'Example Store',
cancelUrl: 'https://example.com/cancel',
webhookUrl: 'https://example.com/webhook',
locale: 'en',
metadata: {orderId: 12345},
partnerId: '4cfad08e-1b41-4283-b4cc-f916cd4beba0',
escrowPayee: 'GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
escrowPlatformFee: 500,
expiresInHours: 168,
storeId: 'store_8821',
escrowExpiresAt: '2026-12-31T23:59:59Z'
})
};
fetch('https://api.example.com/payments', 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.example.com/payments",
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([
'amount' => [
'currency' => 'USD',
'value' => 1000
],
'description' => 'Payment for order 12345',
'redirectUrl' => 'https://example.com/redirect',
'name' => 'Example Store',
'cancelUrl' => 'https://example.com/cancel',
'webhookUrl' => 'https://example.com/webhook',
'locale' => 'en',
'metadata' => [
'orderId' => 12345
],
'partnerId' => '4cfad08e-1b41-4283-b4cc-f916cd4beba0',
'escrowPayee' => 'GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'escrowPlatformFee' => 500,
'expiresInHours' => 168,
'storeId' => 'store_8821',
'escrowExpiresAt' => '2026-12-31T23:59:59Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-digest-key: <api-key>",
"x-digest-signature: <x-digest-signature>",
"x-digest-timestamp: <x-digest-timestamp>"
],
]);
$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.example.com/payments"
payload := strings.NewReader("{\n \"amount\": {\n \"currency\": \"USD\",\n \"value\": 1000\n },\n \"description\": \"Payment for order 12345\",\n \"redirectUrl\": \"https://example.com/redirect\",\n \"name\": \"Example Store\",\n \"cancelUrl\": \"https://example.com/cancel\",\n \"webhookUrl\": \"https://example.com/webhook\",\n \"locale\": \"en\",\n \"metadata\": {\n \"orderId\": 12345\n },\n \"partnerId\": \"4cfad08e-1b41-4283-b4cc-f916cd4beba0\",\n \"escrowPayee\": \"GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n \"escrowPlatformFee\": 500,\n \"expiresInHours\": 168,\n \"storeId\": \"store_8821\",\n \"escrowExpiresAt\": \"2026-12-31T23:59:59Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-digest-timestamp", "<x-digest-timestamp>")
req.Header.Add("x-digest-key", "<api-key>")
req.Header.Add("x-digest-signature", "<x-digest-signature>")
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.example.com/payments")
.header("x-digest-timestamp", "<x-digest-timestamp>")
.header("x-digest-key", "<api-key>")
.header("x-digest-signature", "<x-digest-signature>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": {\n \"currency\": \"USD\",\n \"value\": 1000\n },\n \"description\": \"Payment for order 12345\",\n \"redirectUrl\": \"https://example.com/redirect\",\n \"name\": \"Example Store\",\n \"cancelUrl\": \"https://example.com/cancel\",\n \"webhookUrl\": \"https://example.com/webhook\",\n \"locale\": \"en\",\n \"metadata\": {\n \"orderId\": 12345\n },\n \"partnerId\": \"4cfad08e-1b41-4283-b4cc-f916cd4beba0\",\n \"escrowPayee\": \"GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n \"escrowPlatformFee\": 500,\n \"expiresInHours\": 168,\n \"storeId\": \"store_8821\",\n \"escrowExpiresAt\": \"2026-12-31T23:59:59Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-digest-timestamp"] = '<x-digest-timestamp>'
request["x-digest-key"] = '<api-key>'
request["x-digest-signature"] = '<x-digest-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": {\n \"currency\": \"USD\",\n \"value\": 1000\n },\n \"description\": \"Payment for order 12345\",\n \"redirectUrl\": \"https://example.com/redirect\",\n \"name\": \"Example Store\",\n \"cancelUrl\": \"https://example.com/cancel\",\n \"webhookUrl\": \"https://example.com/webhook\",\n \"locale\": \"en\",\n \"metadata\": {\n \"orderId\": 12345\n },\n \"partnerId\": \"4cfad08e-1b41-4283-b4cc-f916cd4beba0\",\n \"escrowPayee\": \"GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n \"escrowPlatformFee\": 500,\n \"expiresInHours\": 168,\n \"storeId\": \"store_8821\",\n \"escrowExpiresAt\": \"2026-12-31T23:59:59Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "pt_AEtKAcN9d-",
"createdAt": "2023-11-18T20:46:15.652Z",
"updatedAt": "2023-11-18T20:46:15.652Z",
"expiresAt": "2023-11-18T21:16:15.649Z",
"mode": "test",
"amount": {
"value": 200,
"currency": "USD"
},
"description": "Buying phone",
"status": "open",
"settlement_status": "open",
"redirectUrl": "https://example.com",
"checkout_id": "pt_AEtKAcN9d-",
"webhookUrl": "https://example.com/webhook",
"hostedUrl": "https://sandbox-pay.ebioro.com/payments?paymentId=pt_QKTDINJ662&auth_token=<token>&lang=es",
"shortUrl": "https://sandbox-pay.ebioro.com/iqtRR_42J4TAIFbciUUlV",
"qrCode": "web+stellar:pay?destination=GAPU7KB2B2USVSWBFJRHGX7AYIWYKF2W44WWDCYEJTEER5D2QYEGD5GM&amount=2.68&asset_code=USDC&asset_issuer=GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5&memo=pt_AEtKAcN9d-&memo_type=text&msg=Buying+phone",
"merchantName": "Test Store",
"cancelUrl": "https://example.com/cancel",
"locale": "es",
"metadata": {},
"stellarTxId": "1b680e9577572a0c3e648dcc1686373c87417d9ec17614d0ed5bf0ca397f8fcd",
"settlement_stellarTxId": "1b680e9577572a0c3e648dcc1686373c87417d9ec17614d0ed5bf0ca397f8fcd",
"settlement_currency": "USDC",
"settlement_amount": 2663,
"settlement_fee": 66.575,
"amount_paid": 0,
"history": [
{
"time": 1714124827333,
"status": "success",
"description": "Payment created"
}
],
"sender_account": "GDFJ7PTIJGDINCLD7ZWZMYURELPMP6JZ6NMJBDBHKDXBFFWBC4SUFA4F",
"asset_id": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
"refunded": false,
"type": "order",
"partner_id": "4f56c1ff-837c-4a1c-b372-1ddf840f252c"
}{
"reason": "Bad Request",
"statusCode": 400
}{
"reason": "Unauthorized",
"statusCode": 401
}{
"reason": "A request with this Idempotency-Key is already being processed",
"statusCode": 409
}{
"reason": "Idempotency-Key reused for a different request",
"statusCode": 422
}{
"reason": "Internal Server Error",
"statusCode": 500
}Payments
Create Payment
Allows to create a payment order
POST
/
payments
Creates a payment. This is where most implementations start.
curl --request POST \
--url https://api.example.com/payments \
--header 'Content-Type: application/json' \
--header 'x-digest-key: <api-key>' \
--header 'x-digest-signature: <x-digest-signature>' \
--header 'x-digest-timestamp: <x-digest-timestamp>' \
--data '
{
"amount": {
"currency": "USD",
"value": 1000
},
"description": "Payment for order 12345",
"redirectUrl": "https://example.com/redirect",
"name": "Example Store",
"cancelUrl": "https://example.com/cancel",
"webhookUrl": "https://example.com/webhook",
"locale": "en",
"metadata": {
"orderId": 12345
},
"partnerId": "4cfad08e-1b41-4283-b4cc-f916cd4beba0",
"escrowPayee": "GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"escrowPlatformFee": 500,
"expiresInHours": 168,
"storeId": "store_8821",
"escrowExpiresAt": "2026-12-31T23:59:59Z"
}
'import requests
url = "https://api.example.com/payments"
payload = {
"amount": {
"currency": "USD",
"value": 1000
},
"description": "Payment for order 12345",
"redirectUrl": "https://example.com/redirect",
"name": "Example Store",
"cancelUrl": "https://example.com/cancel",
"webhookUrl": "https://example.com/webhook",
"locale": "en",
"metadata": { "orderId": 12345 },
"partnerId": "4cfad08e-1b41-4283-b4cc-f916cd4beba0",
"escrowPayee": "GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"escrowPlatformFee": 500,
"expiresInHours": 168,
"storeId": "store_8821",
"escrowExpiresAt": "2026-12-31T23:59:59Z"
}
headers = {
"x-digest-timestamp": "<x-digest-timestamp>",
"x-digest-key": "<api-key>",
"x-digest-signature": "<x-digest-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-digest-timestamp': '<x-digest-timestamp>',
'x-digest-key': '<api-key>',
'x-digest-signature': '<x-digest-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: {currency: 'USD', value: 1000},
description: 'Payment for order 12345',
redirectUrl: 'https://example.com/redirect',
name: 'Example Store',
cancelUrl: 'https://example.com/cancel',
webhookUrl: 'https://example.com/webhook',
locale: 'en',
metadata: {orderId: 12345},
partnerId: '4cfad08e-1b41-4283-b4cc-f916cd4beba0',
escrowPayee: 'GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
escrowPlatformFee: 500,
expiresInHours: 168,
storeId: 'store_8821',
escrowExpiresAt: '2026-12-31T23:59:59Z'
})
};
fetch('https://api.example.com/payments', 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.example.com/payments",
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([
'amount' => [
'currency' => 'USD',
'value' => 1000
],
'description' => 'Payment for order 12345',
'redirectUrl' => 'https://example.com/redirect',
'name' => 'Example Store',
'cancelUrl' => 'https://example.com/cancel',
'webhookUrl' => 'https://example.com/webhook',
'locale' => 'en',
'metadata' => [
'orderId' => 12345
],
'partnerId' => '4cfad08e-1b41-4283-b4cc-f916cd4beba0',
'escrowPayee' => 'GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'escrowPlatformFee' => 500,
'expiresInHours' => 168,
'storeId' => 'store_8821',
'escrowExpiresAt' => '2026-12-31T23:59:59Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-digest-key: <api-key>",
"x-digest-signature: <x-digest-signature>",
"x-digest-timestamp: <x-digest-timestamp>"
],
]);
$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.example.com/payments"
payload := strings.NewReader("{\n \"amount\": {\n \"currency\": \"USD\",\n \"value\": 1000\n },\n \"description\": \"Payment for order 12345\",\n \"redirectUrl\": \"https://example.com/redirect\",\n \"name\": \"Example Store\",\n \"cancelUrl\": \"https://example.com/cancel\",\n \"webhookUrl\": \"https://example.com/webhook\",\n \"locale\": \"en\",\n \"metadata\": {\n \"orderId\": 12345\n },\n \"partnerId\": \"4cfad08e-1b41-4283-b4cc-f916cd4beba0\",\n \"escrowPayee\": \"GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n \"escrowPlatformFee\": 500,\n \"expiresInHours\": 168,\n \"storeId\": \"store_8821\",\n \"escrowExpiresAt\": \"2026-12-31T23:59:59Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-digest-timestamp", "<x-digest-timestamp>")
req.Header.Add("x-digest-key", "<api-key>")
req.Header.Add("x-digest-signature", "<x-digest-signature>")
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.example.com/payments")
.header("x-digest-timestamp", "<x-digest-timestamp>")
.header("x-digest-key", "<api-key>")
.header("x-digest-signature", "<x-digest-signature>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": {\n \"currency\": \"USD\",\n \"value\": 1000\n },\n \"description\": \"Payment for order 12345\",\n \"redirectUrl\": \"https://example.com/redirect\",\n \"name\": \"Example Store\",\n \"cancelUrl\": \"https://example.com/cancel\",\n \"webhookUrl\": \"https://example.com/webhook\",\n \"locale\": \"en\",\n \"metadata\": {\n \"orderId\": 12345\n },\n \"partnerId\": \"4cfad08e-1b41-4283-b4cc-f916cd4beba0\",\n \"escrowPayee\": \"GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n \"escrowPlatformFee\": 500,\n \"expiresInHours\": 168,\n \"storeId\": \"store_8821\",\n \"escrowExpiresAt\": \"2026-12-31T23:59:59Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-digest-timestamp"] = '<x-digest-timestamp>'
request["x-digest-key"] = '<api-key>'
request["x-digest-signature"] = '<x-digest-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": {\n \"currency\": \"USD\",\n \"value\": 1000\n },\n \"description\": \"Payment for order 12345\",\n \"redirectUrl\": \"https://example.com/redirect\",\n \"name\": \"Example Store\",\n \"cancelUrl\": \"https://example.com/cancel\",\n \"webhookUrl\": \"https://example.com/webhook\",\n \"locale\": \"en\",\n \"metadata\": {\n \"orderId\": 12345\n },\n \"partnerId\": \"4cfad08e-1b41-4283-b4cc-f916cd4beba0\",\n \"escrowPayee\": \"GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n \"escrowPlatformFee\": 500,\n \"expiresInHours\": 168,\n \"storeId\": \"store_8821\",\n \"escrowExpiresAt\": \"2026-12-31T23:59:59Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "pt_AEtKAcN9d-",
"createdAt": "2023-11-18T20:46:15.652Z",
"updatedAt": "2023-11-18T20:46:15.652Z",
"expiresAt": "2023-11-18T21:16:15.649Z",
"mode": "test",
"amount": {
"value": 200,
"currency": "USD"
},
"description": "Buying phone",
"status": "open",
"settlement_status": "open",
"redirectUrl": "https://example.com",
"checkout_id": "pt_AEtKAcN9d-",
"webhookUrl": "https://example.com/webhook",
"hostedUrl": "https://sandbox-pay.ebioro.com/payments?paymentId=pt_QKTDINJ662&auth_token=<token>&lang=es",
"shortUrl": "https://sandbox-pay.ebioro.com/iqtRR_42J4TAIFbciUUlV",
"qrCode": "web+stellar:pay?destination=GAPU7KB2B2USVSWBFJRHGX7AYIWYKF2W44WWDCYEJTEER5D2QYEGD5GM&amount=2.68&asset_code=USDC&asset_issuer=GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5&memo=pt_AEtKAcN9d-&memo_type=text&msg=Buying+phone",
"merchantName": "Test Store",
"cancelUrl": "https://example.com/cancel",
"locale": "es",
"metadata": {},
"stellarTxId": "1b680e9577572a0c3e648dcc1686373c87417d9ec17614d0ed5bf0ca397f8fcd",
"settlement_stellarTxId": "1b680e9577572a0c3e648dcc1686373c87417d9ec17614d0ed5bf0ca397f8fcd",
"settlement_currency": "USDC",
"settlement_amount": 2663,
"settlement_fee": 66.575,
"amount_paid": 0,
"history": [
{
"time": 1714124827333,
"status": "success",
"description": "Payment created"
}
],
"sender_account": "GDFJ7PTIJGDINCLD7ZWZMYURELPMP6JZ6NMJBDBHKDXBFFWBC4SUFA4F",
"asset_id": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
"refunded": false,
"type": "order",
"partner_id": "4f56c1ff-837c-4a1c-b372-1ddf840f252c"
}{
"reason": "Bad Request",
"statusCode": 400
}{
"reason": "Unauthorized",
"statusCode": 401
}{
"reason": "A request with this Idempotency-Key is already being processed",
"statusCode": 409
}{
"reason": "Idempotency-Key reused for a different request",
"statusCode": 422
}{
"reason": "Internal Server Error",
"statusCode": 500
}Headers
Body
application/json
Stellar address of the fund recipient for escrow payments. Use this when the payee is a different party from the merchant — i.e., the driver in a ride-hailing app (Uber), the host in a rental platform (Airbnb), or the freelancer in a services marketplace (Upwork). If omitted, defaults to the merchant's Stellar account (common for remittances and POS use cases). Only applicable for merchants with settlement_mode = escrow.
Example:
"GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Response
On success the endpoint will return a JSON object with detailed payment information.