# prov.authorize.checkoutApprovals.create

prov.authorize.checkoutApprovals.create in Node SDK. Create a cart approval (201; 200 with `deduped` when your customer already has one pending).

## Signature

```ts
prov.authorize.checkoutApprovals.create(params: CreateCheckoutApprovalParams): Promise<CheckoutApproval>
```

## Parameters

- `params` (CreateCheckoutApprovalParams)

## Returns

`Promise<CheckoutApproval>`

## HTTP operation

[`POST /v1/authorize/checkout_approvals`](https://provenanceauth.com/docs/api/checkout-approvals.md#post-v1-authorize-checkout-approvals): Create a cart approval

## Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`cart_totals_mismatch`](https://provenanceauth.com/docs/platform/errors.md#cart_totals_mismatch)
- [`customer_routing_not_allowed`](https://provenanceauth.com/docs/platform/errors.md#customer_routing_not_allowed)
- [`idempotency_key_reused`](https://provenanceauth.com/docs/platform/errors.md#idempotency_key_reused)
- [`intent_token_refused`](https://provenanceauth.com/docs/platform/errors.md#intent_token_refused)
- [`plan_required`](https://provenanceauth.com/docs/platform/errors.md#plan_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

## Example

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/checkout_approvals`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "cart": {
      "order_id": "ord_8812",
      "total": 4250,
      "currency": "USD",
      "merchant_id": "harborbean",
      "origin": "https://harborbean.example",
      "items": [
        {
          "sku": "mug-sage",
          "name": "Stoneware mug",
          "quantity": 2,
          "unit_amount": 1900,
          "variant": [
            {
              "name": "Color",
              "value": "Sage"
            }
          ]
        }
      ],
      "adjustments": [
        {
          "kind": "shipping",
          "label": "Standard shipping",
          "amount": 650
        },
        {
          "kind": "discount",
          "label": "WELCOME",
          "amount": -200
        }
      ],
      "fulfillment": {
        "method_label": "Standard shipping",
        "estimate_from": "2026-11-02",
        "estimate_to": "2026-11-05"
      }
    },
    "display": {
      "merchant_name": "Harbor Bean"
    },
    "retry_url": "https://harborbean.example/checkout",
    "billing_address": {
      "line1": "18 Harrow Lane",
      "line2": null,
      "city": "Portland",
      "region": "OR",
      "postal_code": "97205",
      "country": "US"
    },
    "contact": {
      "name": "Maya Chen"
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/checkout_approvals", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "cart": {
        "order_id": "ord_8812",
        "total": 4250,
        "currency": "USD",
        "merchant_id": "harborbean",
        "origin": "https://harborbean.example",
        "items": [
            {
                "sku": "mug-sage",
                "name": "Stoneware mug",
                "quantity": 2,
                "unit_amount": 1900,
                "variant": [
                    {
                        "name": "Color",
                        "value": "Sage"
                    }
                ]
            }
        ],
        "adjustments": [
            {
                "kind": "shipping",
                "label": "Standard shipping",
                "amount": 650
            },
            {
                "kind": "discount",
                "label": "WELCOME",
                "amount": -200
            }
        ],
        "fulfillment": {
            "method_label": "Standard shipping",
            "estimate_from": "2026-11-02",
            "estimate_to": "2026-11-05"
        }
    },
    "display": {
        "merchant_name": "Harbor Bean"
    },
    "retry_url": "https://harborbean.example/checkout",
    "billing_address": {
        "line1": "18 Harrow Lane",
        "line2": None,
        "city": "Portland",
        "region": "OR",
        "postal_code": "97205",
        "country": "US"
    },
    "contact": {
        "name": "Maya Chen"
    }
}).json()
```
