Skip to main content
POST
/
quotes
Create a payment quote
curl --request POST \
  --url https://sandbox-api.polygon.technology/v0.10/quotes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "customerId": "<string>",
  "destination": {
    "details": {
      "asset": "<string>",
      "id": "<string>",
      "network": "<string>"
    },
    "type": "walletOms",
    "amount": "<string>"
  },
  "source": {
    "details": {
      "asset": "<string>",
      "id": "<string>",
      "network": "<string>"
    },
    "type": "walletOms",
    "amount": "<string>"
  },
  "metadata": {},
  "sponsorGas": true
}
'
import requests

url = "https://sandbox-api.polygon.technology/v0.10/quotes"

payload = {
    "customerId": "<string>",
    "destination": {
        "details": {
            "asset": "<string>",
            "id": "<string>",
            "network": "<string>"
        },
        "type": "walletOms",
        "amount": "<string>"
    },
    "source": {
        "details": {
            "asset": "<string>",
            "id": "<string>",
            "network": "<string>"
        },
        "type": "walletOms",
        "amount": "<string>"
    },
    "metadata": {},
    "sponsorGas": True
}
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({
    customerId: '<string>',
    destination: {
      details: {asset: '<string>', id: '<string>', network: '<string>'},
      type: 'walletOms',
      amount: '<string>'
    },
    source: {
      details: {asset: '<string>', id: '<string>', network: '<string>'},
      type: 'walletOms',
      amount: '<string>'
    },
    metadata: {},
    sponsorGas: true
  })
};

fetch('https://sandbox-api.polygon.technology/v0.10/quotes', 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://sandbox-api.polygon.technology/v0.10/quotes",
  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([
    'customerId' => '<string>',
    'destination' => [
        'details' => [
                'asset' => '<string>',
                'id' => '<string>',
                'network' => '<string>'
        ],
        'type' => 'walletOms',
        'amount' => '<string>'
    ],
    'source' => [
        'details' => [
                'asset' => '<string>',
                'id' => '<string>',
                'network' => '<string>'
        ],
        'type' => 'walletOms',
        'amount' => '<string>'
    ],
    'metadata' => [
        
    ],
    'sponsorGas' => true
  ]),
  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://sandbox-api.polygon.technology/v0.10/quotes"

	payload := strings.NewReader("{\n  \"customerId\": \"<string>\",\n  \"destination\": {\n    \"details\": {\n      \"asset\": \"<string>\",\n      \"id\": \"<string>\",\n      \"network\": \"<string>\"\n    },\n    \"type\": \"walletOms\",\n    \"amount\": \"<string>\"\n  },\n  \"source\": {\n    \"details\": {\n      \"asset\": \"<string>\",\n      \"id\": \"<string>\",\n      \"network\": \"<string>\"\n    },\n    \"type\": \"walletOms\",\n    \"amount\": \"<string>\"\n  },\n  \"metadata\": {},\n  \"sponsorGas\": true\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://sandbox-api.polygon.technology/v0.10/quotes")
  .header("Idempotency-Key", "<idempotency-key>")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customerId\": \"<string>\",\n  \"destination\": {\n    \"details\": {\n      \"asset\": \"<string>\",\n      \"id\": \"<string>\",\n      \"network\": \"<string>\"\n    },\n    \"type\": \"walletOms\",\n    \"amount\": \"<string>\"\n  },\n  \"source\": {\n    \"details\": {\n      \"asset\": \"<string>\",\n      \"id\": \"<string>\",\n      \"network\": \"<string>\"\n    },\n    \"type\": \"walletOms\",\n    \"amount\": \"<string>\"\n  },\n  \"metadata\": {},\n  \"sponsorGas\": true\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.polygon.technology/v0.10/quotes")

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  \"customerId\": \"<string>\",\n  \"destination\": {\n    \"details\": {\n      \"asset\": \"<string>\",\n      \"id\": \"<string>\",\n      \"network\": \"<string>\"\n    },\n    \"type\": \"walletOms\",\n    \"amount\": \"<string>\"\n  },\n  \"source\": {\n    \"details\": {\n      \"asset\": \"<string>\",\n      \"id\": \"<string>\",\n      \"network\": \"<string>\"\n    },\n    \"type\": \"walletOms\",\n    \"amount\": \"<string>\"\n  },\n  \"metadata\": {},\n  \"sponsorGas\": true\n}"

response = http.request(request)
puts response.read_body
{
  "customerId": "<string>",
  "destination": {
    "category": "crypto",
    "details": {
      "asset": "<string>",
      "blockchainAddress": "<string>",
      "blockchainAsset": {
        "chainId": "<string>",
        "tokenId": "<string>"
      },
      "id": "<string>",
      "network": "<string>",
      "txHash": "<string>"
    },
    "type": "walletOms",
    "party": {
      "customerId": "<string>",
      "relationship": "customer"
    },
    "payoutOrigin": {
      "details": {
        "accountHolder": "customer",
        "accountHolderName": "<string>",
        "accountNumber": "<string>",
        "routingNumber": "<string>",
        "virtualAccountId": "<string>"
      },
      "type": "bank"
    }
  },
  "id": "<string>",
  "object": "quote",
  "pricing": {
    "destination": {
      "amountGross": "<string>",
      "amountNet": "<string>",
      "asset": "<string>",
      "feesDeducted": {
        "developer": "<string>",
        "gas": "<string>",
        "oms": "<string>",
        "total": "<string>"
      }
    },
    "effectiveRate": "<string>",
    "exchangeRate": "<string>",
    "pair": "<string>",
    "source": {
      "amountGross": "<string>",
      "amountNet": "<string>",
      "asset": "<string>",
      "feesDeducted": {
        "developer": "<string>",
        "gas": "<string>",
        "oms": "<string>",
        "total": "<string>"
      }
    },
    "sponsorGas": true,
    "sponsorGasCost": "<string>"
  },
  "source": {
    "category": "crypto",
    "details": {
      "asset": "<string>",
      "blockchainAddress": "<string>",
      "blockchainAsset": {
        "chainId": "<string>",
        "tokenId": "<string>"
      },
      "id": "<string>",
      "network": "<string>",
      "txHash": "<string>"
    },
    "type": "walletOms",
    "party": {
      "customerId": "<string>",
      "relationship": "customer"
    }
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "expiresAt": "2023-11-07T05:31:56Z",
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Token from POST /auth/token

Headers

Idempotency-Key
string
required

Required on POST and PUT requests. Use a unique value per logical mutation attempt, for example a UUID.

Body

application/json

Request body for creating a quote. Pick a type on each side and set the amount on exactly one side; OMS calculates the other.

customerId
string
required
destination
object
required

Pull from / deliver to an OMS Multi-Chain Wallet owned by the customer.

source
object
required

Pull from / deliver to an OMS Multi-Chain Wallet owned by the customer.

metadata
object
settlementType
enum<string>

Card rail only: internal (OMS custodies the crypto) or external (on-chain wallet). Defaults: card buy -> external, card sell -> internal. Ignored for non-card rails.

Available options:
internal,
external
sponsorGas
boolean

Response

201 - application/json

The request has succeeded and a new resource has been created as a result.

A price quote for moving money between two instruments. It locks an exchange rate and the amounts for a short window; execute it by creating a transaction that references this quote's id.

customerId
string
required
destination
object
required

The destination side of a transaction or quote: a typed instrument plus payoutOrigin. Amounts live only in pricing.

id
string
required
object
enum<string>
required
Available options:
quote
pricing
object
required

Consolidated economics.

source
object
required

OMS-custodied crypto wallet instrument.

status
enum<string>
required

Status of a quote. open: pricing locked, awaiting acceptance. accepted: a transaction has been created from it. expired: the pricing window elapsed.

Available options:
open,
accepted,
expired
createdAt
string<date-time>
expiresAt
string<date-time>
metadata
object
sourceToDestination
enum<string>

Composite of source and destination instrument categories, inferred from each side. Replaces the older TransferType. The cash corridors (cryptoToCash, cashToCrypto) are derived from a cash-pickup destination or cash-in source respectively; the rest map straight from the internal corridor type.

Available options:
cryptoToCrypto,
cryptoToCash,
cryptoToFiatAccount,
cashToCrypto,
fiatAccountToCrypto