Create public receive Payment
curl --request POST \
--url https://prod-api.stableyard.fi/v2/public/apps/{appId}/payments \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"intent": "receive",
"recipient": {
"wallet": {
"chainId": 8453,
"address": "0x1111111111111111111111111111111111111111",
"assetCode": "USDC",
"tokenAddress": "0x1111111111111111111111111111111111111111"
}
},
"amountMode": "collect_exact",
"paymentAmount": {
"amount": "50.00",
"assetType": "crypto",
"assetCode": "USDC",
"chainId": 8453,
"tokenAddress": "0x1111111111111111111111111111111111111111"
},
"returnUrl": "https://example.com"
}
'import requests
url = "https://prod-api.stableyard.fi/v2/public/apps/{appId}/payments"
payload = {
"intent": "receive",
"recipient": { "wallet": {
"chainId": 8453,
"address": "0x1111111111111111111111111111111111111111",
"assetCode": "USDC",
"tokenAddress": "0x1111111111111111111111111111111111111111"
} },
"amountMode": "collect_exact",
"paymentAmount": {
"amount": "50.00",
"assetType": "crypto",
"assetCode": "USDC",
"chainId": 8453,
"tokenAddress": "0x1111111111111111111111111111111111111111"
},
"returnUrl": "https://example.com"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
intent: 'receive',
recipient: {
wallet: {
chainId: 8453,
address: '0x1111111111111111111111111111111111111111',
assetCode: 'USDC',
tokenAddress: '0x1111111111111111111111111111111111111111'
}
},
amountMode: 'collect_exact',
paymentAmount: {
amount: '50.00',
assetType: 'crypto',
assetCode: 'USDC',
chainId: 8453,
tokenAddress: '0x1111111111111111111111111111111111111111'
},
returnUrl: 'https://example.com'
})
};
fetch('https://prod-api.stableyard.fi/v2/public/apps/{appId}/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://prod-api.stableyard.fi/v2/public/apps/{appId}/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([
'intent' => 'receive',
'recipient' => [
'wallet' => [
'chainId' => 8453,
'address' => '0x1111111111111111111111111111111111111111',
'assetCode' => 'USDC',
'tokenAddress' => '0x1111111111111111111111111111111111111111'
]
],
'amountMode' => 'collect_exact',
'paymentAmount' => [
'amount' => '50.00',
'assetType' => 'crypto',
'assetCode' => 'USDC',
'chainId' => 8453,
'tokenAddress' => '0x1111111111111111111111111111111111111111'
],
'returnUrl' => 'https://example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://prod-api.stableyard.fi/v2/public/apps/{appId}/payments"
payload := strings.NewReader("{\n \"intent\": \"receive\",\n \"recipient\": {\n \"wallet\": {\n \"chainId\": 8453,\n \"address\": \"0x1111111111111111111111111111111111111111\",\n \"assetCode\": \"USDC\",\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n }\n },\n \"amountMode\": \"collect_exact\",\n \"paymentAmount\": {\n \"amount\": \"50.00\",\n \"assetType\": \"crypto\",\n \"assetCode\": \"USDC\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n },\n \"returnUrl\": \"https://example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-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://prod-api.stableyard.fi/v2/public/apps/{appId}/payments")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"intent\": \"receive\",\n \"recipient\": {\n \"wallet\": {\n \"chainId\": 8453,\n \"address\": \"0x1111111111111111111111111111111111111111\",\n \"assetCode\": \"USDC\",\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n }\n },\n \"amountMode\": \"collect_exact\",\n \"paymentAmount\": {\n \"amount\": \"50.00\",\n \"assetType\": \"crypto\",\n \"assetCode\": \"USDC\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n },\n \"returnUrl\": \"https://example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.stableyard.fi/v2/public/apps/{appId}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"intent\": \"receive\",\n \"recipient\": {\n \"wallet\": {\n \"chainId\": 8453,\n \"address\": \"0x1111111111111111111111111111111111111111\",\n \"assetCode\": \"USDC\",\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n }\n },\n \"amountMode\": \"collect_exact\",\n \"paymentAmount\": {\n \"amount\": \"50.00\",\n \"assetType\": \"crypto\",\n \"assetCode\": \"USDC\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n },\n \"returnUrl\": \"https://example.com\"\n}"
response = http.request(request)
puts response.read_body{
"payment": {
"id": "payment_123",
"apiVersion": "2026-09-09",
"intent": "receive",
"amountMode": "collect_exact",
"status": "requires_payment_method",
"stage": null,
"operationalState": "normal",
"operationalReasonCode": null,
"operationalUpdatedAt": null,
"statusVersion": 1,
"paymentAmount": {
"amount": "50.00",
"amountAtomic": "50000000",
"assetType": "crypto",
"assetCode": "USDC",
"decimals": 6,
"chainId": 8453,
"tokenAddress": "0x1111111111111111111111111111111111111111"
},
"description": null,
"externalReference": null,
"expiresAt": null,
"createdAt": "2026-08-28T10:00:00.000Z",
"updatedAt": "2026-08-28T10:00:00.000Z"
},
"execution": {
"appId": "app_123",
"displayState": "preparing",
"statusInfo": {
"code": "example",
"terminal": true,
"userActionRequired": true,
"retryable": true,
"message": "example",
"updatedAt": null,
"nextPollAfterMs": null
},
"description": null,
"returnUrl": null,
"destinationAmount": {
"amountAtomic": "10000000",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"amounts": {
"recipient": {
"amountAtomic": "10000000",
"amountDecimal": "10",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
}
},
"expiresAt": "2026-08-28T10:00:00.000Z",
"merchant": {
"displayName": "Acme Inc",
"logoUrl": "https://cdn.example.com/acme-logo.png",
"primaryColor": "#5B5BF6"
},
"presentedBy": {
"displayName": "Acme Platform",
"logoUrl": null
},
"provisioning": {
"status": "preparing"
}
},
"checkout": {
"paymentUrl": "https://example.com",
"clientSecret": "examplexxxxxxxxxxxxxxxxxxxxxxxxx",
"expiresAt": "2026-08-28T10:00:00.000Z",
"returnUrl": null
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}Hosted checkout
Create a public receive payment
Create a policy-constrained receive Payment from a browser.
POST
/
v2
/
public
/
apps
/
{appId}
/
payments
Create public receive Payment
curl --request POST \
--url https://prod-api.stableyard.fi/v2/public/apps/{appId}/payments \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"intent": "receive",
"recipient": {
"wallet": {
"chainId": 8453,
"address": "0x1111111111111111111111111111111111111111",
"assetCode": "USDC",
"tokenAddress": "0x1111111111111111111111111111111111111111"
}
},
"amountMode": "collect_exact",
"paymentAmount": {
"amount": "50.00",
"assetType": "crypto",
"assetCode": "USDC",
"chainId": 8453,
"tokenAddress": "0x1111111111111111111111111111111111111111"
},
"returnUrl": "https://example.com"
}
'import requests
url = "https://prod-api.stableyard.fi/v2/public/apps/{appId}/payments"
payload = {
"intent": "receive",
"recipient": { "wallet": {
"chainId": 8453,
"address": "0x1111111111111111111111111111111111111111",
"assetCode": "USDC",
"tokenAddress": "0x1111111111111111111111111111111111111111"
} },
"amountMode": "collect_exact",
"paymentAmount": {
"amount": "50.00",
"assetType": "crypto",
"assetCode": "USDC",
"chainId": 8453,
"tokenAddress": "0x1111111111111111111111111111111111111111"
},
"returnUrl": "https://example.com"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
intent: 'receive',
recipient: {
wallet: {
chainId: 8453,
address: '0x1111111111111111111111111111111111111111',
assetCode: 'USDC',
tokenAddress: '0x1111111111111111111111111111111111111111'
}
},
amountMode: 'collect_exact',
paymentAmount: {
amount: '50.00',
assetType: 'crypto',
assetCode: 'USDC',
chainId: 8453,
tokenAddress: '0x1111111111111111111111111111111111111111'
},
returnUrl: 'https://example.com'
})
};
fetch('https://prod-api.stableyard.fi/v2/public/apps/{appId}/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://prod-api.stableyard.fi/v2/public/apps/{appId}/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([
'intent' => 'receive',
'recipient' => [
'wallet' => [
'chainId' => 8453,
'address' => '0x1111111111111111111111111111111111111111',
'assetCode' => 'USDC',
'tokenAddress' => '0x1111111111111111111111111111111111111111'
]
],
'amountMode' => 'collect_exact',
'paymentAmount' => [
'amount' => '50.00',
'assetType' => 'crypto',
'assetCode' => 'USDC',
'chainId' => 8453,
'tokenAddress' => '0x1111111111111111111111111111111111111111'
],
'returnUrl' => 'https://example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://prod-api.stableyard.fi/v2/public/apps/{appId}/payments"
payload := strings.NewReader("{\n \"intent\": \"receive\",\n \"recipient\": {\n \"wallet\": {\n \"chainId\": 8453,\n \"address\": \"0x1111111111111111111111111111111111111111\",\n \"assetCode\": \"USDC\",\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n }\n },\n \"amountMode\": \"collect_exact\",\n \"paymentAmount\": {\n \"amount\": \"50.00\",\n \"assetType\": \"crypto\",\n \"assetCode\": \"USDC\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n },\n \"returnUrl\": \"https://example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-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://prod-api.stableyard.fi/v2/public/apps/{appId}/payments")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"intent\": \"receive\",\n \"recipient\": {\n \"wallet\": {\n \"chainId\": 8453,\n \"address\": \"0x1111111111111111111111111111111111111111\",\n \"assetCode\": \"USDC\",\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n }\n },\n \"amountMode\": \"collect_exact\",\n \"paymentAmount\": {\n \"amount\": \"50.00\",\n \"assetType\": \"crypto\",\n \"assetCode\": \"USDC\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n },\n \"returnUrl\": \"https://example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.stableyard.fi/v2/public/apps/{appId}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"intent\": \"receive\",\n \"recipient\": {\n \"wallet\": {\n \"chainId\": 8453,\n \"address\": \"0x1111111111111111111111111111111111111111\",\n \"assetCode\": \"USDC\",\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n }\n },\n \"amountMode\": \"collect_exact\",\n \"paymentAmount\": {\n \"amount\": \"50.00\",\n \"assetType\": \"crypto\",\n \"assetCode\": \"USDC\",\n \"chainId\": 8453,\n \"tokenAddress\": \"0x1111111111111111111111111111111111111111\"\n },\n \"returnUrl\": \"https://example.com\"\n}"
response = http.request(request)
puts response.read_body{
"payment": {
"id": "payment_123",
"apiVersion": "2026-09-09",
"intent": "receive",
"amountMode": "collect_exact",
"status": "requires_payment_method",
"stage": null,
"operationalState": "normal",
"operationalReasonCode": null,
"operationalUpdatedAt": null,
"statusVersion": 1,
"paymentAmount": {
"amount": "50.00",
"amountAtomic": "50000000",
"assetType": "crypto",
"assetCode": "USDC",
"decimals": 6,
"chainId": 8453,
"tokenAddress": "0x1111111111111111111111111111111111111111"
},
"description": null,
"externalReference": null,
"expiresAt": null,
"createdAt": "2026-08-28T10:00:00.000Z",
"updatedAt": "2026-08-28T10:00:00.000Z"
},
"execution": {
"appId": "app_123",
"displayState": "preparing",
"statusInfo": {
"code": "example",
"terminal": true,
"userActionRequired": true,
"retryable": true,
"message": "example",
"updatedAt": null,
"nextPollAfterMs": null
},
"description": null,
"returnUrl": null,
"destinationAmount": {
"amountAtomic": "10000000",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"amounts": {
"recipient": {
"amountAtomic": "10000000",
"amountDecimal": "10",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
}
},
"expiresAt": "2026-08-28T10:00:00.000Z",
"merchant": {
"displayName": "Acme Inc",
"logoUrl": "https://cdn.example.com/acme-logo.png",
"primaryColor": "#5B5BF6"
},
"presentedBy": {
"displayName": "Acme Platform",
"logoUrl": null
},
"provisioning": {
"status": "preparing"
}
},
"checkout": {
"paymentUrl": "https://example.com",
"clientSecret": "examplexxxxxxxxxxxxxxxxxxxxxxxxx",
"expiresAt": "2026-08-28T10:00:00.000Z",
"returnUrl": null
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}Creates one receive Payment from a browser. The recipient is either an allowed wallet for Add Money or a same-app UPA that explicitly enabled public acceptance. Public send is never allowed. The app ID selects the server-side origin, amount, asset, destination, method and expiry policy; it is not authentication.
Idempotency-Key is required: generate it once per intended Payment and retry the identical request with the same value.Headers
Generate once per intended Payment. Retry the identical request with the same value.
Example:
"payment-request-001"
Path Parameters
Example:
"app_123"
Body
application/json
Allowed value:
"receive"- Allowed wallet destination
- Public UPA payment page
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Allowed value:
"collect_exact"Maximum string length:
2048