Aller au contenu principal

SDKs

Copy a source client for the language you already use. Each client calls the Marketplace APIs a third-party provider uses for a non-restaurant storefront. These are not published packages. npm install, pip install, Maven Central, RubyGems, and go get will not resolve them.

Marketplace API access is limited. Apply from the Developer Portal before these calls will succeed against your sandbox provider.

What the clients call​

AreaCalls
CatalogCreate and update business-scoped items
InventoryAdd and update store price and availability, and update business-wide pricing
Store hoursUpdate open hours, special hours, and fulfillment capacity
JobsTrigger an inventory pull for one store
PromotionsCreate and update an item promotion
OnboardingCreate the managed-merchant URL, submit a multi-location intent, and look up onboarding status
Store reads and temporary deactivationStore summary, menu summary, the full menu, and pause or resume the store
OrdersConfirm, adjust, cancel, mark ready for pickup, and record a retail return

Catalog pull, inventory pull, and store-hours pull are endpoints you host. The inventory-pull call asks DoorDash to pull one store. It does not call your pull endpoint. The pull uses PULL_STORE_ITEMS and pull_mode REPLACE only.

Restaurant menu create and update, and Checkout / DoorDash Direct, are not in these clients.

Install and call sandbox​

Create one client per provider type. Sandbox and production are different provider types and different credentials. The signing secret is the base64 value from the Developer Portal. The client decodes it before signing. Each client sends Authorization: Bearer, auth-version: v2, and a User-Agent built from the provider type. example_pos_sandbox becomes ExamplePosSandbox/1.0.

The sample below triggers an inventory pull for one store. That is the fastest sandbox call. A 2xx with operation_status: QUEUED means DoorDash accepted the pull. It does not mean the menu changed.

Requires Node.js 22 or newer. The package has no dependencies.

Download the Node.js client

Unzip the download. It contains a node folder. Copy that folder into your project, for example third_party/retail-marketplace-sdk.

const { Client } = require('./third_party/retail-marketplace-sdk');

async function main() {
const client = new Client({
developerId: process.env.DOORDASH_DEVELOPER_ID,
keyId: process.env.DOORDASH_KEY_ID,
signingSecret: process.env.DOORDASH_SIGNING_SECRET,
providerType: process.env.DOORDASH_PROVIDER_TYPE,
});
const result = await client.createInventoryPull(process.env.DOORDASH_STORE_LOCATION_ID);
console.log(result.operation.operation_id, result.operation.operation_status);
}

main();

Read the responses​

Inventory, promotion, business-wide pricing, and fulfillment-capacity calls are written to succeed on 202 with operation_status: QUEUED. Inventory pull succeeds on 200 with the same queued body. Catalog create is written for 201. Catalog update and store-hours update are written for 200.

queued is true when operation_status is QUEUED. Store the operation_id with the store and the batch. A success status does not mean the menu changed.

If DoorDash returns a 2xx other than the status that client expects, the call throws and the response stays on the error. Read that body before changing the request. Do not retry it.

Business-wide pricing returns 403 until universal pricing is enabled for the business. Fulfillment capacity returns 403 until hybrid fulfillment signal reception is enabled for the provider.