Vatly
Python Fluent

Create and find customers

Bind a host user to a Vatly billing identity once, then reuse it.

Bind a host user to a Vatly billing identity once, then reuse it. Bindings require the configured storage driver; examples accept vatly from Configuration.

Create a customer for a host user

from vatly import RequestOptions
from vatly_fluent import CustomerProfile, Vatly


async def example(vatly: Vatly):
    return await vatly.customers.create_for(
        "user-42",
        CustomerProfile(email="buyer@example.com", name="Alex"),
        options=RequestOptions(idempotency_key="signup:user-42"),
    )

create_for rejects an already-bound host. To reuse an existing customer, authorize its ID then call await vatly.customers.attribute(customer_id, host_id) instead. Conflicting bindings fail rather than silently moving customers between users.

Profile fieldMeaning
vatly_idExisting authorized customer, used by checkout builders
emailRequired when creating a new customer
nameOptional communication name

An email-only checkout profile does not create a customer. Explicitly create it first if you need a durable binding. Bindings do not assign order ownership.

Look up and refresh identity

from vatly_fluent import Vatly


async def example(vatly: Vatly):
    found = await vatly.customers.find_one_by_email("buyer@example.com")
    handle = vatly.customer("customer_example")
    identity = await handle.identity()
    await handle.update({"name": "Alex Morgan"})
    await handle.sync()
    return found, identity, await handle.email()

model(), name(), email() and identity() share a cached snapshot. sync() and update() refresh it. Name/email are not invoice address fields; use the portal for hosted billing management.

LookupReturn
find_by_host_customer_idCustomer or None
find_by_vatly_customer_idCustomer, or the SDK's not-found error
find_by_emailAsync iterator of matching customers
find_one_by_emailFirst match or None, not a global identity assertion

claim_customer_from_checkout is only for an already host-authorized checkout; it binds billing identity, not entitlements. Never accept arbitrary buyer-supplied IDs.

Customer API reference

Copyright © 2026