curl --request POST \
--url https://api.enterprise.sandbox.uphold.com/on-off-ramp/orders/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "on-ramp",
"origin": {
"type": "external-account",
"id": "7dc5c846-5ac2-4853-b67f-005cb83d4017"
},
"destination": {
"type": "crypto-address",
"asset": "XRP",
"network": "xrp-ledger",
"address": "rfBtmHiLwwWH5maH2PT78GxubrSydRF9aY",
"reference": "67809592"
},
"denomination": {
"asset": "USD",
"amount": "100.00",
"target": "origin"
}
}
'{
"quote": {
"id": "623000c8-9bdf-4a2b-aa3d-6a6b44a7f6a0",
"type": "on-ramp",
"pricing": "locked",
"origin": {
"asset": "USD",
"amount": "100.00",
"rate": "2.07021435361804542440",
"node": {
"type": "external-account",
"id": "7dc5c846-5ac2-4853-b67f-005cb83d4017",
"ownerId": "cd21b26d-35d2-408a-9201-b8fdbef7a604",
"via": "card",
"network": "visa"
}
},
"destination": {
"asset": "XRP",
"amount": "46.125658",
"rate": "0.48304176727029881912",
"node": {
"type": "crypto-address",
"network": "xrp-ledger",
"address": "rfBtmHiLwwWH5maH2PT78GxubrSydRF9aY",
"reference": "67809592"
}
},
"denomination": {
"asset": "USD",
"amount": "100.00",
"rate": "1.00000000000000000000",
"target": "origin"
},
"fees": [
{
"type": "deposit",
"code": "on-ramp-deposit",
"asset": "USD",
"amount": "1.00",
"percentage": "1",
"beneficiary": "uphold"
},
{
"type": "network",
"code": "crypto-network",
"asset": "USD",
"amount": "3.51"
}
],
"requirements": [
{
"name": "authorize:3ds",
"quoteId": "9f8a7c2e-1b3d-4e5f-8a6b-7c9d0e1f2a3b"
}
],
"expiresAt": "2024-07-24T15:22:51.000Z",
"refreshAt": "2024-07-24T15:22:39.000Z"
}
}Orders
Create quote
Create a quote for an on-ramp or off-ramp order.
POST
/
on-off-ramp
/
orders
/
quote
curl --request POST \
--url https://api.enterprise.sandbox.uphold.com/on-off-ramp/orders/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "on-ramp",
"origin": {
"type": "external-account",
"id": "7dc5c846-5ac2-4853-b67f-005cb83d4017"
},
"destination": {
"type": "crypto-address",
"asset": "XRP",
"network": "xrp-ledger",
"address": "rfBtmHiLwwWH5maH2PT78GxubrSydRF9aY",
"reference": "67809592"
},
"denomination": {
"asset": "USD",
"amount": "100.00",
"target": "origin"
}
}
'{
"quote": {
"id": "623000c8-9bdf-4a2b-aa3d-6a6b44a7f6a0",
"type": "on-ramp",
"pricing": "locked",
"origin": {
"asset": "USD",
"amount": "100.00",
"rate": "2.07021435361804542440",
"node": {
"type": "external-account",
"id": "7dc5c846-5ac2-4853-b67f-005cb83d4017",
"ownerId": "cd21b26d-35d2-408a-9201-b8fdbef7a604",
"via": "card",
"network": "visa"
}
},
"destination": {
"asset": "XRP",
"amount": "46.125658",
"rate": "0.48304176727029881912",
"node": {
"type": "crypto-address",
"network": "xrp-ledger",
"address": "rfBtmHiLwwWH5maH2PT78GxubrSydRF9aY",
"reference": "67809592"
}
},
"denomination": {
"asset": "USD",
"amount": "100.00",
"rate": "1.00000000000000000000",
"target": "origin"
},
"fees": [
{
"type": "deposit",
"code": "on-ramp-deposit",
"asset": "USD",
"amount": "1.00",
"percentage": "1",
"beneficiary": "uphold"
},
{
"type": "network",
"code": "crypto-network",
"asset": "USD",
"amount": "3.51"
}
],
"requirements": [
{
"name": "authorize:3ds",
"quoteId": "9f8a7c2e-1b3d-4e5f-8a6b-7c9d0e1f2a3b"
}
],
"expiresAt": "2024-07-24T15:22:51.000Z",
"refreshAt": "2024-07-24T15:22:39.000Z"
}
}Order type
Thetype field sets the order type: on-ramp to buy crypto with fiat, or off-ramp to sell crypto for fiat. It defines the shape of the rest of the request, including the node types allowed as origin and destination.
Origin and destination
Theorigin and destination objects identify the source and destination of funds respectively for the order.
Read more about the Anatomy of a quote request to understand the different types of nodes you can use as origin and destination for each order type. Refer to the API spec below to see how each node type is expressed in the request.
Denomination
Thedenomination object defines what is being moved, how much, and which side of the order the amount applies to precisely.
asset: The currency or asset in whichamountis expressed — for example,USDorBTC. Does not need to match the asset of the origin or the destination; Uphold will convert as needed.amount: The amount of the order, expressed as a decimal string (e.g."100.00").target: Controls which side of the order has the exactamount:origin— The origin pays exactlyamount. Fees are deducted before the destination receives funds.destination— The destination receives exactlyamount. Fees are added on top of what the origin pays.
Example: How target affects fee handling
Consider an on-ramp of 500 USD to BTC with a 2% fee:| Target | Paid by origin | Received by destination |
|---|---|---|
origin | Exactly 500 USD | BTC equivalent of 490 USD (after 10 USD fee) |
destination | 510 USD (500 + 10 USD fee) | BTC equivalent of exactly 500 USD |
origin when you want to control exactly how much the user pays. Use destination when you want to control exactly how much the user receives.
For a more comprehensive explanation of the denomination concept, see the Core Concepts page.
Pricing and fees
Thepricing field in the response says whether the rate is locked for the order or estimated, in which case the final amounts may differ. Quotes for orders whose deposit the user pushes, such as crypto from an external wallet, are always estimated. The fees field lists each fee charged on the order.
Read more about pricing and fees.
Quote expiry
A quote is valid for a limited time. TheexpiresAt field in the response indicates the exact time when the quote expires, after which it can no longer be used to create an order.
The refreshAt field indicates the recommended time to refresh the quote. There is no endpoint to refresh a quote: to refresh it, create a new one. Using refreshAt to drive quote refresh logic in your UI is highly recommended, reducing the risk of running into issues when creating the order.
A quote can only be used once. See Creating a quote-based order for the error returned when an order is created from an expired or already used quote.
Requirements
Some quotes require additional information before the order can be created. Therequirements array in the response lists what is needed — if it’s empty, no extra information is needed and you can proceed to create the order directly.
Read more about requirements.Body
application/json
- On-ramp
- Off-ramp
Was this page helpful?