curl --request POST \
--url https://api-beta.pepay.io/api/v1/payments/payment-addresses \
--header 'Content-Type: application/json' \
--header 'x-session-token: <api-key>' \
--header 'x-signature: <api-key>' \
--data '
{
"network": "ethereum",
"tokenId": 1
}
'import requests
url = "https://api-beta.pepay.io/api/v1/payments/payment-addresses"
payload = {
"network": "ethereum",
"tokenId": 1
}
headers = {
"x-session-token": "<api-key>",
"x-signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-session-token': '<api-key>',
'x-signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({network: 'ethereum', tokenId: 1})
};
fetch('https://api-beta.pepay.io/api/v1/payments/payment-addresses', 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-beta.pepay.io/api/v1/payments/payment-addresses",
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([
'network' => 'ethereum',
'tokenId' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-session-token: <api-key>",
"x-signature: <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-beta.pepay.io/api/v1/payments/payment-addresses"
payload := strings.NewReader("{\n \"network\": \"ethereum\",\n \"tokenId\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-session-token", "<api-key>")
req.Header.Add("x-signature", "<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-beta.pepay.io/api/v1/payments/payment-addresses")
.header("x-session-token", "<api-key>")
.header("x-signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"network\": \"ethereum\",\n \"tokenId\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-beta.pepay.io/api/v1/payments/payment-addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-session-token"] = '<api-key>'
request["x-signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"network\": \"ethereum\",\n \"tokenId\": 1\n}"
response = http.request(request)
puts response.read_body{
"temp_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"network": "ethereum",
"supported_token_id": 1,
"estimated_token_amount": "100.50",
"exchange_rate": "0.9950",
"usd_amount": 100,
"quote_last_updated_at": 1765540800,
"quote_valid_until": 1765541100,
"quote_expires_in_seconds": 300,
"ws_connection": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"endpoint": "/ws/payment",
"format": "event_v1",
"ws_url": "/ws/payment?format=event_v1"
}
}Allocate a payment address
Allocates (or rotates) the temporary payment address for this invoice and returns:
- the address to pay,
- a quote (estimated token amount + exchange rate), and
- a short-lived websocket token for realtime payment updates (
/ws/payment).
Choose network and tokenId from GET /api/v1/payments/available-tokens.
curl --request POST \
--url https://api-beta.pepay.io/api/v1/payments/payment-addresses \
--header 'Content-Type: application/json' \
--header 'x-session-token: <api-key>' \
--header 'x-signature: <api-key>' \
--data '
{
"network": "ethereum",
"tokenId": 1
}
'import requests
url = "https://api-beta.pepay.io/api/v1/payments/payment-addresses"
payload = {
"network": "ethereum",
"tokenId": 1
}
headers = {
"x-session-token": "<api-key>",
"x-signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-session-token': '<api-key>',
'x-signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({network: 'ethereum', tokenId: 1})
};
fetch('https://api-beta.pepay.io/api/v1/payments/payment-addresses', 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-beta.pepay.io/api/v1/payments/payment-addresses",
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([
'network' => 'ethereum',
'tokenId' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-session-token: <api-key>",
"x-signature: <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-beta.pepay.io/api/v1/payments/payment-addresses"
payload := strings.NewReader("{\n \"network\": \"ethereum\",\n \"tokenId\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-session-token", "<api-key>")
req.Header.Add("x-signature", "<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-beta.pepay.io/api/v1/payments/payment-addresses")
.header("x-session-token", "<api-key>")
.header("x-signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"network\": \"ethereum\",\n \"tokenId\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-beta.pepay.io/api/v1/payments/payment-addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-session-token"] = '<api-key>'
request["x-signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"network\": \"ethereum\",\n \"tokenId\": 1\n}"
response = http.request(request)
puts response.read_body{
"temp_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"network": "ethereum",
"supported_token_id": 1,
"estimated_token_amount": "100.50",
"exchange_rate": "0.9950",
"usd_amount": 100,
"quote_last_updated_at": 1765540800,
"quote_valid_until": 1765541100,
"quote_expires_in_seconds": 300,
"ws_connection": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"endpoint": "/ws/payment",
"format": "event_v1",
"ws_url": "/ws/payment?format=event_v1"
}
}Authorizations
Payment session token (opaque). Returned when creating an invoice; send on every request.
Payment session signature in the format signature_hash.timestamp_ms (returned with the invoice/session).
Body
Response
Address allocated
Always true; quote availability is communicated via quote_status.
Quote window status for this token selection.
available, unavailable, expired Machine-readable status.
ok, quote_unavailable, quote_expired, settlement_unavailable Human-readable status message.
Generated payment address
Network name (lowercase)
Token id that was selected.
Amount to pay in token (includes buffer)
USD to token exchange rate
Invoice amount in USD
Server timestamp the current quote was persisted (epoch seconds).
Server timestamp when the quote expires (epoch seconds).
Seconds remaining until quote_valid_until (computed at send time).
True when the backend recommends retrying to mint/refresh a quote.
Suggested backoff in seconds when retryable.
Show child attributes
Show child attributes
Was this page helpful?

