> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/getting-started/get-started-with-esw/readme/postman-collection.md).

# Postman Collection

Download and import the ESW Postman collection + environment to run the sandbox flow (token → PreOrder → redirect).

### Get the Postman collection

Postman is the fastest way to explore the sandbox flow.

{% hint style="info" icon="laptop-code" %}

## Install Postman

{% embed url="<https://www.postman.com/downloads/>" %}
{% endhint %}

1. Import the files below.
2. Select the imported environment.
3. Run the requests in order `(token → PreOrder → redirect)`

Our Postman collection contains a series of Checkout API calls that are made during a typical Checkout session. The URLs in these environments point to the Integration Layer Proxy, which further points to GoCasual by default. Note that each environment contains STS tokens for the equivalent GoCasual API.

**Collection** (requests)

{% file src="/files/gGjk9sLNbPezX9HQAgzB" %}

**Environment** (variables)

{% file src="/files/1nIW6uTGFgmaDGoj0bEt" %}

### Try Checkout end-to-end

#### Test credentials (sandbox)

Use these values when requesting an STS token in sandbox.

| Field           | Value                                                       |
| --------------- | ----------------------------------------------------------- |
| Token URL       | `https://security-sts.sandbox.eshopworld.com/connect/token` |
| `grant_type`    | `client_credentials`                                        |
| `scope`         | `checkout.preorder.api.all`                                 |
| `client_id`     | `gocas.checkout.client`                                     |
| `client_secret` | Provided by ESW                                             |

{% stepper %}
{% step %}

#### Get an STS access token

Use the same pattern as on [Access Tokens](/getting-started/get-started-with-esw/readme/publish-your-docs.md).

```sh
curl --location --request POST "https://security-sts.sandbox.eshopworld.com/connect/token" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "grant_type=client_credentials" \
  --data-urlencode "scope=checkout.preorder.api.all" \
  --data-urlencode "client_id=<client_id>" \
  --data-urlencode "client_secret=<client_secret>"
```

**Sample response**

```json
{
  "access_token": "<jwt>",
  "expires_in": 3600,
  "token_type": "Bearer",
  "scope": "checkout.preorder.api.all"
}
```

{% endstep %}

{% step %}

#### Create a PreOrder

Use the `access_token` from the previous step.

{% code expandable="true" %}

```sh
curl --location --request POST "https://api.sandbox.esw.com/checkout/api/v3/GOCAS/PreOrder" \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer <access_token>" \
  --data-raw '{
    "retailerCartId": "Sample123",
    "lineItems": [
      {
        "quantity": 2,
        "product": {
          "productCode": "1234567890",
          "title": "Black Dress",
          "description": "Black Striped Dress",
          "shopperCurrencyProductPriceInfo": { "price": "AUD3.33" },
          "imageUrl": "assets/images/cart/cart-item10.png",
          "color": "Black",
          "size": "M"
        },
        "cartGrouping": "Group 1"
      }
    ],
    "shopperCurrencyIso": "AUD",
    "retailerCurrencyIso": "EUR",
    "deliveryCountryIso": "AU"
  }'
```

{% endcode %}

**Sample API Response**

```json
{
  "preOrderCode": "e23afa68-9675-4012-8d63-df1517c624cc",
  "orderNumber": "e23afa68-9675-4012-8d63-df1517c624cc",
  "redirectUrl": "https://checkout-ui.sandbox.eshopworld.com/au/e23afa68-9675-4012-8d63-df1517c624cc"
}
```

{% endstep %}

{% step %}

#### Open Checkout

Open `redirectUrl` in a browser.
{% endstep %}
{% endstepper %}

### Troubleshooting

* `401/403`: token missing, expired, or wrong `scope`. See [Authentication](/getting-started/get-started-with-esw/readme/quickstart.md).
* `400`: request body validation failed. Start by reducing to one item.
* Slow responses / timeouts: follow [API best practices](/getting-started/get-started-with-esw/best-practices/apis.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.esw.com/getting-started/get-started-with-esw/readme/postman-collection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
