---
title: "POST /api/customers/"
method: POST
path: "/api/customers/"
tags: ["api"]
---

# POST /api/customers/

`POST /api/customers/`

A simple ViewSet for viewing and editing Customers.

## Request body

- CustomerCreateRequest
  - `customer_name` string, nullable — The display name of the customer
  - `customer_id` string, required — The id provided when creating the customer, we suggest matching with your internal customer id in your backend
  - `email` string, email, required — The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider
  - `payment_provider` 'stripe' — The payment provider this customer is associated with. Currently, only Stripe is supported.
  - `payment_provider_id` string, nullable — The customer's ID in the specified payment provider. Please note that payment_provider and payment_provider_id are mutually necessary.
  - `properties` object, nullable — Extra metadata for the customer
  - `default_currency_code` string — The currency code this customer will be invoiced in. Codes are 3 letters, e.g. 'USD'.
  - `address` AddressRequest
    - `city` string, required — City, district, suburb, town, or village
    - `country` string, required — ISO 3166-1 alpha-2 country code
    - `line1` string, required — Address line 1 (e.g., street, PO Box, or company name)
    - `line2` string, nullable — Address line 2 (e.g., apartment, suite, unit, or building)
    - `postal_code` string, required — ZIP or postal code
    - `state` string, required — State, county, province, or region
  - `tax_rate` number, double, nullable — Tax rate as percentage. For example, 10.5 for 10.5%

## Response `200`

- Customer
  - `customer_id` string, required
  - `email` string, email, required
  - `customer_name` string, required
  - `invoices` LightweightInvoice[], required
    - `end_date` string, date, required
    - `issue_date` string, date-time, required
    - `start_date` string, date, required
    - `invoice_number` string, required
    - `cost_due` number, double, required
    - `currency` PricingUnit, required
      - `code` string, required
      - `name` string, required
      - `symbol` string, required
    - `external_payment_obj_id` string, nullable, required
    - `seller` Seller, required
      - `name` string, required
      - `address` Address
        - `city` string, required — City, district, suburb, town, or village
        - `country` string, required — ISO 3166-1 alpha-2 country code
        - `line1` string, required — Address line 1 (e.g., street, PO Box, or company name)
        - `line2` string, nullable — Address line 2 (e.g., apartment, suite, unit, or building)
        - `postal_code` string, required — ZIP or postal code
        - `state` string, required — State, county, province, or region
      - `phone` string, nullable
      - `email` string, email, nullable
    - `external_payment_obj_type` 'stripe' | 'null', nullable, required
    - `payment_status` 'paid' | 'unpaid', required
    - `due_date` string, date-time, nullable, required
  - `total_amount_due` number, double, required
  - `subscriptions` SubscriptionRecord[], required
    - `start_date` string, date-time, required — The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
    - `end_date` string, date-time, required — The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
    - `auto_renew` boolean, required — Whether the subscription automatically renews. Defaults to true.
    - `is_new` boolean, required — Whether this subscription came from a renewal or from a first-time. Defaults to true on creation.
    - `subscription_filters` SubscriptionCategoricalFilter[], required
      - `value` string, required
      - `property_name` string, required — The string name of the property to filter on. Example: 'product_id'
    - `customer` LightweightCustomer, required
      - `customer_name` string, nullable, required — The display name of the customer
      - `email` string, email, nullable, required — The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider
      - `customer_id` string, required — The id provided when creating the customer, we suggest matching with your internal customer id in your backend
    - `billing_plan` LightweightPlanVersion, required
      - `plan_name` string, required
      - `plan_id` string, required
      - `version` integer, required
    - `fully_billed` boolean, required — Whether the subscription has been fully billed and finalized.
  - `integrations` CustomerIntegrations, required
    - `stripe` CustomerStripeIntegration
      - `stripe_id` string, required
      - `has_payment_method` boolean, required
  - `default_currency` PricingUnit, required
    - `code` string, required
    - `name` string, required
    - `symbol` string, required
  - `payment_provider` 'stripe' | 'null', nullable, required
  - `has_payment_method` boolean, required
  - `address` Address
    - `city` string, required — City, district, suburb, town, or village
    - `country` string, required — ISO 3166-1 alpha-2 country code
    - `line1` string, required — Address line 1 (e.g., street, PO Box, or company name)
    - `line2` string, nullable — Address line 2 (e.g., apartment, suite, unit, or building)
    - `postal_code` string, required — ZIP or postal code
    - `state` string, required — State, county, province, or region
  - `tax_rate` number, double, nullable — Tax rate as percentage. For example, 10.5 for 10.5%

## Changes

- **2023-01-16** `36b48cae00a3` — 766 breaking, 12 warning, 7 info
  - the request property `address/allOf[#/components/schemas/AddressRequest]/state` became not nullable (media type: application/json)
  - the request property `address/allOf[#/components/schemas/AddressRequest]/state` became not nullable (media type: application/x-www-form-urlencoded)
  - the request property `address/allOf[#/components/schemas/AddressRequest]/state` became not nullable (media type: multipart/form-data)
  - the request property `customer_id` became not nullable (media type: application/json)
  - …781 more

[Change history](https://skmtc.dev/uselotus/apis/lotus-api/changes/api/customers/post.md)

---

[API](https://skmtc.dev/uselotus/apis/lotus-api.md) · [All operations](https://skmtc.dev/uselotus/apis/lotus-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/uselotus/lotus-api/revisions/36b48cae00a3/schema)
