Skip to main content

SDK overview

The Cargo SDKs are thin, typed clients for the public API. They are generated from the same OpenAPI contract as the API Reference, so a method always maps to one endpoint.

LanguagePackageRequires
TypeScript@rappi_cargo/cargo-core-api-sdkNode.js 22+
Pythoncargo-core-api-sdkPython 3.10+

What you get​

  • Typed requests and responses. Autocomplete and compile-time checks on every field.
  • One error model. Every non-2xx response becomes a CargoApiError with the HTTP status and Cargo's machine-readable code; network failures become CargoNetworkError.
  • Environments built in. Pick a country with one option instead of managing base URLs.
  • Sensible defaults. 15 second timeout, user-token header handled for you.
  • Same shape in every language. Same clients, same method names (snake_case in Python).

Same call, both languages​

import { CargoClient } from "@rappi_cargo/cargo-core-api-sdk";

const client = new CargoClient({ apiKey: process.env.CARGO_API_KEY!, environment: "dev" });

const groups = await client.authorization.listPermissionGroups();

Clients​

Both SDKs expose five clients on the root object:

Client (TypeScript / Python)Covers
orderV3 / order_v3Validate, create, track, ready and cancel orders
pickingPoints / picking_pointsStores, nearby search, checkin codes
usersUsers of your account
authorizationPermission groups (roles)
rtCash-order returns

Versioning​

The SDKs follow semantic versioning and are versioned independently of each other and of the API. While they are on 0.x, a breaking change bumps the minor version and an additive change bumps the patch version. From 1.0.0, breaking changes bump the major version. Pin a version in your lockfile and read the changelog before upgrading.

Not covered by an SDK?​

The API is plain HTTPS and JSON. Anything an SDK does, you can do with any HTTP client. See the API Reference.