> 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-1/postman-collection.md).

# Postman Collection

### Get the Postman collection

Postman is the fastest way to explore the sandbox flow.

1. Install [Postman](https://www.getpostman.com/downloads/)
2. Import the files below.
3. Select the imported environment.
4. 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://checkout-api-gocas.sandbox.eshopworld.com/api/v2/PreOrder" \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer <access_token>" \
  --data-raw '{
    "retailerCartId": "Sample123",
    "cartItems": [
      {
        "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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
