This document provides the technical specification for webhooks triggered by the zerohash Trade Strategy product lifecycle. Platforms must implement these webhooks to track asynchronous operations, individual market executions, and participant account statuses.
Technical Context & Flow
Trade Strategy operations are asynchronous. Rather than polling Zero Hash APIs for status updates, platforms must listen for three distinct webhook events to manage internal state transitions.
The Lifecycle Hierarchy
- Operation
trade_strategy.operation.status_changed)- The top-level parent event. It tracks the global state of a strategy intent
enrollment,top_up, orpartial_sell). This event fires on every state transition from initial validation to final settlement or failure.
- The top-level parent event. It tracks the global state of a strategy intent
- Execution
trade_strategy.execution.status_changed)- Triggered by the operation. This tracks the market-level instructions (buys/sells) for a single participant within that parent operation. It exposes explicit fill details
price,quantity,total_notional) upon settlement.
- Triggered by the operation. This tracks the market-level instructions (buys/sells) for a single participant within that parent operation. It exposes explicit fill details
- Trader
trade_strategy.trader.created)- Triggered only upon a successful
enrollmentoperation. This fires exactly once to confirm that the participant's dedicated ledger account is active and indicates whether auto-rebalancing is enabled.
- Triggered only upon a successful
Integration Requirements
1. Payload Identification
Check the HTTP header on every incoming request to determine the payload type to process:
- Header:
x-zh-hook-payload-type - Expected Values:
trade_strategy.operation.status_changedtrade_strategy.execution.status_changedtrade_strategy.trader.created
2. Security & Verification
To protect against spoofing and tampering, you must verify the request signature before processing the payload. Refer to the implementation guidelines in Webhook Security.
3. Subscription Granularity
Each webhook type can be opted in independently. For complete end-to-end sync, subscribing to all three types is highly recommended.
Reference Sections
Review the sections below for explicit parameter mappings, status code dictionaries, failure reasons, and structural JSON payload examples: