Customers
Overview
Available Operations
- get_or_create - Creates a customer if they do not exist, or returns the existing customer by your external customer ID.
Use this as the primary entrypoint before billing operations so the customer record is always present and up to date.
- list - Lists customers with pagination and optional filters.
- update - Updates an existing customer by ID.
- delete - Deletes a customer by ID.
get_or_create
Creates a customer if they do not exist, or returns the existing customer by your external customer ID.
Use this as the primary entrypoint before billing operations so the customer record is always present and up to date.
Example Usage
Parameters
| Parameter |
Type |
Required |
Description |
customer_id |
Nullable[str] |
✔️ |
N/A |
name |
OptionalNullable[str] |
➖ |
Customer's name |
email |
OptionalNullable[str] |
➖ |
Customer's email address |
fingerprint |
OptionalNullable[str] |
➖ |
Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse |
metadata |
Dict[str, Any] |
➖ |
Additional metadata for the customer |
stripe_id |
OptionalNullable[str] |
➖ |
Stripe customer ID if you already have one |
create_in_stripe |
Optional[bool] |
➖ |
Whether to create the customer in Stripe |
auto_enable_plan_id |
Optional[str] |
➖ |
The ID of the free plan to auto-enable for the customer |
send_email_receipts |
Optional[bool] |
➖ |
Whether to send email receipts to this customer |
expand |
List[models.CustomerExpand] |
➖ |
Customer expand options |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Response
models.Customer
Errors
| Error Type |
Status Code |
Content Type |
| errors.AutumnDefaultError |
4XX, 5XX |
*/* |
list
Lists customers with pagination and optional filters.
Example Usage
Parameters
Response
models.ListCustomersResponse
Errors
| Error Type |
Status Code |
Content Type |
| errors.AutumnDefaultError |
4XX, 5XX |
*/* |
update
Updates an existing customer by ID.
Example Usage
Parameters
| Parameter |
Type |
Required |
Description |
customer_id |
str |
✔️ |
ID of the customer to update |
name |
OptionalNullable[str] |
➖ |
Customer's name |
email |
OptionalNullable[str] |
➖ |
Customer's email address |
fingerprint |
OptionalNullable[str] |
➖ |
Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse |
metadata |
Dict[str, Any] |
➖ |
Additional metadata for the customer |
stripe_id |
OptionalNullable[str] |
➖ |
Stripe customer ID if you already have one |
send_email_receipts |
Optional[bool] |
➖ |
Whether to send email receipts to this customer |
new_customer_id |
Optional[str] |
➖ |
Your unique identifier for the customer |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Response
models.UpdateCustomerResponse
Errors
| Error Type |
Status Code |
Content Type |
| errors.AutumnDefaultError |
4XX, 5XX |
*/* |
delete
Deletes a customer by ID.
Example Usage
Parameters
| Parameter |
Type |
Required |
Description |
customer_id |
str |
✔️ |
ID of the customer to delete |
delete_in_stripe |
Optional[bool] |
➖ |
Whether to also delete the customer in Stripe |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Response
models.DeleteCustomerResponse
Errors
| Error Type |
Status Code |
Content Type |
| errors.AutumnDefaultError |
4XX, 5XX |
*/* |