Reference · v1
Partner API reference
Search endpoints, inspect example payloads and copy cURL, JavaScript or Python requests. The authoritative machine-readable contract is available from /api/v1/openapi.
11 endpoints · Base URL: https://YOUR_TRUSTLAYER_HOST/api/v1
/healthHealth check
Check whether the Partner API route is reachable. Does not prove database or settlement health.
curl -X GET 'https://YOUR_TRUSTLAYER_HOST/api/v1/health' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json'{"ok":true}/openapiOpenAPI document
Fetch the OpenAPI 3.0 schema for the current API version.
curl -X GET 'https://YOUR_TRUSTLAYER_HOST/api/v1/openapi' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json'{"openapi":"3.0.3"}/dealsList deals
Search and filter partner deals with cursor pagination.
curl -X GET 'https://YOUR_TRUSTLAYER_HOST/api/v1/deals' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: order-123-attempt-1'{"data":[],"next_cursor":null,"has_more":false,"environment":"test"}/dealsCreate deal
Create a crypto escrow agreement. Use an Idempotency-Key for safe retries.
curl -X POST 'https://YOUR_TRUSTLAYER_HOST/api/v1/deals' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: order-123-attempt-1' \
--data '{"external_id":"order_123","title":"Design project","amount":"25.00","rail":"crypto","asset_code":"USDC","buyer":{"external_id":"buyer_1"},"seller":{"external_id":"seller_1"}}'{"data":{"id":"<deal-uuid>","status":"draft"},"request_id":"<request-id>"}/deals/{id}Retrieve deal
Retrieve a deal by TrustLayer UUID or partner external ID within the API key environment.
curl -X GET 'https://YOUR_TRUSTLAYER_HOST/api/v1/deals/<deal-id>' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json'{"data":{"id":"<deal-uuid>","status":"draft"},"request_id":"<request-id>"}/deals/{id}/finalizeFinalize agreement
Finalize a draft agreement and record its lifecycle event. Requires the separate deals:finalize scope.
curl -X POST 'https://YOUR_TRUSTLAYER_HOST/api/v1/deals/<deal-id>/finalize' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: order-123-attempt-1'{"data":{"id":"<deal-uuid>","status":"awaiting_payment"}}/crypto/sessionsCreate crypto session
Create a time-limited session URL. Deposit requires funding:initiate, release requires settlement:execute, and cancellation requires transactions:cancel. API permission does not grant signing authority.
curl -X POST 'https://YOUR_TRUSTLAYER_HOST/api/v1/crypto/sessions' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: order-123-attempt-1' \
--data '{"deal_id":"<deal-uuid>","action":"deposit","milestone_index":0}'{"data":{"url":"https://<trustlayer-host>/...","expires_at":"<iso-time>"}}/users/linkLink external user
Link a partner-owned external user ID to a TrustLayer user ID.
curl -X POST 'https://YOUR_TRUSTLAYER_HOST/api/v1/users/link' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json' \
--data '{"external_user_id":"buyer_1","trustlayer_user_id":"<user-uuid>"}'{"data":{"linked":true},"request_id":"<request-id>"}/eventsPoll events
Poll partner events using a cursor. Events are scoped to the key environment.
curl -X GET 'https://YOUR_TRUSTLAYER_HOST/api/v1/events' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json'{"data":[],"next_cursor":null,"environment":"test"}/webhooksList webhook endpoints
List endpoints for the API key environment. Signing secrets are never returned.
curl -X GET 'https://YOUR_TRUSTLAYER_HOST/api/v1/webhooks' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json'{"data":[],"request_id":"<request-id>"}/webhooksRegister webhook endpoint
Register an HTTPS endpoint. Save the returned signing_secret immediately; it is shown only once.
curl -X POST 'https://YOUR_TRUSTLAYER_HOST/api/v1/webhooks' \
-H 'Authorization: Bearer $TRUSTLAYER_API_KEY' \
-H 'Content-Type: application/json' \
--data '{"url":"https://your-service.example/webhooks/trustlayer","description":"Order updates"}'{"data":{"id":"<endpoint-id>","signing_secret":"<shown-once>"}}Examples use placeholders and illustrative responses. Keep API keys server-side. Use an Idempotency-Key for write requests, verify webhook signatures against the raw body, and treat settlement as confirmed only by the underlying settlement record/transaction.