Skip to main content
Alguna publishes a client library for TypeScript, Python, Go and Rust, and the alguna command-line tool. Use one when you call the public API from code or from a terminal and do not want to write the HTTP calls yourself. All five are generated from the same versioned OpenAPI spec as this reference, so every endpoint has a method (or a command), and they behave the same way:
  • They send the Authorization and Alguna-Version headers. The API version defaults to the one the release was generated against; set it to pin the version you integrate against.
  • They send an Idempotency-Key on every write, yours or a generated one, and reuse it on each retry. See Idempotency.
  • They retry 408, 429, 502, 503 and 504, a 409 with Retry-After, and network failures, 2 times by default. They do not retry a 500. See Errors.
  • They raise a typed error for a failed response, with the HTTP status and the X-Request-Id.
The API key is a secret. Use the libraries on a server only. For a purchase flow in the browser, use Embedded Checkout (@alguna/checkout-sdk).

Libraries

Each repository’s README is the full reference for that library. When you report a problem with a call, include its X-Request-Id.

Versions

A library has two versions, and they change independently:
  • The package version is the release of the library. A new package version adds endpoints and types and fixes defects. Each release has a v<version> tag in its repository.
  • The API version is the date in the Alguna-Version header. Only the API version changes the request and response shapes. When you set it on the client, a newer package version still sends the date you set. See Versioning.

Sandbox

Every library and the CLI take a base URL. Set it to https://api.sandbox.alguna.io and use a sandbox API key to work against your sandbox. See Testing.