Skip to content

Stripe: Cancel an order

Stripe climate.postClimateOrdersOrderCancel: arguments, response, policy and SDK examples.

← Climate operations · Get started

Operation stripe.postclimateordersordercancel

Provider route: POST /v1/climate/orders/{order}/cancel. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["climate"]["postClimateOrdersOrderCancel"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.climate.postClimateOrdersOrderCancel(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.climate.post_climate_orders_order_cancel(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.orderstringRequired within parentMaximum length: 5000
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Cancel an order — response body

Referenced models: Cancel an order — response body

4 more schemas are linked from the tables above, on the schema pages.

Cancel an order — response body
FieldTypePresenceDescription and constraints
$objectRootOrders represent your intent to purchase a particular Climate product. When you create an order, the
payment is deducted from your merchant balance.
amount_feesJSONRequired within parent
amount_fees (anyOf 1)integerAlternativeTotal amount of [Frontier](https://frontierclimate.com/)'s service fees in the currency's smallest unit.
amount_fees (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
amount_subtotalJSONRequired within parent
amount_subtotal (anyOf 1)integerAlternativeTotal amount of the carbon removal in the currency's smallest unit.
amount_subtotal (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
amount_totalJSONRequired within parent
amount_total (anyOf 1)integerAlternativeTotal amount of the order including fees in the currency's smallest unit.
amount_total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
beneficiaryModelOptionalExpand Cancel an order — response body — beneficiary
canceled_atJSONOptional
canceled_at (anyOf 1)JSONAlternative
canceled_at (anyOf 1) (anyOf 1)integerAlternativeTime at which the order was canceled. Measured in seconds since the Unix epoch.
Format: unix-time
canceled_at (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
canceled_at (anyOf 2)nullAlternative
cancellation_reasonJSONOptional
cancellation_reason (anyOf 1)stringAlternativeReason for the cancellation of this order.
Known values: expired, product_unavailable, requested
cancellation_reason (anyOf 2)nullAlternative
certificateJSONOptional
certificate (anyOf 1)stringAlternativeFor delivered orders, a URL to a delivery certificate for the order.
Maximum length: 5000
certificate (anyOf 2)nullAlternative
confirmed_atJSONOptional
confirmed_at (anyOf 1)JSONAlternative
confirmed_at (anyOf 1) (anyOf 1)integerAlternativeTime at which the order was confirmed. Measured in seconds since the Unix epoch.
Format: unix-time
confirmed_at (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
confirmed_at (anyOf 2)nullAlternative
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
currencystringRequired within parentThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase, representing the currency for this order.
Maximum length: 5000
delayed_atJSONOptional
delayed_at (anyOf 1)JSONAlternative
delayed_at (anyOf 1) (anyOf 1)integerAlternativeTime at which the order's expected_delivery_year was delayed. Measured in seconds since the Unix epoch.
Format: unix-time
delayed_at (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
delayed_at (anyOf 2)nullAlternative
delivered_atJSONOptional
delivered_at (anyOf 1)JSONAlternative
delivered_at (anyOf 1) (anyOf 1)integerAlternativeTime at which the order was delivered. Measured in seconds since the Unix epoch.
Format: unix-time
delivered_at (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
delivered_at (anyOf 2)nullAlternative
delivery_detailsarrayRequired within parentDetails about the delivery of carbon removal for this order.
delivery_details[]ModelEach itemExpand Cancel an order — response body — delivery details item
expected_delivery_yearJSONRequired within parent
expected_delivery_year (anyOf 1)integerAlternativeThe year this order is expected to be delivered. If the year is in the past, the order is a spot purchase and will be delivered within 30 days of purchase.
expected_delivery_year (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
livemodebooleanRequired within parentHas the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
metadataobjectRequired within parentSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Additional keys: see wildcard field
metadata.*stringAdditional keysMaximum length: 500
metric_tonsstringRequired within parentQuantity of carbon removal that is included in this order.
Format: decimal
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: climate.order
productJSONRequired within parentUnique ID for the Climate `Product` this order is purchasing.
product (anyOf 1)stringAlternativeMaximum length: 5000
product (anyOf 2)ModelAlternativeExpand Retrieve a product — climate get Climate Products Product — response body
product_substituted_atJSONOptional
product_substituted_at (anyOf 1)JSONAlternative
product_substituted_at (anyOf 1) (anyOf 1)integerAlternativeTime at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch.
Format: unix-time
product_substituted_at (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
product_substituted_at (anyOf 2)nullAlternative
statusstringRequired within parentThe current status of this order.
Known values: awaiting_funds, canceled, confirmed, delivered, open

Referenced models: Retrieve a product — climate get Climate Products Product — response body, Cancel an order — response body — beneficiary, Cancel an order — response body — delivery details item

Retrieve a product — climate get Climate Products Product — response body
FieldTypePresenceDescription and constraints
$objectRootA Climate product represents a type of carbon removal unit available for reservation.
You can retrieve it to see the current price and availability.
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
current_prices_per_metric_tonobjectRequired within parentCurrent prices for a metric ton of carbon removal in a currency's smallest unit.
Additional keys: see wildcard field
current_prices_per_metric_ton.*ModelAdditional keysExpand Retrieve a product — climate get Climate Products Product — response body — current prices per metric ton value
delivery_yearJSONOptional
delivery_year (anyOf 1)JSONAlternative
delivery_year (anyOf 1) (anyOf 1)integerAlternativeThe year in which the carbon removal is expected to be delivered. If the year is in the past, this represents spot inventory with guaranteed delivery.
delivery_year (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
delivery_year (anyOf 2)nullAlternative
idstringRequired within parentUnique identifier for the object. For convenience, Climate product IDs are human-readable strings
that start with `climsku_`. See [carbon removal inventory](https://stripe.com/docs/climate/orders/carbon-removal-inventory)
for a list of available carbon removal products.
Maximum length: 5000
livemodebooleanRequired within parentHas the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
metric_tons_availablestringRequired within parentThe quantity of metric tons available for reservation.
Format: decimal
namestringRequired within parentThe Climate product's name.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: climate.product
suppliersarrayRequired within parentThe carbon removal suppliers that fulfill orders for this Climate product.
suppliers[]ModelEach itemExpand Retrieve a supplier — response body

Referenced models: Retrieve a supplier — response body, Retrieve a product — climate get Climate Products Product — response body — current prices per metric ton value

Cancel an order — response body — beneficiary
FieldTypePresenceDescription and constraints
$objectRoot
public_namestringRequired within parentPublicly displayable name for the end beneficiary of carbon removal.
Maximum length: 5000

SDK function policy ID: stripe.postclimateordersordercancel. Catalog operation: PostClimateOrdersOrderCancel. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.