Skip to Content

Integrate with SDKs and AI tools

Use the official TypeScript, Python and C# SDKs, and give your AI coding agent accurate knowledge of the Marketplace APIs.

The official SDKs wrap every Marketplace API in a typed client. They get and cache OAuth 2.0 access tokens for you, send Authorization: Bearer on each call, retry transient failures and return typed models, so you write business logic instead of HTTP plumbing.

Install an SDK

LanguagePackageInstall
TypeScript / JavaScriptwm-v-4-apis-sdk on npmnpm install wm-v-4-apis-sdk
Pythonwm-v-4-apis-sdk on PyPIpip install wm-v-4-apis-sdk
C# / .NETWmV4ApisSDK on NuGetdotnet add package WmV4ApisSDK

Each SDK covers all 184 operations. See SDKs for the full documentation of each one.

Create a client and list orders

Create one client when your app starts and reuse it. The client caches the access token and renews it before it expires.

The example below uses your Client ID and Client Secret with the client credentials grant, then retrieves orders with the status Created.

import { OrderStatus1, ServerEnvironment, WalmartApIsClient } from "wm-v-4-apis-sdk";

const client = new WalmartApIsClient({
  serverEnvironment: ServerEnvironment.Production,
  walletAuth: {
    clientId: process.env.WALMART_CLIENT_ID!,
    clientSecret: process.env.WALMART_CLIENT_SECRET!,
  },
});

const response = await client.orders.getOrders({
  orderStatuses: [OrderStatus1.Created],
  pageSize: 50,
});

for (const order of response.payload?.orders ?? []) {
  console.log(order.purchaseOrderId, order.orderStatus);
}

To get the next page, pass payload.nextToken from the response as nextToken (next_token in Python, NextToken in C#).

Choose the environment

Each SDK targets production by default. Select sandbox with one option:

LanguageProductionSandbox
TypeScriptserverEnvironment: ServerEnvironment.ProductionserverEnvironment: ServerEnvironment.Environment2
Pythonenvironment="production"environment="environment2"
C#Environment = ServerEnvironment.ProductionEnvironment = ServerEnvironment.Environment2

The SDK then sends every request to the matching base URL. See Environments and sandbox.

Configure authorization

Every Marketplace API operation in the SDKs authenticates with the client credentials you set on the walletAuth option (wallet_auth in Python, WalletAuth in C#). Set it to your Client ID and Client Secret, as in the example above. The SDK requests the token, sends it as Authorization: Bearer and requests a new one when it expires.

The SDKs also include the Create an access token operation itself, authenticated with HTTP Basic through the basicClientAuth option (basic_client_auth, BasicClientAuth), for when you want to manage tokens yourself.

Keep your Client Secret out of source code. Read it from an environment variable or a secrets manager. The C# SDK can also read credentials it isn't given from environment variables such as WALMART_AP_IS_WALLET_AUTH_CLIENT_ID and WALMART_AP_IS_WALLET_AUTH_CLIENT_SECRET.

Built-in reliability

  • Token caching. OAuth 2.0 tokens are fetched on first use, cached and renewed before they expire.
  • Retries. 408, 429, 500, 502, 503 and 504 responses to GET, HEAD, PUT and OPTIONS requests are retried up to three times with exponential backoff and jitter. You can change or turn off this policy on the client or per call.
  • Typed errors. API errors carry the HTTP status and the parsed errors body, so you can act on each code. See Rate limiting and errors.

Build with AI coding agents

The Context Plugin gives AI coding agents such as Claude Code, Cursor and GitHub Copilot accurate, up-to-date knowledge of the Marketplace APIs and the official SDKs. With the plugin installed, your agent:

  • Writes code against the real SDK surface: the correct client setup, method names, request fields and models.
  • Follows the right authorization flow and environment for your integration.
  • Handles errors, pagination and retries the way the SDK expects.

That means fewer hallucinated endpoints and field names, and less time fixing the code your agent writes.

On this page