Easy Labs
SDKsPythonResources

Checkout

Checkout — methods, parameters, and examples for easy-sdk (pip).

The client.checkout resource creates a one-shot, server-side checkout that combines a payment, an order, and (optionally) subscriptions in a single API call. Use it when you already have a tokenized payment instrument and want to charge + record + subscribe atomically.

Namespace: client.checkout.

Other checkout surfaces live next door:

Methods

create

result = client.checkout.create(
    customer={
        "first_name": "Ada",
        "last_name": "Lovelace",
        "email": "ada@example.com",
    },
    payment_instrument={
        "type": "PAYMENT_CARD",
        "name": "Ada Lovelace",
        "token_id": "tok_abc",
    },
    items=[
        {"price_id": "price_widget", "quantity": 2},
    ],
    idempotency_key="checkout-cart-2025-01-01-001",
)

print(result.transfer.id if result.transfer else None)
print(result.order_id)

Returns: CheckoutResponse. All fields are accepted via **kwargs; see the Easy Labs API reference for the full request schema.

Object shape

CheckoutResponse:

FieldTypeNotes
transferTransfer | NoneThe charge created by the call.
order_idstr | None (alias orderId)The Order produced (look up with client.orders.retrieve).
subscriptionslist[dict[str, Any]] | NoneAny subscriptions started in the same call.
orderdict[str, Any] | NoneFull order payload when expanded.
customerdict[str, Any] | NoneThe customer that was created or matched.

Examples

Charge a returning customer with a saved instrument

result = client.checkout.create(
    identity_id="ident_123",
    payment_instrument_id="pi_abc",
    items=[{"price_id": "price_widget", "quantity": 1}],
    idempotency_key=f"order-{order_id}",
)

if result.transfer and result.transfer.state == "SUCCEEDED":
    fulfill_order(result.order_id)

Combine a one-time charge with a subscription start

result = client.checkout.create(
    customer={"first_name": "Ada", "last_name": "L.", "email": "a@b.c"},
    payment_instrument={"type": "PAYMENT_CARD", "name": "Ada", "token_id": "tok_abc"},
    items=[{"price_id": "price_setup_fee", "quantity": 1}],
    subscriptions=[{"items": [{"price_id": "price_monthly"}]}],
    idempotency_key="signup-ada-2025-01-01",
)

setup_charge = result.transfer
new_subs = result.subscriptions or []

On this page