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"
}
}Orchestration Rules
Create Orchestration Rule
Creates a persistent orchestration rule that automatically triggers orchestrations when matching deposits are received.
The rule will:
- Generate deposit instructions associated with the rule.
- Continuously monitor incoming deposits to those instructions.
- Automatically execute orchestrations to the specified destination.
Supported Sources:
- Crypto deposit
- Fiat deposit
Supported Destinations:
- Crypto address on a supported network
- Bank account
- Profile ID
Error conditions:
- Already Exists: Returned if a rule with the same ref_id already exists.
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
Paxos APIs use OAuth 2 with the client credentials grant flow.
Token URLs:
- Production: https://oauth.paxos.com/oauth2/token
- Sandbox: https://oauth.sandbox.paxos.com/oauth2/token
Learn more in the API credentials guide →
Body
application/json
Client-provided unique reference ID for the rule.
Profile ID of the account owner.
Asset being converted from.
Valid values: USDG, PYUSD, USDP, USDC, USD
Asset being converted to.
Valid values: USDG, PYUSD, USDP, USDC, USD
Show child attributes
Show child attributes
Optional human-readable nickname for the rule.
Identity ID of the account owner.
Account ID where the rule applies.
Show child attributes
Show child attributes
Response
200 - application/json
A successful response.
Show child attributes
Show child attributes
Was this page helpful?
⌘I