# Fulfillbot API

The Fulfillbot API lets your own systems and AI agents work with your Fulfillbot account. Read your wallet, products, stock, orders, purchase orders, shipments, sourcing requests and quotes; create, fix and cancel orders; map your SKUs; ask for shipments from your stock and confirm their freight quotes; and ask us to source or restock products. Webhooks tell your system when something changes.

The API is another way into the customer portal, not a separate system. Every call follows the same rules as the portal, and what you do through the API shows up in the portal straight away, and the other way round.

## What you need

- **API access for your account.** Fulfillbot turns it on per account: ask your account manager. Until then the portal doesn't show **Settings → API access**.
- **An API key.** Create one in the portal under **Settings → API access**. See [Getting started](https://docs.rephut.com/developers/getting-started).
- **A server or script.** Call the API from your backend. It sends no CORS headers, so browsers can't call it, and a key must never be in a web page or an app.

## Base URL

```text
https://api.rephut.com/v1
```

Every endpoint path in these docs starts with `/v1`. See [Base URL and versioning](https://docs.rephut.com/developers/base-url).

## Before you create orders

Creating orders can hold money in your wallet, and our warehouse charges shipping when it weighs a parcel. Read [Charges and your wallet](https://docs.rephut.com/developers/charges) before you give a key the `orders:write` permission.

## What still needs the portal

Paying purchase orders and shipments, accepting or declining quotes, withdrawing requests, topping up your wallet, uploading images, and managing API keys and webhook endpoints.

## All endpoints

| Endpoint | What it does | Permission |
|---|---|---|
| [`GET /v1/me`](https://docs.rephut.com/developers/reference/account#get-the-customer-and-api-key-for-this-request) | Get the customer and API key for this request | Any valid key |
| [`GET /v1/wallet`](https://docs.rephut.com/developers/reference/wallet#get-the-wallet-balance) | Get the wallet balance | `wallet:read` |
| [`GET /v1/wallet/ledger`](https://docs.rephut.com/developers/reference/wallet#list-wallet-transactions) | List wallet transactions | `wallet:read` |
| [`GET /v1/wallet/top-ups`](https://docs.rephut.com/developers/reference/wallet#list-top-ups) | List top-ups | `wallet:read` |
| [`GET /v1/products`](https://docs.rephut.com/developers/reference/products#list-your-products) | List your products | `catalog:read` |
| [`GET /v1/products/{id}`](https://docs.rephut.com/developers/reference/products#get-one-of-your-products) | Get one of your products | `catalog:read` |
| [`POST /v1/sku-mappings`](https://docs.rephut.com/developers/reference/sku-mappings#map-your-sku-to-one-of-your-products) | Map your SKU to one of your products | `catalog:write` |
| [`GET /v1/inventory`](https://docs.rephut.com/developers/reference/inventory#list-your-stock) | List your stock | `catalog:read` |
| [`GET /v1/orders`](https://docs.rephut.com/developers/reference/orders#list-orders) | List orders | `orders:read` |
| [`GET /v1/orders/{id}`](https://docs.rephut.com/developers/reference/orders#get-an-order) | Get an order | `orders:read` |
| [`POST /v1/orders/preview`](https://docs.rephut.com/developers/reference/orders#check-a-new-order-without-saving-it) | Check a new order without saving it | `orders:read` |
| [`POST /v1/orders`](https://docs.rephut.com/developers/reference/orders#create-an-order) | Create an order | `orders:write` |
| [`PATCH /v1/orders/{id}`](https://docs.rephut.com/developers/reference/orders#change-an-order-that-needs-attention) | Change an order that needs attention | `orders:write` |
| [`POST /v1/orders/{id}/cancel`](https://docs.rephut.com/developers/reference/orders#cancel-an-order-that-needs-attention) | Cancel an order that needs attention | `orders:write` |
| [`GET /v1/purchase-orders`](https://docs.rephut.com/developers/reference/purchase-orders#list-purchase-orders) | List purchase orders | `purchase_orders:read` |
| [`GET /v1/purchase-orders/{id}`](https://docs.rephut.com/developers/reference/purchase-orders#get-a-purchase-order) | Get a purchase order | `purchase_orders:read` |
| [`GET /v1/shipments`](https://docs.rephut.com/developers/reference/shipments#list-shipments) | List shipments | `shipments:read` |
| [`GET /v1/shipments/{id}`](https://docs.rephut.com/developers/reference/shipments#get-a-shipment) | Get a shipment | `shipments:read` |
| [`POST /v1/shipments/estimate`](https://docs.rephut.com/developers/reference/shipments#estimate-shipping-for-a-shipment-from-your-stock) | Estimate shipping for a shipment from your stock | `shipments:read` |
| [`POST /v1/shipments`](https://docs.rephut.com/developers/reference/shipments#request-a-shipment-from-your-stock) | Request a shipment from your stock | `shipments:write` |
| [`POST /v1/shipments/{id}/cancel`](https://docs.rephut.com/developers/reference/shipments#cancel-a-shipment-you-requested) | Cancel a shipment you requested | `shipments:write` |
| [`POST /v1/shipments/{id}/confirm`](https://docs.rephut.com/developers/reference/shipments#confirm-a-shipment-s-freight-quote) | Confirm a shipment's freight quote | `shipments:write` |
| [`GET /v1/requests`](https://docs.rephut.com/developers/reference/requests#list-sourcing-and-reorder-requests) | List sourcing and reorder requests | `requests:read` |
| [`GET /v1/requests/{id}`](https://docs.rephut.com/developers/reference/requests#get-a-sourcing-or-reorder-request) | Get a sourcing or reorder request | `requests:read` |
| [`POST /v1/requests/sourcing`](https://docs.rephut.com/developers/reference/requests#ask-us-to-source-new-products) | Ask us to source new products | `requests:write` |
| [`POST /v1/requests/reorder`](https://docs.rephut.com/developers/reference/requests#ask-us-to-restock-products-at-your-agreed-prices) | Ask us to restock products at your agreed prices | `requests:write` |
| [`GET /v1/quotes`](https://docs.rephut.com/developers/reference/quotes#list-quotes) | List quotes | `quotes:read` |
| [`GET /v1/quotes/{id}`](https://docs.rephut.com/developers/reference/quotes#get-a-quote) | Get a quote | `quotes:read` |

## Docs for AI tools

Every page has a **Markdown** button (the page as plain Markdown, also at its URL plus `.md`), a **Download** button and **Copy for LLM**. [https://docs.rephut.com/llms.txt](https://docs.rephut.com/llms.txt) lists every page, and [https://docs.rephut.com/llms-full.txt](https://docs.rephut.com/llms-full.txt) has all pages in one file. The [OpenAPI document](https://api.rephut.com/v1/openapi.json) describes every endpoint and webhook for tools.
