AsyncApiClient covers every SolvaPay SDK API operation. Its methods are generated from the same API spec as the TypeScript SDK’s types. ApiClient is its blocking twin, with the same methods.
Make a call
- Methods take keyword arguments only. Path and query parameters are snake_case (
external_ref,customer_ref). - A request body is a dict with the API’s camelCase keys, or the matching pydantic model, such as
models.CreateCustomerRequest(from solvapay import models). - Responses are pydantic models with snake_case attributes.
- Use the client as a context manager, or call
aclose()(close()onApiClient).
create_solvapay(), its client is solvapay.api.
Common operations
For every operation and its fields, see the API reference.
Create a customer
Record a usage event
@solvapay.payable() and paid MCP tools record usage for you. Record it yourself only for usage that happens outside them. See usage events for how meters bill.
Handle errors
Every error is aSolvaPayError. Branch on code and status, never on the message, which may change.
The client retries reads, and writes with an idempotency key, on
429, 502, 503, 504 and network errors (max_retries=2 by default). Other writes are sent once.
Next steps
- Webhooks: verify the events SolvaPay sends you.
- The TypeScript equivalent is purchase management.