Refresh Payment option
curl --request POST \
--url https://prod-api.stableyard.fi/v2/public/payments/{paymentId}/options/{optionId}/refresh \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"receiptEmail": "[email protected]",
"fiatCurrency": "USD",
"returnUrl": "https://example.com"
}
'import requests
url = "https://prod-api.stableyard.fi/v2/public/payments/{paymentId}/options/{optionId}/refresh"
payload = {
"receiptEmail": "[email protected]",
"fiatCurrency": "USD",
"returnUrl": "https://example.com"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
receiptEmail: '[email protected]',
fiatCurrency: 'USD',
returnUrl: 'https://example.com'
})
};
fetch('https://prod-api.stableyard.fi/v2/public/payments/{paymentId}/options/{optionId}/refresh', 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/payments/{paymentId}/options/{optionId}/refresh",
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([
'receiptEmail' => '[email protected]',
'fiatCurrency' => 'USD',
'returnUrl' => 'https://example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/payments/{paymentId}/options/{optionId}/refresh"
payload := strings.NewReader("{\n \"receiptEmail\": \"[email protected]\",\n \"fiatCurrency\": \"USD\",\n \"returnUrl\": \"https://example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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("https://prod-api.stableyard.fi/v2/public/payments/{paymentId}/options/{optionId}/refresh")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"receiptEmail\": \"[email protected]\",\n \"fiatCurrency\": \"USD\",\n \"returnUrl\": \"https://example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.stableyard.fi/v2/public/payments/{paymentId}/options/{optionId}/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"receiptEmail\": \"[email protected]\",\n \"fiatCurrency\": \"USD\",\n \"returnUrl\": \"https://example.com\"\n}"
response = http.request(request)
puts response.read_body{
"previousSelectedOptionId": "pay_option_previous",
"option": {
"id": "pay_option_123",
"providerCode": "direct",
"paymentMethodType": "crypto",
"paymentMethodId": "crypto.direct",
"type": "crypto",
"displayName": "Arbitrum USDC",
"status": "creating",
"selectionStatus": "selected",
"requiredAmountAtomic": "1000000",
"paidAmountAtomic": "1000000",
"remainingAmountAtomic": "1000000",
"isTerminal": true,
"confirmationMode": "provider_webhook",
"transactionSubmissions": [
{
"transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"purpose": "destination_escrow",
"status": "submitted",
"failureCode": null,
"submittedAt": "2026-08-28T10:00:00.000Z",
"verifiedAt": null
}
],
"sourceAmount": {
"amountAtomic": "10000000",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"destinationAmount": {
"amountAtomic": "10000000",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"payerAmount": {
"amountAtomic": "10000000",
"amountDecimal": "10",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"recipientAmount": {
"amountAtomic": "10000000",
"amountDecimal": "10",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"providerFee": {
"amountAtomic": "10000000",
"amountDecimal": "10",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"execution": {
"type": "deposit_address",
"address": "0x1111111111111111111111111111111111111111",
"chainId": 1,
"tokenAddress": "0x1111111111111111111111111111111111111111",
"assetSymbol": "USDC",
"amountAtomic": "1000000",
"decimals": 0,
"expiresAt": null
},
"expiresAt": null,
"refreshable": true,
"feeAmountAtomic": null,
"actionExpiresAt": null,
"quoteExpiresAt": null,
"orderExpiresAt": null,
"receipts": [
{
"chainId": 1,
"txHash": "example",
"logIndex": null,
"amountAtomic": "1000000",
"confirmedAt": "2026-08-28T10:00:00.000Z"
}
]
}
}{
"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"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}Hosted checkout
Refresh a payment option
Replace an expired or failed provider option with a newly quoted one.
POST
/
v2
/
public
/
payments
/
{paymentId}
/
options
/
{optionId}
/
refresh
Refresh Payment option
curl --request POST \
--url https://prod-api.stableyard.fi/v2/public/payments/{paymentId}/options/{optionId}/refresh \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"receiptEmail": "[email protected]",
"fiatCurrency": "USD",
"returnUrl": "https://example.com"
}
'import requests
url = "https://prod-api.stableyard.fi/v2/public/payments/{paymentId}/options/{optionId}/refresh"
payload = {
"receiptEmail": "[email protected]",
"fiatCurrency": "USD",
"returnUrl": "https://example.com"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
receiptEmail: '[email protected]',
fiatCurrency: 'USD',
returnUrl: 'https://example.com'
})
};
fetch('https://prod-api.stableyard.fi/v2/public/payments/{paymentId}/options/{optionId}/refresh', 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/payments/{paymentId}/options/{optionId}/refresh",
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([
'receiptEmail' => '[email protected]',
'fiatCurrency' => 'USD',
'returnUrl' => 'https://example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/payments/{paymentId}/options/{optionId}/refresh"
payload := strings.NewReader("{\n \"receiptEmail\": \"[email protected]\",\n \"fiatCurrency\": \"USD\",\n \"returnUrl\": \"https://example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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("https://prod-api.stableyard.fi/v2/public/payments/{paymentId}/options/{optionId}/refresh")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"receiptEmail\": \"[email protected]\",\n \"fiatCurrency\": \"USD\",\n \"returnUrl\": \"https://example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.stableyard.fi/v2/public/payments/{paymentId}/options/{optionId}/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"receiptEmail\": \"[email protected]\",\n \"fiatCurrency\": \"USD\",\n \"returnUrl\": \"https://example.com\"\n}"
response = http.request(request)
puts response.read_body{
"previousSelectedOptionId": "pay_option_previous",
"option": {
"id": "pay_option_123",
"providerCode": "direct",
"paymentMethodType": "crypto",
"paymentMethodId": "crypto.direct",
"type": "crypto",
"displayName": "Arbitrum USDC",
"status": "creating",
"selectionStatus": "selected",
"requiredAmountAtomic": "1000000",
"paidAmountAtomic": "1000000",
"remainingAmountAtomic": "1000000",
"isTerminal": true,
"confirmationMode": "provider_webhook",
"transactionSubmissions": [
{
"transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"purpose": "destination_escrow",
"status": "submitted",
"failureCode": null,
"submittedAt": "2026-08-28T10:00:00.000Z",
"verifiedAt": null
}
],
"sourceAmount": {
"amountAtomic": "10000000",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"destinationAmount": {
"amountAtomic": "10000000",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"payerAmount": {
"amountAtomic": "10000000",
"amountDecimal": "10",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"recipientAmount": {
"amountAtomic": "10000000",
"amountDecimal": "10",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"providerFee": {
"amountAtomic": "10000000",
"amountDecimal": "10",
"assetSymbol": "USDC",
"decimals": 6,
"chainId": 42161,
"tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"execution": {
"type": "deposit_address",
"address": "0x1111111111111111111111111111111111111111",
"chainId": 1,
"tokenAddress": "0x1111111111111111111111111111111111111111",
"assetSymbol": "USDC",
"amountAtomic": "1000000",
"decimals": 0,
"expiresAt": null
},
"expiresAt": null,
"refreshable": true,
"feeAmountAtomic": null,
"actionExpiresAt": null,
"quoteExpiresAt": null,
"orderExpiresAt": null,
"receipts": [
{
"chainId": 1,
"txHash": "example",
"logIndex": null,
"amountAtomic": "1000000",
"confirmedAt": "2026-08-28T10:00:00.000Z"
}
]
}
}{
"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"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}{
"error": {
"code": "bad_request",
"message": "The request is invalid",
"details": "example"
}
}Replaces an expired or failed provider option with a newly quoted option. Refresh is rejected after any payment evidence is observed. Send a new
Idempotency-Key for each intended replacement.Authorizations
Short-lived browser capability for exactly one payment_* resource. Never place it in a URL.
Headers
Use this for retry-safe payment operations from your backend.
Example:
"payment-request-001"
Path Parameters
Canonical payment_* identifier. Internal execution identifiers are never accepted by Partner Payment routes.
Pattern:
^payment_[A-Za-z0-9_-]+$Example:
"payment_123"
Payment option returned by the payment-method selection endpoint.
Example:
"pay_option_123"
Body
application/json