Charge a Delegate
curl --request POST \
--url https://api.example.com/v1/payments/chargeimport requests
url = "https://api.example.com/v1/payments/charge"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/payments/charge', 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/v1/payments/charge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payments/charge"
req, _ := http.NewRequest("POST", url, nil)
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/v1/payments/charge")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payments/charge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"receiptId": "<string>",
"status": "<string>",
"amountCents": 123,
"railUsed": "<string>",
"txHash": "<string>",
"stripePaymentIntentId": "<string>"
}Payment API
Charge a Delegate
Executes a payment using a Intent Mandate token.
POST
/
v1
/
payments
/
charge
Charge a Delegate
curl --request POST \
--url https://api.example.com/v1/payments/chargeimport requests
url = "https://api.example.com/v1/payments/charge"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/payments/charge', 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/v1/payments/charge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payments/charge"
req, _ := http.NewRequest("POST", url, nil)
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/v1/payments/charge")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payments/charge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"receiptId": "<string>",
"status": "<string>",
"amountCents": 123,
"railUsed": "<string>",
"txHash": "<string>",
"stripePaymentIntentId": "<string>"
}Headers
| Name | Type | Required | Description |
|---|---|---|---|
X-Delegare-Merchant-Id | string | Yes | Your unique merchant identifier. |
X-Delegare-Api-Key | string | Yes | Your secret API key. |
Body Parameters
| Name | Type | Required | Description |
|---|---|---|---|
intentMandate | string | Yes | The user-authorized delegate token (dtok_...). |
amountCents | number | Yes | Amount in cents (positive integer). |
currency | string | Yes | usd, usdc, or usdt. |
description | string | Yes | Max 500 characters. Shown on user statement. |
idempotencyKey | string | Yes | Unique key to prevent duplicate charges. |
metadata | object | No | Key-value pairs for your own tracking. |
Response
string
Unique identifier for this transaction.
string
completed, pending, or failed.number
The final charged amount.
string
fiat (Stripe) or crypto (Base).string
On-chain transaction hash (if crypto was used).
string
Stripe internal ID (if fiat was used).
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Missing or malformed parameters. |
| 402 | per_tx | Amount exceeds the delegate’s per-transaction limit. |
| 402 | monthly | Charge would exceed the delegate’s monthly limit. |
| 402 | merchant_limit_exceeded | Amount exceeds merchant-specific limits. |
| 403 | merchant_inactive | Your merchant account is not active. |
| 429 | rate_limit_exceeded | Too many requests. |
⌘I