Create price trigger swap
Submits a new price trigger swap. The swap remains in active status until its when condition is met or it is cancelled.
When the condition fires, the configured trade is executed. On successful execution the swap transitions to completed and a price_trigger_swap.executed webhook is delivered; the realized trade.fees and trade.rate are then populated on the swap. If the trade fails, a price_trigger_swap.execution_failed webhook is delivered and the swap may be retried; once retries are exhausted the swap is moved to cancelled with reason: "system".
Use POST /v1/accounts/{account_id}/price-trigger-swaps/{price_trigger_swap_id}/cancel to cancel an active swap, and GET /v1/accounts/{account_id}/price-trigger-swaps/{price_trigger_swap_id} to poll for status.
Authorizations
Your public API key. Identifies the partner making the request.
Monotonically increasing nonce included in the request signature.
HMAC signature over the request, computed with your private key.
Headers
Client-generated UUIDv4 for safe retries. Sent as the Idempotency-Key HTTP header. Replayed responses include the Idempotent-Replayed: true header.
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"550e8400-e29b-41d4-a716-446655440000"
Path Parameters
ID of the account the request applies to. This refers to one of the accounts held by the user the request is acting on behalf of (typically the user's main account, but any of the user's accounts is accepted). Routes the request to that specific account container. Canonical identifier for an account in the Payward public API.
14 - 42Body
Request to create a new price trigger swap.
The trade to execute when the order's when condition fires.
from and to use the same AssetAmount shape as a swap quote — a price trigger swap is, in effect, a swap quote that waits for a price condition before executing. Exactly one of from.amount or to.amount must be provided to indicate which side of the trade is fixed; the other side's amount is determined at execution time. Setting both amounts or omitting both is rejected with a 400 Bad Request.
fee is the partner's configured fee, applied on top of the underlying execution price when the trade fires. Request-only — not echoed in response payloads.
The condition under which the order's trade fires.
Watches the price of the base/quote asset pair and fires when the live price reaches the threshold. Specify exactly one of drops_to or rises_to:
drops_to: fires when the price falls to or below the value (e.g. "buy on dip").rises_to: fires when the price rises to or above the value (e.g. "take profit").
- Option 1
- Option 2
Optional client-supplied external reference for the swap. Echoed back on reads and webhook events for client-side correlation. Not interpreted by Payward.
1 - 128Response
Swap created. The Location header points at the new swap resource. The response body returns only the new swap's id; fetch GET /v1/accounts/{account_id}/price-trigger-swaps/{price_trigger_swap_id} for the full resource.