curl --request POST \
--url https://api.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps \
--header 'API-Key: <api-key>' \
--header 'API-Nonce: <api-key>' \
--header 'API-Sign: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"trade": {
"from": {
"symbol": "USD",
"type": "fiat",
"amount": "100.00"
},
"to": {
"symbol": "BTC",
"type": "crypto"
},
"fee": {
"bps": 150
}
},
"when": {
"base": {
"symbol": "BTC",
"type": "crypto"
},
"quote": {
"symbol": "USD",
"type": "fiat"
},
"rises_to": "50000"
}
}
'import requests
url = "https://api.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps"
payload = {
"trade": {
"from": {
"symbol": "USD",
"type": "fiat",
"amount": "100.00"
},
"to": {
"symbol": "BTC",
"type": "crypto"
},
"fee": { "bps": 150 }
},
"when": {
"base": {
"symbol": "BTC",
"type": "crypto"
},
"quote": {
"symbol": "USD",
"type": "fiat"
},
"rises_to": "50000"
}
}
headers = {
"API-Key": "<api-key>",
"API-Sign": "<api-key>",
"API-Nonce": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'API-Key': '<api-key>',
'API-Sign': '<api-key>',
'API-Nonce': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
trade: {
from: {symbol: 'USD', type: 'fiat', amount: '100.00'},
to: {symbol: 'BTC', type: 'crypto'},
fee: {bps: 150}
},
when: {
base: {symbol: 'BTC', type: 'crypto'},
quote: {symbol: 'USD', type: 'fiat'},
rises_to: '50000'
}
})
};
fetch('https://api.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps', 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.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps",
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([
'trade' => [
'from' => [
'symbol' => 'USD',
'type' => 'fiat',
'amount' => '100.00'
],
'to' => [
'symbol' => 'BTC',
'type' => 'crypto'
],
'fee' => [
'bps' => 150
]
],
'when' => [
'base' => [
'symbol' => 'BTC',
'type' => 'crypto'
],
'quote' => [
'symbol' => 'USD',
'type' => 'fiat'
],
'rises_to' => '50000'
]
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"API-Nonce: <api-key>",
"API-Sign: <api-key>",
"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.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps"
payload := strings.NewReader("{\n \"trade\": {\n \"from\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"fee\": {\n \"bps\": 150\n }\n },\n \"when\": {\n \"base\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"quote\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\"\n },\n \"rises_to\": \"50000\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("API-Sign", "<api-key>")
req.Header.Add("API-Nonce", "<api-key>")
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.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps")
.header("API-Key", "<api-key>")
.header("API-Sign", "<api-key>")
.header("API-Nonce", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"trade\": {\n \"from\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"fee\": {\n \"bps\": 150\n }\n },\n \"when\": {\n \"base\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"quote\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\"\n },\n \"rises_to\": \"50000\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["API-Sign"] = '<api-key>'
request["API-Nonce"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"trade\": {\n \"from\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"fee\": {\n \"bps\": 150\n }\n },\n \"when\": {\n \"base\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"quote\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\"\n },\n \"rises_to\": \"50000\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "ALCCIA-CUT6P-XCW6K7",
"status": "active",
"trade": {
"from": {
"symbol": "USD",
"type": "fiat",
"amount": "100.00"
},
"to": {
"symbol": "BTC",
"type": "crypto"
},
"fee": {
"bps": "150"
}
},
"when": {
"base": {
"symbol": "BTC",
"type": "crypto"
},
"quote": {
"symbol": "USD",
"type": "fiat"
},
"rises_to": "50000"
},
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 400,
"code": "bad_request",
"causes": [
{
"field": "amount",
"message": "Exactly one of from.amount or to.amount must be set, but neither was provided"
}
]
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 401,
"code": "unauthenticated"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 403,
"code": "forbidden"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 409,
"code": "price_trigger_swap_client_order_id_duplicate"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 412,
"code": "price_trigger_swap_target_price_already_available"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 429,
"code": "resource_exhausted"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 500,
"code": "internal"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 503,
"code": "unavailable"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 504,
"code": "deadline_exceeded"
}
}Create price-triggered swap
Creates a swap that submits a trade when its price condition is met.
The swap stays active until it completes, fails, or is canceled.
curl --request POST \
--url https://api.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps \
--header 'API-Key: <api-key>' \
--header 'API-Nonce: <api-key>' \
--header 'API-Sign: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"trade": {
"from": {
"symbol": "USD",
"type": "fiat",
"amount": "100.00"
},
"to": {
"symbol": "BTC",
"type": "crypto"
},
"fee": {
"bps": 150
}
},
"when": {
"base": {
"symbol": "BTC",
"type": "crypto"
},
"quote": {
"symbol": "USD",
"type": "fiat"
},
"rises_to": "50000"
}
}
'import requests
url = "https://api.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps"
payload = {
"trade": {
"from": {
"symbol": "USD",
"type": "fiat",
"amount": "100.00"
},
"to": {
"symbol": "BTC",
"type": "crypto"
},
"fee": { "bps": 150 }
},
"when": {
"base": {
"symbol": "BTC",
"type": "crypto"
},
"quote": {
"symbol": "USD",
"type": "fiat"
},
"rises_to": "50000"
}
}
headers = {
"API-Key": "<api-key>",
"API-Sign": "<api-key>",
"API-Nonce": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'API-Key': '<api-key>',
'API-Sign': '<api-key>',
'API-Nonce': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
trade: {
from: {symbol: 'USD', type: 'fiat', amount: '100.00'},
to: {symbol: 'BTC', type: 'crypto'},
fee: {bps: 150}
},
when: {
base: {symbol: 'BTC', type: 'crypto'},
quote: {symbol: 'USD', type: 'fiat'},
rises_to: '50000'
}
})
};
fetch('https://api.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps', 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.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps",
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([
'trade' => [
'from' => [
'symbol' => 'USD',
'type' => 'fiat',
'amount' => '100.00'
],
'to' => [
'symbol' => 'BTC',
'type' => 'crypto'
],
'fee' => [
'bps' => 150
]
],
'when' => [
'base' => [
'symbol' => 'BTC',
'type' => 'crypto'
],
'quote' => [
'symbol' => 'USD',
'type' => 'fiat'
],
'rises_to' => '50000'
]
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"API-Nonce: <api-key>",
"API-Sign: <api-key>",
"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.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps"
payload := strings.NewReader("{\n \"trade\": {\n \"from\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"fee\": {\n \"bps\": 150\n }\n },\n \"when\": {\n \"base\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"quote\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\"\n },\n \"rises_to\": \"50000\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("API-Sign", "<api-key>")
req.Header.Add("API-Nonce", "<api-key>")
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.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps")
.header("API-Key", "<api-key>")
.header("API-Sign", "<api-key>")
.header("API-Nonce", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"trade\": {\n \"from\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"fee\": {\n \"bps\": 150\n }\n },\n \"when\": {\n \"base\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"quote\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\"\n },\n \"rises_to\": \"50000\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.services.payward.com/v1/accounts/{account_id}/price-trigger-swaps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["API-Sign"] = '<api-key>'
request["API-Nonce"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"trade\": {\n \"from\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"fee\": {\n \"bps\": 150\n }\n },\n \"when\": {\n \"base\": {\n \"symbol\": \"BTC\",\n \"type\": \"crypto\"\n },\n \"quote\": {\n \"symbol\": \"USD\",\n \"type\": \"fiat\"\n },\n \"rises_to\": \"50000\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "ALCCIA-CUT6P-XCW6K7",
"status": "active",
"trade": {
"from": {
"symbol": "USD",
"type": "fiat",
"amount": "100.00"
},
"to": {
"symbol": "BTC",
"type": "crypto"
},
"fee": {
"bps": "150"
}
},
"when": {
"base": {
"symbol": "BTC",
"type": "crypto"
},
"quote": {
"symbol": "USD",
"type": "fiat"
},
"rises_to": "50000"
},
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 400,
"code": "bad_request",
"causes": [
{
"field": "amount",
"message": "Exactly one of from.amount or to.amount must be set, but neither was provided"
}
]
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 401,
"code": "unauthenticated"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 403,
"code": "forbidden"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 409,
"code": "price_trigger_swap_client_order_id_duplicate"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 412,
"code": "price_trigger_swap_target_price_already_available"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 429,
"code": "resource_exhausted"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 500,
"code": "internal"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 503,
"code": "unavailable"
}
}{
"error": {
"type": "price_trigger_swap_error",
"instance": "5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b",
"status": 504,
"code": "deadline_exceeded"
}
}Authorizations
Your public API key. Identifies the partner making the request.
HMAC signature over the request, computed with your private key.
Monotonically increasing nonce included in the request signature.
Path Parameters
Globally unique public identifier for an account.
14 - 42Body
Trade to submit when the condition is met. Set amount on exactly one of from or to; the other side is calculated when the trade executes.
Show child attributes
Show child attributes
Price condition to monitor before executing a price-triggered swap. Set exactly one of drops_to or rises_to.
- Drops to
- Rises to
Show child attributes
Show child attributes
A client order identifier which uniquely identifies a price trigger swap. Echoed back on the price-triggered swap.
1 - 64^[\x20-\x7E]+$Response
A swap that submits a trade when its price condition is met.
Show child attributes
Show child attributes