> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://walmart.postmansolutions.com/us-marketplace/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://walmart.postmansolutions.com/us-marketplace/_mcp/server.

# Authorization endpoint (delegated consent)

GET https://marketplace.walmart.com/seller/auth/v4/authorize

Browser endpoint for the authorization-code grant (RFC 6749 §3.1). The
Solution Provider redirects the seller here; the seller authenticates and
consents at Walmart IAM, and the response redirects to `redirect_uri` with a
single-use `code`.

- **PKCE required** — `code_challenge` + `code_challenge_method=S256`
  (RFC 7636). `plain` is not accepted.
- **Exact** `redirect_uri` match against a value registered for the client.
- `state` required; echoed back verbatim (CSRF).
- The success and error redirects (performed by IAM) carry `iss` (RFC 9207);
  clients MUST validate it.

**Error handling.** For a valid request, this endpoint `302`-redirects to the
Walmart IAM consent URL; IAM then drives consent and performs the RFC 6749
§4.1.2.1 redirect back to the client's `redirect_uri` (success or error),
because IAM is the party that can verify the `redirect_uri` is registered.
For request-level errors that `authorization-service` itself detects
(missing/invalid `client_id`/`redirect_uri`, `response_type` != `code`,
`code_challenge_method` != `S256`), it returns a JSON `400` (`AuthorizeError`).
It deliberately does **not** redirect these errors to the supplied
`redirect_uri`: the proxy has no client registry, so self-redirecting to an
unverified URI would be an open redirect.

> **Upstream status (ADR-048, pending):** `iss` emission, exact-redirect
> enforcement, and server-side rejection of `code_challenge_method=plain` are
> IAM / app-store responsibilities not yet fully in place. authorization-service
> enforces the request-side invariants it can and redirects valid requests to
> IAM; the full guarantee lands when those upstream changes ship.


Reference: https://walmart.postmansolutions.com/us-marketplace/api-reference/core-auth/authorization/authorize

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://marketplace.walmart.com/seller` (Production, default)
- `https://sandbox.marketplace.walmart.com/seller` (Sandbox)

## Request

### Query parameters

- `response_type` (enum, required) — Must be `code`.
  - Allowed values: `code`
- `client_id` (string, required) — The registered client identifier.
- `redirect_uri` (string, required) — Callback URI; must exactly match a registered value.
- `scope` (string, required) — Space-delimited scopes. Include `offline_access` to receive a refresh token.
- `state` (string, required) — Opaque CSRF token; echoed back unchanged.
- `code_challenge` (string, required) — PKCE challenge — base64url(SHA-256(code_verifier)).
- `code_challenge_method` (enum, required) — Must be `S256`.
  - Allowed values: `S256`

## Errors

### 400 Bad Request Error

Non-redirectable request (bad `client_id`/`redirect_uri`).

- `error` (enum, required) — Machine-readable error code.
  - Allowed values: `invalid_request`, `unauthorized_client`, `access_denied`, `unsupported_response_type`, `invalid_scope`, `server_error`, `temporarily_unavailable`
- `error_description` (string, optional) — Human-readable explanation.
- `error_uri` (string, optional) — Optional link to error docs.
- `state` (string, optional) — The `state` from the request, when supplied.

### 429 Too Many Requests Error

Rate limit exceeded.

- `error` (enum, required) — Machine-readable error code.
  - Allowed values: `invalid_request`, `invalid_client`, `invalid_grant`, `unauthorized_client`, `unsupported_grant_type`, `invalid_scope`
- `error_description` (string, optional) — Human-readable explanation.
- `error_uri` (string, optional) — Optional link to error documentation.

### 500 Internal Server Error

Internal error.

- `error` (enum, required) — Machine-readable error code.
  - Allowed values: `invalid_request`, `invalid_client`, `invalid_grant`, `unauthorized_client`, `unsupported_grant_type`, `invalid_scope`
- `error_description` (string, optional) — Human-readable explanation.
- `error_uri` (string, optional) — Optional link to error documentation.

## Examples

**SDK Code**

```python
import requests

url = "https://marketplace.walmart.com/seller/auth/v4/authorize"

querystring = {"client_id":"client_id","code_challenge":"code_challenge","code_challenge_method":"S256","redirect_uri":"redirect_uri","response_type":"code","scope":"scope","state":"state"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://marketplace.walmart.com/seller/auth/v4/authorize?client_id=client_id&code_challenge=code_challenge&code_challenge_method=S256&redirect_uri=redirect_uri&response_type=code&scope=scope&state=state';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://marketplace.walmart.com/seller/auth/v4/authorize?client_id=client_id&code_challenge=code_challenge&code_challenge_method=S256&redirect_uri=redirect_uri&response_type=code&scope=scope&state=state"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://marketplace.walmart.com/seller/auth/v4/authorize?client_id=client_id&code_challenge=code_challenge&code_challenge_method=S256&redirect_uri=redirect_uri&response_type=code&scope=scope&state=state")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://marketplace.walmart.com/seller/auth/v4/authorize?client_id=client_id&code_challenge=code_challenge&code_challenge_method=S256&redirect_uri=redirect_uri&response_type=code&scope=scope&state=state")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://marketplace.walmart.com/seller/auth/v4/authorize?client_id=client_id&code_challenge=code_challenge&code_challenge_method=S256&redirect_uri=redirect_uri&response_type=code&scope=scope&state=state', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://marketplace.walmart.com/seller/auth/v4/authorize?client_id=client_id&code_challenge=code_challenge&code_challenge_method=S256&redirect_uri=redirect_uri&response_type=code&scope=scope&state=state");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://marketplace.walmart.com/seller/auth/v4/authorize?client_id=client_id&code_challenge=code_challenge&code_challenge_method=S256&redirect_uri=redirect_uri&response_type=code&scope=scope&state=state")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```