pub struct CreateTopUpLinkRequest {
pub asset: TopUpLinkAsset,
pub customer_display: Option<TopUpCustomerDisplayInput>,
pub order_total_amount: Option<TopUpLinkAmount>,
pub redirect_url: Option<HttpsUrl>,
pub top_up_amount: TopUpLinkAmount,
}Expand description
A request to create a Top-Up Link. The entity is inferred from the API key. topUpAmount and asset are required; orderTotalAmount, redirectUrl, and customerDisplay are optional. Unrecognized top-level fields are allowed and ignored.
JSON schema
{
"description": "A request to create a Top-Up Link. The entity is inferred from the API key. `topUpAmount` and `asset` are required; `orderTotalAmount`, `redirectUrl`, and `customerDisplay` are optional. Unrecognized top-level fields are allowed and ignored.",
"examples": [
{
"asset": "usdc",
"customerDisplay": {
"merchantName": "Example Merchant"
},
"orderTotalAmount": "130.45",
"redirectUrl": "https://www.example-merchant.com/checkout/return?orderId=701-3358192-4471016&sig=8a3f",
"topUpAmount": "100.00"
}
],
"type": "object",
"required": [
"asset",
"topUpAmount"
],
"properties": {
"asset": {
"description": "The asset credited by the Top-Up Link. Currently, only `usdc` is supported.",
"examples": [
"usdc"
],
"allOf": [
{
"$ref": "#/components/schemas/TopUpLinkAsset"
}
]
},
"customerDisplay": {
"$ref": "#/components/schemas/TopUpCustomerDisplayInput"
},
"orderTotalAmount": {
"description": "The total balance, denominated in `asset`, that the merchant expects the payer to need to complete the order. When supplied, the hosted Top-Up page shows the order total and the payer's current available balance, and computes the remaining shortfall from those values. This live shortfall is presentation context: it is separate from `topUpAmount` and does not replace, change, or limit that fixed suggestion.",
"examples": [
"130.45"
],
"allOf": [
{
"$ref": "#/components/schemas/TopUpLinkAmount"
}
]
},
"redirectUrl": {
"description": "Optional absolute HTTPS URL to which the payer is redirected after the top-up completes. The URL's origin must exactly match one of the entity's configured allowed origins: the HTTPS scheme, hostname (case-insensitive), and effective port (with the default HTTPS port normalized to `443`) are compared, while the path, query, and fragment are ignored. Wildcard or suffix/subdomain matching is not supported. Existing query parameters and the fragment are preserved. The URL must not contain a percent-decoded query key exactly equal to `toppedUpAmount`; every occurrence is rejected, including duplicates, while other casing is allowed. This value can contain sensitive merchant parameters; treat it as secret and do not log it.",
"examples": [
"https://www.example-merchant.com/checkout/return?orderId=701-3358192-4471016&sig=8a3f"
],
"allOf": [
{
"$ref": "#/components/schemas/HttpsUrl"
}
]
},
"topUpAmount": {
"description": "The merchant-provided initial suggested net amount to add, denominated in `asset`. The suggestion remains fixed on the created link and is not recomputed from `orderTotalAmount` or the payer's current available balance. The payer can adjust the amount they add in the hosted flow. Fiat fees are outside this value. Positive and nonzero, with at most two fractional digits.",
"examples": [
"100.00"
],
"allOf": [
{
"$ref": "#/components/schemas/TopUpLinkAmount"
}
]
}
}
}Fields§
§asset: TopUpLinkAssetThe asset credited by the Top-Up Link. Currently, only usdc is supported.
customer_display: Option<TopUpCustomerDisplayInput>§order_total_amount: Option<TopUpLinkAmount>The total balance, denominated in asset, that the merchant expects the payer to need to complete the order. When supplied, the hosted Top-Up page shows the order total and the payer’s current available balance, and computes the remaining shortfall from those values. This live shortfall is presentation context: it is separate from topUpAmount and does not replace, change, or limit that fixed suggestion.
redirect_url: Option<HttpsUrl>Optional absolute HTTPS URL to which the payer is redirected after the top-up completes. The URL’s origin must exactly match one of the entity’s configured allowed origins: the HTTPS scheme, hostname (case-insensitive), and effective port (with the default HTTPS port normalized to 443) are compared, while the path, query, and fragment are ignored. Wildcard or suffix/subdomain matching is not supported. Existing query parameters and the fragment are preserved. The URL must not contain a percent-decoded query key exactly equal to toppedUpAmount; every occurrence is rejected, including duplicates, while other casing is allowed. This value can contain sensitive merchant parameters; treat it as secret and do not log it.
top_up_amount: TopUpLinkAmountThe merchant-provided initial suggested net amount to add, denominated in asset. The suggestion remains fixed on the created link and is not recomputed from orderTotalAmount or the payer’s current available balance. The payer can adjust the amount they add in the hosted flow. Fiat fees are outside this value. Positive and nonzero, with at most two fractional digits.