Skip to main content
POST
/
orchestration
/
rules
Create Orchestration Rule
curl --request POST \
  --url https://api.paxos.com/v2/orchestration/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ref_id": "my-rule-001",
  "nickname": "USDC to USDG conversion",
  "profile_id": "e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8",
  "source_asset": "USDC",
  "destination_asset": "USDG",
  "source": {
    "crypto": {
      "network": "ETHEREUM"
    }
  },
  "destination": {
    "profile": {
      "profile_id": "e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8"
    }
  }
}
'
import requests

url = "https://api.paxos.com/v2/orchestration/rules"

payload = {
"ref_id": "my-rule-001",
"nickname": "USDC to USDG conversion",
"profile_id": "e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8",
"source_asset": "USDC",
"destination_asset": "USDG",
"source": { "crypto": { "network": "ETHEREUM" } },
"destination": { "profile": { "profile_id": "e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8" } }
}
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({
ref_id: 'my-rule-001',
nickname: 'USDC to USDG conversion',
profile_id: 'e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8',
source_asset: 'USDC',
destination_asset: 'USDG',
source: {crypto: {network: 'ETHEREUM'}},
destination: {profile: {profile_id: 'e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8'}}
})
};

fetch('https://api.paxos.com/v2/orchestration/rules', 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/orchestration/rules",
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([
'ref_id' => 'my-rule-001',
'nickname' => 'USDC to USDG conversion',
'profile_id' => 'e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8',
'source_asset' => 'USDC',
'destination_asset' => 'USDG',
'source' => [
'crypto' => [
'network' => 'ETHEREUM'
]
],
'destination' => [
'profile' => [
'profile_id' => 'e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8'
]
]
]),
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/orchestration/rules"

payload := strings.NewReader("{\n \"ref_id\": \"my-rule-001\",\n \"nickname\": \"USDC to USDG conversion\",\n \"profile_id\": \"e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8\",\n \"source_asset\": \"USDC\",\n \"destination_asset\": \"USDG\",\n \"source\": {\n \"crypto\": {\n \"network\": \"ETHEREUM\"\n }\n },\n \"destination\": {\n \"profile\": {\n \"profile_id\": \"e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8\"\n }\n }\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/orchestration/rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ref_id\": \"my-rule-001\",\n \"nickname\": \"USDC to USDG conversion\",\n \"profile_id\": \"e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8\",\n \"source_asset\": \"USDC\",\n \"destination_asset\": \"USDG\",\n \"source\": {\n \"crypto\": {\n \"network\": \"ETHEREUM\"\n }\n },\n \"destination\": {\n \"profile\": {\n \"profile_id\": \"e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8\"\n }\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.paxos.com/v2/orchestration/rules")

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 \"ref_id\": \"my-rule-001\",\n \"nickname\": \"USDC to USDG conversion\",\n \"profile_id\": \"e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8\",\n \"source_asset\": \"USDC\",\n \"destination_asset\": \"USDG\",\n \"source\": {\n \"crypto\": {\n \"network\": \"ETHEREUM\"\n }\n },\n \"destination\": {\n \"profile\": {\n \"profile_id\": \"e8ea8b1c-4e8d-4c59-9e7a-c985194ba2e8\"\n }\n }\n}"

response = http.request(request)
puts response.read_body
{
  "rule": {
    "id": "<string>",
    "ref_id": "<string>",
    "nickname": "<string>",
    "profile_id": "<string>",
    "identity_id": "<string>",
    "account_id": "<string>",
    "source_asset": "<string>",
    "destination_asset": "<string>",
    "source": {
      "crypto": {
        "address_id": "<string>",
        "address": "<string>",
        "network": "<string>"
      },
      "fiat": {
        "deposit_instructions_id": "<string>",
        "network": "<string>",
        "account_type": "<string>",
        "memo_id": "<string>"
      },
      "profile": {
        "profile_id": "<string>"
      }
    },
    "destination": {
      "crypto": {
        "address": "<string>",
        "network": "<string>"
      },
      "fiat": {
        "fiat_account_id": "<string>",
        "memo": "<string>"
      },
      "profile": {
        "profile_id": "<string>"
      }
    },
    "created_at": "2023-11-07T05:31:56Z"
  }
}
OAuth Scope
orchestration:write_orchestration_rule

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
ref_id
string
required

Client-provided unique reference ID for the rule.

profile_id
string
required

Profile ID of the account owner.

source_asset
string
required

Asset being converted from.

Valid values: USDG, PYUSD, USDP, USDC, USD

destination_asset
string
required

Asset being converted to.

Valid values: USDG, PYUSD, USDP, USDC, USD

source
object
required
nickname
string

Optional human-readable nickname for the rule.

identity_id
string

Identity ID of the account owner.

account_id
string

Account ID where the rule applies.

destination
object

Response

200 - application/json

A successful response.

rule
object