> For the complete documentation index, see [llms.txt](https://docs.eu-pactum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eu-pactum.com/price-lists-api/price-lists-api-demo.md).

# Price Lists API Demo

Pactum has a set of shell scripts that run a complete Price Lists API workflow against your own workspace with one command. Use them to see the API working end to end before you build your integration.

{% hint style="info" %}
To get the demo scripts, ask your Pactum contact. They send you the current version for your region.
{% endhint %}

## Before you start

You need:

* API client credentials (a client ID and client secret) for a workspace you can test in. See [Client Credentials](https://docs.eu-pactum.com/price-lists-api/authentication/client-credentials.md). Use a sandbox workspace if you have one.
* `curl`, `jq` and `openssl` on your machine. On macOS: `brew install jq`. On Ubuntu: `apt-get install jq`.

## Set up and run

{% stepper %}
{% step %}

#### Add your configuration

Copy the example settings file and fill in your credentials and your region's API host:

```bash
cp env.example .env
```

```bash
PACTUM_CLIENT_ID=your-client-id
PACTUM_CLIENT_SECRET=your-client-secret
PACTUM_API_BASE_URL=https://direct-procurement.pactum.com   # US
# PACTUM_API_BASE_URL=https://direct-procurement.eu-pactum.com   # EU
```

Never commit the `.env` file or share it.
{% endstep %}

{% step %}

#### Run the demo

```bash
./run-full-demo.sh
```

{% endstep %}
{% endstepper %}

## What the demo does

The script calls the API in this order:

1. **Get a token** from `/auth/v1/oauth/token` with your client credentials.
2. **List workspaces** your API client can access.
3. **List negotiations** that already exist in the workspace.
4. **Create a negotiation** with sample supplier and material data.
5. **Get the negotiation details.**
6. **Upload an attachment** (a generated CSV file).
7. **Start the negotiation.** Pactum must finish preparing the negotiation first, so the script retries the start call until preparation is ready.
8. **Download the chat snapshot** as a PDF.

{% hint style="warning" %}
Starting the negotiation sends a real invitation email to the supplier email address in the sample data. Before you run the demo, change that address to a mailbox you control.
{% endhint %}

The [Overview](https://docs.eu-pactum.com/price-lists-api/overview.md) quickstart walks through the same calls one at a time.

## Troubleshooting

<details>

<summary>"jq: command not found"</summary>

Install `jq` (see **Before you start**).

</details>

<details>

<summary>"Authentication failed"</summary>

* Check the client ID and secret in `.env`.
* Check that `PACTUM_API_BASE_URL` is the host for your region. Credentials only work in the region where they were created.

</details>

<details>

<summary>"Negotiation preparation not found" or "not yet ready"</summary>

This is expected right after creating a negotiation. The script retries automatically. If it keeps failing, check the negotiation's preparation with `GET .../negotiations/{id}/preparation` and contact Pactum with the `Request-Id` from the response.

</details>

## Related

* [Overview](https://docs.eu-pactum.com/price-lists-api/overview.md)
* [Authentication](https://docs.eu-pactum.com/price-lists-api/authentication.md)
