- US: For the US and its supported territories, with crypto perpetuals such as BTC and ETH.
- International/EEA: For other supported countries, with perpetuals on crypto, xStocks, equities, indices and commodities, such as BTC, AAPLx, AMD, US100 and gold.
Prerequisites
- Payward Services API credentials and permission to access the user and account. See Authentication.
- A user with an account enabled for derivatives trading.
- Enough collateral in the account’s derivatives balance. See deposits and withdrawals and derivatives transfers.
Get order and List orders require both
query-open-trades and query-closed-trades, even when listing only open orders.
Enable query-ledger as well if you use Portfolio transaction history to track transfers or read settled funding payments. A cancellation-only key can use close-trades instead of modify-trades.
Regional differences
Funding payments are exchanged between long and short positions, separately from trading fees. Positive rates mean longs pay shorts; negative rates mean shorts pay longs. Both offerings follow the workflow below. The main differences are:Workflow
- Discover markets.
- Enable and fund the user.
- Place an order.
- Track orders and fills.
- Monitor positions and margin.
Authentication setup
Authenticated endpoints require an HMAC-SHA512 request signature in theAPI-Sign header and the signing time in the API-Timestamp header. The helpers below compute both. The examples call signed_headers (signedHeaders in JavaScript) with the request’s method, its path including any query string, and the exact body string they send. See the Authentication guide for the full algorithm.
The examples read the API base URL from the PWS_BASE_URL environment variable, and your credentials from PWS_API_KEY and PWS_API_SECRET. Set PWS_BASE_URL to the sandbox or production base URL, listed in Environments.
PWS_ACCOUNT_ID to the user’s account ID. In Step 4, set PWS_ORDER_ID to the data.id returned by Create order.
The cURL examples read the signature headers from PWS_API_TIMESTAMP and PWS_API_SIGN. Compute both for each request, as Authentication describes.
Step 1: discover markets
Use List instruments to build the market browser. Read the instrument’s contract size, quantity precision, and tick size before formatting quantities and prices. Itsbase_asset is the ticker of the underlying asset: for example, AAPLx for PF_AAPLXUSD, a perpetual on the AAPLx xStock, and AMD for PF_AMDUSD, a perpetual on AMD stock.
Use Get ticker, Get order book, and Get OHLC history for the selected market.
These routes require API authentication, even when your application shows markets before the user signs in. Each also requires country, which selects the offering. See each endpoint’s reference for its other filters.
The example fetches the first page. For a complete instrument list, pass each response’s next_page_token as page_token, keeping the filters and sort order unchanged. Continue until the token is absent, even if a page is empty.
Step 2: enable and fund the user
Completing identity verification alone does not confirm derivatives approval. Once approved, use List user instruments or Get user instrument to check the user’s available markets. Selecting a country-scoped catalog does not change that user’s eligibility. Use Create derivatives transfer to move funds from spot into the account’s derivatives balance:futures in the transfer request and assets[].balances.derivatives in Get portfolio.
For the US offering, derivatives transfers support USD only.For International/EEA, see Kraken’s supported collateral currencies, haircuts and conversion fees. Kraken’s funding guide lists transfer minimums.
accepted means processing has started. For the requested asset, check assets[].balances.derivatives.total in Get portfolio to confirm the destination balance. To check funds available to move back to spot, use assets[].balances.derivatives.available.
Derivatives transfers are not idempotent: retrying can create a second transfer. If the outcome is unclear, reconcile it as described in Track the transfer before trying again. That section also says when to contact Payward Services support.
Optional: set leverage for International/EEA users
For International/EEA users, Set leverage settings and Get leverage settings manage isolated-margin overrides. Read the user’s leverage limit from Get user instrument before offering an override. A change affects existing positions and open orders and can be rejected by margin or risk checks.Step 3: place an order
Use Create order with the selected account. For example, buy two US perpetual contracts with a limit price of USD 80,000 per BTC. With acontract_size of 0.01, two contracts represent 0.02 BTC.
filled_quantity. A successful Create order response does not guarantee the order stays open. See Track orders and fills for ongoing updates.
For International/EEA orders, you can supply client_order_id, an optional reference you assign to correlate the order and its fills. Use a lowercase, hyphenated UUID. Reusing an ID held by an active order or pending trigger in the same account returns 409. Once the original order or trigger is no longer active, reusing the ID can create another order. This field is not an idempotency key; the retry guidance below still applies. US orders don’t support client_order_id yet and return 400 if you send it, so match their fills to the order by order_id.
List orders returns only open orders by default. If an order’s outcome is uncertain, check state=open first, then state=closed, following pagination for both.
If the response is HTTP 503 with an error.code of order_request_not_submitted, or HTTP 504 with request_expired_before_submission, the order was not submitted, so retry with backoff. Do not automatically resubmit after HTTP 504 with order_outcome_unknown, or after a timeout without a definitive result. If the outcome remains unclear, contact Payward Services support with the X-Trace-Id response header. See the 503 and 504 responses of Create order.
Step 4: track orders and fills
Subscribe toderivatives.order_updated for order placement, changes, fills, cancellations, expiry and rejection, and derivatives.trade_executed for individual fills, including liquidations. See each event’s API reference for coverage and Receiving webhooks for setup and delivery handling.
Derivatives webhooks are currently available only in Sandbox. Alternatively, poll Get order; stop once the order’s
status is closed, cancelled, or expired.state=closed for closed orders. Pass order_id to List trades to retrieve executions for a specific order. Use each order’s filled_quantity to track execution; an order status of closed does not guarantee a full fill. For International/EEA requests, you can also filter both lists by the submitted client_order_id. This filter is case-sensitive. The List trades example below fetches only the first page. For complete order and trade listings, pass each response’s next_page_token as page_token, keeping the account and filters unchanged, and continue until the token is absent.
Get order
List closed orders
List trades
Step 5: monitor positions and margin
Use List open positions for exposure and position PnL. Use Get portfolio for collateral, account-level PnL, and margin requirements and capacity. Refresh both as orders fill and market prices change. Use List funding history to read settled funding payments. These are separate from trading PnL and execution fees.List open positions
Get portfolio
Error handling
Read the HTTP status,error.code, and any error.causes. Use codes for application decisions; messages can change.
For other order rejections, follow the Create order reference before resubmitting.