---
title: "Create an order + hosted payment link"
method: POST
path: "/v1/checkout"
---

# Create an order + hosted payment link

`POST /v1/checkout`

## Request

- Base URL: `https://agenticfabricationnetwork.ai`
- URL: `https://agenticfabricationnetwork.ai/v1/checkout`
- Auth: HTTP bearer

## Request body

- object
  - `offer_id` string, required
  - `shipping_option_id` string, required
  - `ship_to` object: Optional — omit to have the hosted payment page collect the shipping address
    - `name` string, required
    - `street1` string, required
    - `street2` string
    - `city` string, required
    - `state` string, required
    - `zip` string, required
    - `country` string
  - `contact` object: Optional — omit to have the hosted payment page collect the buyer email
    - `email` string, email, required
    - `phone` string
  - `return_url` string, uri: Optional — the page the buyer is on when checkout starts. The post-payment landing pages show a 'Return to <site>' button pointing here. http(s) only; pass a URL the client actually knows, never an invented one.
  - `coupon_code` string: Optional coupon code (early-adopter codes from the AFN team; case-insensitive). Validated before any order exists — unknown, deactivated, or fully-redeemed codes refuse with a 400 and no money moves. The discount shows on the hosted payment page; a 100%-off code makes the total $0 and no card is collected.

## Response `201`

Order created; give checkout_url to the user

- object
  - `order_id` string
  - `checkout_url` string, uri
  - `total_cents` integer: What the buyer pays; 0 when a 100%-off coupon covered the order
  - `currency` 'usd'
  - `discount_cents` integer: Present when a coupon applied: cents knocked off the total
  - `coupon_code` string: The redeemed coupon code, normalized uppercase
  - `price_basis` 'estimate_pending_verification': Present when the total is a cached estimate. The quote is a price ceiling: the checkout page confirms the vendor's live price, which can only match the quote or come in lower. If the vendor repriced upward the order expires unpaid — just re-quote. Agents need no special handling.

---

[API](https://skmtc.dev/agenticfabricationnetwork/apis/afn-agentic-fabrication-network.md) · [All operations](https://skmtc.dev/agenticfabricationnetwork/apis/afn-agentic-fabrication-network/llms.txt) · [OpenAPI document](https://skmtc.dev/agenticfabricationnetwork/apis/afn-agentic-fabrication-network/revisions/42c16babcd2b?raw)
