GuidesAPI ReferenceChangelog
Guides

Stablecoin Conversion

The Conversion API prices and executes asset conversions for a customer. The flow is:

  1. Create Quote — price the conversion and get a short-lived quote_id.
  2. Show rate, amounts, and valid_until_timestamp to your customer.
  3. Execute Quote — execute the conversion with the quote_id. The response returns a transaction_id.
  4. Get Conversion — poll the order by transaction_id, or wait for the conversion.completed / conversion.failed webhook.

All conversion endpoints are scoped to a customer: /v1/customers/{customer_id}/conversions/....

Create Quote

Endpoint

POST /v1/customers/{customer_id}/conversions/quote201 Created

Purpose

Generate a short-lived quote for converting between two assets. Use it to display pricing to your customer before execution.

Request Parameters

FieldTypeRequiredDescription
from_asset.assetstringYesAsset the customer pays with (for example USD, USDC).
from_asset.amountstringNoAmount to convert from. Omit if you set to_asset.amount.
to_asset.assetstringYesAsset the customer receives.
to_asset.amountstringNoAmount to convert to. Omit if you set from_asset.amount.

Amount rules:

  • Set the amount on exactly one side. Setting both, or neither, returns 400.
  • from_asset.amount set → sell-side quote: the customer pays exactly that amount, and user_obtain_amount is priced from it.
  • to_asset.amount set → buy-side quote: the customer receives exactly that amount, and user_pay_amount is priced from it.
  • Amounts are decimal strings. Per-pair minimums and maximums apply and are rejected with error code 00020004.

The request does not take a network field. Conversions move balances inside the 1Money platform; the network is chosen when you deposit or withdraw, not when you convert.

Example Request

{
  "from_asset": {
    "asset": "USD",
    "amount": "1000.00"
  },
  "to_asset": {
    "asset": "USDC"
  }
}

Example Response

{
  "quote_id": "1f581bfe-25de-42aa-9429-6802412850b3",
  "user_pay_amount": "1000.00",
  "user_pay_asset": "USD",
  "user_obtain_amount": "999.50",
  "user_obtain_asset": "USDC",
  "symbol": "USDC/USD",
  "rate": "1.0005",
  "expire_time": 30,
  "valid_until_timestamp": "2025-08-21T07:57:27.981Z"
}

Response Fields

FieldTypeDescription
quote_idstringQuote identifier, passed to Execute Quote.
user_pay_amountstringAmount the customer pays.
user_pay_assetstringAsset the customer pays.
user_obtain_amountstringAmount the customer receives.
user_obtain_assetstringAsset the customer receives.
symbolstringTrading pair, base/quote. Gives the rate direction: 1 base ≈ rate quote.
ratestringQuoted rate for symbol.
expire_timeintegerQuote lifetime in seconds (currently 30).
valid_until_timestampstringISO 8601 timestamp when the quote expires.

Executing an expired quote returns 400 with error code 00020001. If you have not submitted it for execution, you can request a new quote. If an earlier Execute Quote request has an unresolved outcome, expiry does not establish whether it created an order. Follow Resolving an Execute Quote timeout and reconcile that operation before submitting a replacement conversion.

Execute Quote

Endpoint

POST /v1/customers/{customer_id}/conversions/hedge201 Created

Purpose

Execute the quoted conversion. This debits the pay asset, credits the obtain asset, and creates a conversion transaction.

Request Parameters

FieldTypeRequiredDescription
quote_idstringYesUUID returned by Create Quote (36 chars).

This endpoint does not accept an Idempotency-Key header. See Error for retry and timeout handling.

Example Request

{
  "quote_id": "1f581bfe-25de-42aa-9429-6802412850b3"
}

Example Response

{
  "transaction_id": "aac5201f-7f1c-11f0-b018-de09fc637374",
  "order_status": "PENDING",
  "quote_id": "1f581bfe-25de-42aa-9429-6802412850b3",
  "user_pay_amount": "1000.00",
  "user_pay_asset": "USD",
  "user_obtain_amount": "999.50",
  "user_obtain_asset": "USDC",
  "symbol": "USDC/USD",
  "rate": "1.0005",
  "fee": "0.50",
  "fee_currency": "USD",
  "platform_fee": {
    "value": "0.50",
    "asset": "USD"
  },
  "partner_fee": {
    "value": "0",
    "asset": "USD"
  }
}

Get Conversion

Endpoint

GET /v1/customers/{customer_id}/conversions/order?transaction_id={transaction_id}200 OK

Purpose

Retrieve a conversion order by the transaction_id returned from Execute Quote. Returns 404 if no conversion with that transaction_id exists for the customer.

Response Fields

Get Conversion and Execute Quote return the same object:

FieldTypeDescription
transaction_idstringConversion transaction identifier. Also usable with the transaction APIs.
order_statusstringPENDING, SUCCESS, or FAIL.
quote_idstringQuote that was executed.
user_pay_amountstringAmount debited from the customer.
user_pay_assetstringAsset debited.
user_obtain_amountstringAmount credited to the customer.
user_obtain_assetstringAsset credited.
symbolstringTrading pair, base/quote.
ratestringExecuted rate.
feestringTotal trading fee.
fee_currencystringAsset the fee is charged in.
platform_feeobject{ "value": string, "asset": string } — 1Money platform fee.
partner_feeobject{ "value": string, "asset": string } — your partner fee, 0 if none.

Order Status

order_statusMeaning
PENDINGConversion accepted and in flight. Keep polling or wait for webhook.
SUCCESSConversion settled. Balances are final.
FAILConversion failed or expired. No balance change.

Webhooks

Terminal states are also delivered as conversion.completed and conversion.failed webhooks, keyed by the same transaction_id. See Conversion Webhooks. Webhooks are the recommended way to track completion; poll Get Conversion only for reconciliation.

Fields no longer used

Earlier drafts of this guide described a hedge model. Those fields are not part of the API and are not returned:

hedge_id, conversion_id, status, fills, executed_at, created_at, modified_at, updated_at, valid_until, fee_asset, and any network field on from_asset / to_asset.

Use transaction_id (not hedge_id or conversion_id), order_status (not status), and valid_until_timestamp (not valid_until). Conversions settle in full or fail — there are no partial fills.



Did this page help you?