# How to configure Walmart Marketplace API credentials

This guide explains how to set up Walmart Marketplace API credentials for Apideck's E-commerce API integration.

## Prerequisites

- Access to Walmart's Channel Partner Portal
- Solution provider credentials from Walmart
- Apideck account with app ID and API key

## Getting started

For production use, follow the standard OAuth2 flow instead of importing tokens:

### Create a production app in Walmart

1. Log into the [Channel Partner Portal](https://developer.walmart.com/us-marketplace/docs) with your solution provider credentials
2. Create a new application for production use
3. Copy your **Client ID** and **Client Secret**

### Configure the production connector in Apideck

1. Log into [Apideck Platform](https://platform.apideck.com)
2. Go to **Configuration > E-commerce API > Walmart**
3. Set the **Client ID** and **Client Secret** from your production app
4. Set the **Server** to "Production"
5. Save your settings

### Connect via OAuth2 flow

Users can now create connections through the standard OAuth2 flow:

1. Navigate to [Consumers](https://platform.apideck.com/consumers)
2. Create a new consumer
3. Add Walmart as a integration
4. Click **Connect** for Walmart
5. Follow the OAuth2 authorization flow
6. Grant the necessary permissions

The connection will be automatically established and ready for use with the E-commerce API.

## Using the Walmart Sandbox

> **Note:** Sandbox is only available for US marketplaces.

1. Log into the [Channel Partner Portal](https://developer.walmart.com/us-marketplace/docs/walmart-api-sandbox) with your solution provider credentials
2. Navigate to **Sandbox Credentials**
3. Copy the following values:
   - Client ID
   - Client Secret
   - Refresh Token
   - Walmart Partner ID

### Configure the Walmart connector in Apideck

1. Log into [Apideck Platform](https://platform.apideck.com)
2. Go to **Configuration > E-commerce API > Walmart**
3. Set the **Client ID** and **Client Secret**
4. Set the **Server** to "Sandbox"
5. Save your settings

### Import the access token

Use the Vault API to import your Walmart credentials:

```bash
curl -X POST 'https://unify.apideck.com/vault/connections/ecommerce/walmart/import' \
  -H 'x-apideck-consumer-id: {CONSUMER_ID}' \
  -H 'x-apideck-app-id: {YOUR_APP_ID}' \
  -H 'Authorization: Bearer {YOUR_API_KEY}' \
  -H 'Content-Type: application/json' \
  -d '{
    "credentials": {
      "refresh_token": "{WALMART_REFRESH_TOKEN}",
      "access_token": "placeholder",
      "issued_at": "2025-01-01T00:00:00.000Z",
      "expires_in": -1
    },
    "settings": {
      "market": "us",
      "seller_id": "{WALMART_PARTNER_ID}"
    }
  }'
```

### Validate the connection

Verify your connection is working:

```bash
curl -X POST 'https://unify.apideck.com/vault/connections/ecommerce/walmart/validate' \
  -H 'x-apideck-consumer-id: {CONSUMER_ID}' \
  -H 'x-apideck-app-id: {YOUR_APP_ID}' \
  -H 'Authorization: Bearer {YOUR_API_KEY}' \
  -H 'Content-Type: application/json'
```

A successful response returns status `200` with `state: "callable"`.


## Start building with Walmart

You're now ready to use the [E-commerce API](https://developers.apideck.com/apis/ecommerce) to interact with Walmart Marketplace data.

Learn more about [Walmart's API documentation](https://developer.walmart.com/us-marketplace/docs).
