---
title: "The checkout link for one cart"
method: POST
path: "/v1/offsets/checkout"
tags: ["Offsets"]
---

# The checkout link for one cart

`POST /v1/offsets/checkout`

## Request

- Base URL: `https://carbonguru.io`
- URL: `https://carbonguru.io/v1/offsets/checkout`
- Auth: HTTP bearer

IT BUYS NOTHING. This route reads the cart and returns two URLs; it posts to no order, payment or checkout-processing route, and no /v1/ route does. A key cannot start charging an account (ADR-010 §1): for the account's own offsets the API builds a cart and returns a checkout link, and the purchase happens in the browser, where a person sees the price and pays. offset settles through PayPal and removal through Stripe; the type on the URL picks which. The cart comes back beside the links so a caller can show what is about to be bought.

## Request body

- object
  - `type` 'offset' | 'removal', required

## Response `200`

Where to complete the purchase. Nothing was bought.

- object
  - `checkout_url` string, required
  - `cart_url` string, required
  - `cart` object, required
    - `type` 'offset' | 'removal', required
    - `items` object[], required
      - `item_key` string: Delete this line at DELETE /v1/offsets/cart/items/{item_key}.
      - `name` string
      - `description` string
      - `quantity` number, nullable
      - `type` 'offset' | 'removal'
      - `carbon_kg` number, nullable
      - `metric_tons` number, nullable
      - `cost_usd` number, nullable: This line's price, all-in.
      - `social_cost_usd` number, nullable
      - `carbonguru_id` string, nullable: The analysed item this offset is for.
      - `portfolio_name` string, nullable
      - `subscription_mode` 'monthly' | 'null', nullable
      - `subscription_recurring_price_usd` number, nullable
    - `totals` object, required: Totals of THIS cart. total_cost_usd is the amount checkout charges for it: one all-in number.
      - `item_count` integer
      - `total_carbon_kg` number
      - `total_cost_usd` number
    - `links` object, required
      - `checkout` string
      - `cart` string

## Other responses

- `401`: No valid credential. Every authentication failure returns this one document.
- `402`: The account's plan does not include this capability. Carries min_tier and upgrade_url.
- `403`: A missing scope, an exhausted analysis allowance, or an object that is not the caller's.
- `404`: No such resource.
- `422`: The request's fields are wrong. errors[] names them.

---

[API](https://skmtc.dev/carbonguru/apis/carbonguru-api.md) · [All operations](https://skmtc.dev/carbonguru/apis/carbonguru-api/llms.txt) · [OpenAPI document](https://skmtc.dev/carbonguru/apis/carbonguru-api/revisions/26dcbe7a8500?raw)
