Skip to main content

Partner API v2 Migration Guide

Overview

Partner API v2 replaces the REST v1 endpoints with a structured, typed REST API built on TSOA. All swap-related functionality has been migrated. Dashboard/authentication endpoints remain on v1 GraphQL.

Base URL

All v2 endpoints are available under /v2/ on the Partner API.

Authentication

Authentication remains the same:
  • Full API access: Authorization: <partnerId>:<apiSecret> header
  • Public/frontend access: partner-id: <partnerId> header (read-only endpoints)

Breaking Changes

1. Token & Chain IDs are now MongoDB ObjectIds

v1 used shortNames/symbols (e.g., "BTC", "ETH"). v2 uses MongoDB ObjectId strings for token and chain identifiers. Before (v1):
After (v2):
Use GET /v2/tokens to look up token ObjectIds by symbol, name, or address.

2. Quote-Driven Exchange Flow

v1 accepted from, to, and amount directly in the exchange request. v2 requires a quoteId obtained from the quotes endpoint. Before (v1):
After (v2):

3. MinMax Response Structure

v1 returned a flat [min, max] array. v2 returns a structured object with cex, dex, and private fields. Before (v1):
After (v2):

4. Order Status via Path Parameter

v1 used a query parameter. v2 uses a path parameter. Before (v1):
After (v2):

5. DEX Endpoints Use quoteId

v1 DEX endpoints (approve, allowance, chainSignatures) accepted individual route parameters. v2 uses quoteId.

6. Order quote Field Excluded

The quote field is no longer included in order responses. Use the separate /v2/quotes endpoint.

7. Paginated Responses

Token and chain listing endpoints now return paginated results with total and totalPages.

Endpoint Mapping

New Endpoints

Response Headers

All v2 responses include:
  • x-request-id - Unique request ID for debugging and support

Error Format

v2 uses a consistent error response format:

Rate Limiting

Rate limits are enforced per-partner based on tier (FREE/PRO). Limits apply to:
  • Quotes: per-minute and per-hour
  • Exchanges: per-hour
  • Read endpoints (tokens, chains, swaps, orders, stats): higher limits

Migration Checklist

  • Look up token ObjectIds via GET /v2/tokens?symbol=BTC
  • Update exchange flow to quote-driven (get quote first, then exchange with quoteId)
  • Update order status calls to use path parameter
  • Update DEX approval/allowance calls to use quoteId
  • Parse new structured minmax response format
  • Handle paginated responses for token/chain listings
  • Update error handling for new error format
  • Test with GET /v2/health to verify connectivity