---
title: "Buy offsets or removals now, charged to the account's saved card"
method: POST
path: "/v1/offsets/purchases"
tags: ["Offsets"]
---

# Buy offsets or removals now, charged to the account's saved card

`POST /v1/offsets/purchases`

## Request

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

Charges the account's saved card for a carbon purchase, one-time or monthly (the first month now; WooCommerce Subscriptions renews it monthly on the same card). Available only after the account switched API purchasing on in My Account → API (403 api_purchasing_off otherwise); the account needs a saved card on the product's rail — PayPal for offsets, Stripe for removals (409 rail_not_covered). Exactly one of carbon_kg, spend_usd or items. The order buys whole units of the product (a kilogram, or a tonne) at the ALL-IN product quote, with the web order's processing fee; a spend_usd purchase can exceed the budget by less than one kilogram's price, and a product sold by the tonne is bought by quantity (422 buy_by_quantity). Idempotency-Key is required. A decline is final: post again under a new key. A purchase is a final sale.

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `type` 'offset' | 'removal', required
  - `carbon_kg` number
  - `spend_usd` number
  - `product_id` union: A product_id from /v1/offset-products, or the product's numeric id. Default: the account's own default product for the type.
    - string
    - integer
  - `items` object[]: Several items in one purchase, each its own order line, instead of carbon_kg or spend_usd. An item is an analysed item, {carbonguru_id} (its name, kilograms and Climate Impact come from the analysis), or an amount, {carbon_kg, name}. The lines round up together once, as cart lines on one product do.
    - `carbonguru_id` string
    - `carbon_kg` number
    - `name` string
    - `original_price_usd` number
  - `session_id` string: The analysis an amount item belongs to; links it to the analysed item whose footprint it matches.
  - `subscription_mode` 'onetime' | 'monthly'

## Response `200`

The purchase this Idempotency-Key already made (replayed).

## Other responses

- `201`: The purchase: {purchase: {id, state, type, product_id, product_name, carbon_kg, requested_input, requested_kg, purchase_kg, unit, unit_kg, items, amount_charged, amount_usd, currency, decline, created, receipt_url, subscription_mode, subscription: {id, status, amount_usd, next_payment} | null}}. requested_kg is the kilograms asked for (or the kilograms spend_usd bought, or the items' kilograms); purchase_kg is what the order bought, rounded up to a whole number of the product's units (unit, unit_kg). items lists an items purchase's items (carbonguru_id, name, carbon_kg, social_cost_usd), else null.
- `403`: api_purchasing_off.
- `409`: rail_not_covered.
- `422`: invalid_body, or unknown_product: product_id names no product in /v1/offset-products.

---

[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)
