> ## Documentation Index
> Fetch the complete documentation index at: https://docs.collectpure.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execution

> Quote a sale, then execute it by quote id

Sell into offers in two calls: create a quote, then execute it by its `quoteId`. The quote holds its payout for **60 seconds**, so execute sends no body.

> [!NOTE]
>
> Both routes require an **Admin** API key (`stytch_admin`). See [Authentication](https://docs.collectpure.com/api-reference/authentication.md).

> [!TIP]
>
> Build against sandbox first: `https://sandbox.api.collectpure.com` with a sandbox API key. Sandbox orders are not real.

```mermaid theme={null}
sequenceDiagram
    participant You
    participant API as Pure API

    You->>API: POST /execution/v3/sell/quotes
    API-->>You: quoteId, payout, expiresAt (60s)

    You->>API: POST /execution/v3/sell/quotes/{quoteId}/execute
    API->>API: Re-price, then check the quoted payout
    API-->>You: orderId, or 409 requote
```

| Step | Route |
| - | - |
| Quote | `POST /execution/v3/sell/quotes` |
| Execute | `POST /execution/v3/sell/quotes/{quoteId}/execute` |

A quote places at most one order. After it executes, fails, or expires, create a new quote.

## Quote

```bash theme={null}
curl -X POST https://api.collectpure.com/execution/v3/sell/quotes \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "items": [{ "offerId": "OFFER_UUID", "quantity": 1 }] }'
```

```json theme={null}
{
  "quoteId": "2f1d48ff-1903-4531-9e28-4557ba549370",
  "expiresAt": "2026-11-05T00:35:49.457Z",
  "payout": 3257,
  "payoutMethod": "plaid_ach",
  "items": [{ "offerId": "OFFER_UUID", "productId": "PRODUCT_UUID", "variantId": "VARIANT_UUID", "quantity": 1, "unitPrice": 3278 }],
  "breakdown": {
    "subtotal": 3278,
    "fees": [{ "label": "Processing fee", "amount": -21 }],
    "promotions": []
  },
  "optionals": [
    {
      "id": "overnight_label",
      "title": "Overnight label",
      "selected": false,
      "available": true,
      "fee": 995,
      "payoutWith": 2262,
      "payoutWithout": 3257,
      "unavailable": null
    },
    {
      "id": "instant_payout",
      "title": "Instant payout",
      "selected": false,
      "available": false,
      "fee": null,
      "payoutWith": null,
      "payoutWithout": null,
      "unavailable": {
        "kind": "requote",
        "reason": "optional_not_eligible",
        "message": "This addon is not available for this order."
      }
    }
  ],
  "issues": []
}
```

Amounts are in **cents**. `payout` is what you are paid. An empty `issues` means the quote can be executed. Every field: [Sell](https://docs.collectpure.com/execution/sell.md).

## Execute

```bash theme={null}
curl -X POST https://api.collectpure.com/execution/v3/sell/quotes/QUOTE_ID/execute \
  -H "x-api-key: YOUR_API_KEY"
```

```json theme={null}
{
  "status": "placed",
  "orderId": 989,
  "counterpartyOrderIds": [978],
  "payout": 3257
}
```

`orderId` is a **purchase order**, because Pure is buying from you. Fetch it with `GET /orders/get-purchase-order/v1?id={orderId}`.

Execute is idempotent by quote id, so retrying it never places a second order. See [Errors and retries](https://docs.collectpure.com/execution/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.