---
title: "Pay Cart"
method: POST
path: "/v1/carts/{cart_id}/pay"
tags: ["manufacturing-v1"]
---

# Pay Cart

`POST /v1/carts/{cart_id}/pay`

## Request

- Base URL: `https://api.rmfg.com`
- URL: `https://api.rmfg.com/v1/carts/{cart_id}/pay`
- Auth: HTTP bearer

Charge the account's saved card for this cart and create the order,
with no person in the loop.

Preconditions: the cart is `open`, its quote is `ready`, it has a
`ship_to` and a `shipping_option_id`, a nonblank `customer_phone` or
`ship_to.phone` for delivery contact, and the account has a card on file
(`GET /v1/account`, saved on the website's account page) or the request
names a Stripe PaymentMethod. The charge is the cart's
`totals.amount_total_cents`. New payments require at least $32 before
sales tax, including shipping and production surcharges
(`409 minimum_order_not_met`). On success the cart becomes `checked_out`
and the response carries `order_id`. An uncertain result returns 202
with status `processing`; a durable worker retries order creation with the
same payment. A failed handoff returns `502 order_creation_pending`
while recovery continues; retry this cart, not a new payment.
Timeouts never trigger automatic refunds. Retrying a paid
cart returns the existing payment.

## Path parameters

- `cart_id` string, required

## Request body

- V1CartPayRequest
  - `payment` union, required
    - V1CardOnFilePayment
      - `type` 'card_on_file', required
    - V1PaymentMethodPayment
      - `type` 'payment_method', required
      - `id` string, required: A Stripe PaymentMethod id (`pm_...`) usable off-session for this account's customer, for callers that manage their own payment details.
  - `customer_email` string, nullable: Receipt and order emails; defaults to the account email.
  - `customer_phone` string, nullable: Delivery contact phone. Required for a new headless payment unless ship_to.phone is set on the cart; blank values do not count.

## Response `200`

Already paid; the existing payment.

- V1CartPayment
  - `object` 'cart_payment'
  - `cart_id` string, required
  - `status` 'paid' | 'processing' | 'failed' | 'refunded', required
  - `payment_intent_id` string, nullable
  - `amount_total_cents` integer, required
  - `order_id` string, nullable
  - `order_url` string, nullable: `/v1/orders/{order_id}` once the order exists.
  - `paid_at` string, date-time, nullable

## Other responses

- `201`: Charged; the order exists.
- `202`: Payment reconciliation or order creation is pending.
- `400`: Malformed request.
- `401`: Missing or invalid credentials.
- `402`: The card was declined.
- `403`: The credentials do not permit this operation.
- `404`: The resource does not exist or is not visible to the caller.
- `409`: The resource is not ready, or Idempotency-Key was reused with a different request.
- `422`: Validation failed; see `error.param` and `error.details`.
- `429`: Rate limit exceeded; retry after the `Retry-After` header.
- `500`: Unexpected failure; safe to retry with the same Idempotency-Key.
- `502`: Payment succeeded but order creation failed; recovery retries the same payment.
- `503`: A dependency is temporarily unavailable; retry later.

## Changes

- **2026-10-15** `675487a330d2`: 1 info
  - added the non-success response with the status `502`
- **2026-09-06** `b7e901150c5c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rmfg/apis/rmfg-manufacturing-api/changes/v1/carts/:cart_id/pay/post.md)

---

[API](https://skmtc.dev/rmfg/apis/rmfg-manufacturing-api.md) - [All operations](https://skmtc.dev/rmfg/apis/rmfg-manufacturing-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rmfg/apis/rmfg-manufacturing-api/revisions/078f984358b9?raw)
