Skip to main content
POST
/
conversion
/
stablecoins
Create Stablecoin Conversion
curl --request POST \
  --url https://api.paxos.com/v2/conversion/stablecoins \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "amount'": "3",
  "metadata": {
    "skey": "svalue",
    "custom_key": "custom_value"
  },
  "profile_id": "b821ff88-fdb4-49ba-b30f-99c40f01fcfc",
  "ref_id": "refid-24d25de7f5bd47ab978cbbd428b74199",
  "source_asset": "USD",
  "target_asset": "USDP"
}
EOF
import requests

url = "https://api.paxos.com/v2/conversion/stablecoins"

payload = {
"amount'": "3",
"metadata": {
"skey": "svalue",
"custom_key": "custom_value"
},
"profile_id": "b821ff88-fdb4-49ba-b30f-99c40f01fcfc",
"ref_id": "refid-24d25de7f5bd47ab978cbbd428b74199",
"source_asset": "USD",
"target_asset": "USDP"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
'amount\'': '3',
metadata: {skey: 'svalue', custom_key: 'custom_value'},
profile_id: 'b821ff88-fdb4-49ba-b30f-99c40f01fcfc',
ref_id: 'refid-24d25de7f5bd47ab978cbbd428b74199',
source_asset: 'USD',
target_asset: 'USDP'
})
};

fetch('https://api.paxos.com/v2/conversion/stablecoins', 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://api.paxos.com/v2/conversion/stablecoins",
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([
'amount\'' => '3',
'metadata' => [
'skey' => 'svalue',
'custom_key' => 'custom_value'
],
'profile_id' => 'b821ff88-fdb4-49ba-b30f-99c40f01fcfc',
'ref_id' => 'refid-24d25de7f5bd47ab978cbbd428b74199',
'source_asset' => 'USD',
'target_asset' => 'USDP'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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://api.paxos.com/v2/conversion/stablecoins"

payload := strings.NewReader("{\n \"amount'\": \"3\",\n \"metadata\": {\n \"skey\": \"svalue\",\n \"custom_key\": \"custom_value\"\n },\n \"profile_id\": \"b821ff88-fdb4-49ba-b30f-99c40f01fcfc\",\n \"ref_id\": \"refid-24d25de7f5bd47ab978cbbd428b74199\",\n \"source_asset\": \"USD\",\n \"target_asset\": \"USDP\"\n}")

req, _ := http.NewRequest("POST", url, payload)

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://api.paxos.com/v2/conversion/stablecoins")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount'\": \"3\",\n \"metadata\": {\n \"skey\": \"svalue\",\n \"custom_key\": \"custom_value\"\n },\n \"profile_id\": \"b821ff88-fdb4-49ba-b30f-99c40f01fcfc\",\n \"ref_id\": \"refid-24d25de7f5bd47ab978cbbd428b74199\",\n \"source_asset\": \"USD\",\n \"target_asset\": \"USDP\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.paxos.com/v2/conversion/stablecoins")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount'\": \"3\",\n \"metadata\": {\n \"skey\": \"svalue\",\n \"custom_key\": \"custom_value\"\n },\n \"profile_id\": \"b821ff88-fdb4-49ba-b30f-99c40f01fcfc\",\n \"ref_id\": \"refid-24d25de7f5bd47ab978cbbd428b74199\",\n \"source_asset\": \"USD\",\n \"target_asset\": \"USDP\"\n}"

response = http.request(request)
puts response.read_body
{
  "account_id'": "00000000-0000-0000-0000-000000000000",
  "amount'": "3",
  "created_at": "2023-10-19T15:37:18.929305155Z",
  "id": "8dbce0e0-510f-4edc-9249-15f8c6214569",
  "identity_id": "00000000-0000-0000-0000-000000000000",
  "metadata": {
    "skey": "svalue",
    "custom_key": "custom_value"
  },
  "profile_id": "b821ff88-fdb4-49ba-b30f-99c40f01fcfc",
  "ref_id": "refid-24d25de7f5bd47ab978cbbd428b74199",
  "source_asset": "USD",
  "status": "CREATED",
  "target_asset": "USDP",
  "updated_at": "2023-10-19T15:37:18.990343Z"
}
The Orchestrations API replaces this endpoint.New customers should use Create Orchestration instead. Existing customers should follow the migration guide.
OAuth Scope
conversion:write_conversion_stablecoin

Authorizations

Authorization
string
header
required

Paxos APIs use OAuth 2 with the client credentials grant flow.

Token URLs:

Learn more in the API credentials guide →

Body

application/json
profile_id
string
required

The Profile associated with a conversion.

amount
string
required

Asset amount to convert. Details.

Pattern: ^[0-9]*\.?[0-9]+$
source_asset
string
required

The asset to convert from. Details.

target_asset
string
required

The asset to convert to. Details.

ref_id
string

Client provided, unique Reference ID for lookup and replay protection.

identity_id
string

The Identity ID associated with the user requesting the conversion. Required only for customers with 3rd-Party integrations.

account_id
string

The Account ID associated with the user requesting the conversion. Required only for customers with 3rd-Party integrations.

metadata
object

Optional client-specified stored metadata.

recipient_profile_id
string

For directed settlement, the receiving side profile_id.

Response

A successful response.

id
string

System provided UUID for the conversion is provided in the Create Stablecoin Conversion response.

Required parameter for the Get Stablecoin Conversion request.

profile_id
string

The Profile associated with a conversion. Required in the Create Stablecoin Conversion request.

amount
string<decimal>

Asset amount to convert. Details.

source_asset
string

The asset to convert from. Details.

target_asset
string

The asset to convert to. Details.

status
string

The current status of the conversion. Details.

ref_id
string

Client provided, unique Reference ID included the Create Stablecoin Conversion request.

identity_id
string

The Identity ID associated with the user requesting the conversion. Required only for customers with 3rd-Party integrations.

account_id
string

The Account ID associated with the user requesting the conversion. Required only for customers with 3rd-Party integrations.

created_at
string<date-time>

The time at which the conversion was requested. See RFC3339 format, like 2006-01-02T15:04:05Z.

updated_at
string<date-time>

The time at which the conversion was last updated. RFC3339 format, like 2006-01-02T15:04:05Z.

settled_at
string<date-time>

The time at which the conversion was settled. Details. RFC3339 format, like 2006-01-02T15:04:05Z.

cancelled_at
string<date-time>

The time at which the conversion has been cancelled. Details. RFC3339 format, like 2006-01-02T15:04:05Z.

metadata
object

Optional client-specified stored metadata.

recipient_profile_id
string

For directed settlement, the receiving side profile_id.