Skip to main content

Base URL

https://api.cherp.dev/v1
Test mode is activated by using a pk_test_ API key — same URL, same code path, routed to testnets.

Authentication

All requests require an Authorization: Bearer <api_key> header.
Key formatEnvironment
pk_live_<32chars>Production — real funds, real chains
pk_test_<32chars>Test mode — testnets, no real funds
curl https://api.cherp.dev/v1/intents \
  -H "Authorization: Bearer pk_live_..."

Error format

All errors return a consistent envelope. The HTTP status code is the primary signal; the code field is machine-readable.
{
  "error": {
    "code": "intent.already_fulfilled",
    "message": "This payment intent has already been fulfilled.",
    "param": null,
    "details": {
      "intent_id": "pi_abc123",
      "current_state": "confirmed"
    }
  }
}
StatusMeaning
400Malformed request or validation error
401Invalid or missing API key
402Feature requires a higher plan tier
404Resource not found
409Conflict — wrong state for this operation
422Semantically invalid (e.g. token not on this chain)
503RPC upstream unavailable — includes retry_after

Idempotency

EndpointKeyBehavior
POST /v1/intentsCaller-supplied idempotencyKeySame key within 24h returns existing intent
POST /v1/intents/:id/buildIntent IDReturns same unsigned tx if state unchanged
POST /v1/intents/:id/submitTx signature/hashDuplicate broadcast is harmless; returns existing state
PATCH /v1/intents/:idupdatedAt timestampStale writes return 409