# Initial considerations — how to start

Path: `/guide/start`
Summary: Auth, logged user, warehouses, subscribing to webhooks

This guide supports the self-onboarding process for a fulfiller using Pulpo's 3PL
functionality. It focuses on the minimum requirements for a fast, reliable
integration with the systems your customers use — middleware, ERPs, OMSs or
marketplaces — along the "happy path".

> **NOTE: Base URLs**
>
> Production: `https://eu.pulpo.co/api/v1` (EU) · `https://am.pulpo.co/api/v1` (Americas).
> Onboarding / staging: `https://eu-show.pulpo.co/api/v1`. All paths in this guide are relative to `/api/v1`.

## 1. Authenticate

Authentication uses the OAuth 2.0 password grant. Tokens expire after **60 minutes** —
store and reuse them rather than requesting a new one on every call.

**Endpoint: Authenticate or refresh an access token** — `POST /auth` (operationId: authenticate)

Exchange your credentials for a bearer token, then send it as
`Authorization: Bearer <token>` on every subsequent request.

**Example (cURL):**

```bash
curl -X POST https://eu.pulpo.co/api/v1/auth \
-H "Content-Type: application/json" \
-d '{
  "grant_type": "password",
  "username": "you@example.com",
  "password": "••••••••"
}'
```

**Example (JavaScript):**

```js
const res = await fetch("https://eu.pulpo.co/api/v1/auth", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
  grant_type: "password",
  username: "you@example.com",
  password: process.env.PULPO_PASSWORD,
}),
});
const { access_token } = await res.json();
```

**Example (Python):**

```python
import requests

res = requests.post(
  "https://eu.pulpo.co/api/v1/auth",
  json={
      "grant_type": "password",
      "username": "you@example.com",
      "password": PULPO_PASSWORD,
  },
)
access_token = res.json()["access_token"]
```

> **TIP: Store the token**
>
> The token is valid for 60 minutes. Request a new one only after \~59 minutes — there is
> no reason to authenticate on every call, and doing so eats into your rate limit.

## 2. Read your logged-in user

Your user implicitly determines the Tenant you belong to, and which Merchants you can
manage. The stored user payload carries more than the obvious fields — read the payload,
not an assumed shape.

**Endpoint: Get current user information** — `GET /iam/users/me` (operationId: getCurrentUser)

## 3. List your warehouses

Purchase Orders and Sales Orders are always tied to a specific Warehouse, so you will need
their ids early. The warehouse layout is defined together with Pulpo's onboarding team
using the WMS wizard.

**Endpoint: List all warehouses** — `GET /warehouses/` (operationId: listWarehouses)

## 4. Subscribe to webhooks

Most state transitions in Pulpo are surfaced as webhooks. Subscribe to the events your
integration needs — you will see the relevant ones called out on each process page.

**Endpoint: Subscribe to webhook events** — `POST /webhook/` (operationId: subscribeWebhook)

Register a URL to receive event callbacks. See the [webhook catalog](/guide/webhooks) for
the full list of event types and sample payloads.

> **SUCCESS: You are ready**
>
> With a token, your warehouse ids and webhook subscriptions in place, continue to the
> [entity & data model](/guide/data-model) to understand how everything relates — then work
> through the [incoming](/guide/incoming) and [outgoing](/guide/outgoing) happy paths.

---

Website version: https://connect.pulpo.co/guide/start
Whole guide in one file: https://connect.pulpo.co/llms-full.txt
Index of all pages: https://connect.pulpo.co/llms.txt
