---
title: "Create a customer"
canonical_url: "https://twominutebilling.com/help/developers/api-reference/customers/create-a-customer"
---
# Create a customer

<api-operation method="POST" path="/v1/businesses/{biz}/customers">
<template v-slot:docs="">

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Business id (biz_…)
    </td>
  </tr>
</tbody>
</table>

## Headers

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        Idempotency-Key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Safely retry writes — repeats return the original response. If a write FAILED after it had already taken effect, that failure is what repeats: the key is spent, and a new attempt needs a new key.
    </td>
  </tr>
</tbody>
</table>

## Body

The request body is **required**.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        credit_settings
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Credit policy for this customer: an override of what happens when credit is used up (ignored after <code>
        override_expires_at
      </code>
      
      ), and an overdraft limit per currency. Replaced whole; null = the business's settings.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        credit_settings.on_exhausted
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      What happens when the credit is used up, for a business with blocking on. Null = not set here. One of <code>
        block
      </code>
      
      , <code>
        bill
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        credit_settings.override_expires_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The override expires time (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        credit_settings.overdraft_limit_minor
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Per currency (<code>
        {"USD": 500}
      </code>
      
      ).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Choose the customer's id instead of a generated <code>
        cus_…
      </code>
      
      . Unique within the business: an id already in use returns 409.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The customer's email address.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        first_name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The ACCOUNT HOLDER. With last_name/company this is how a customer is named — there is no flat <code>
        name
      </code>
      
       field: sending one returns 400.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        last_name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The customer's last name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        company
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The customer's company name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        currency
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The customer's currency (ISO-4217 code).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        address
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The customer's address.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        address.line1
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      First line of the address.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        address.city
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The city.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        address.state
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The state or region.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        address.postal_code
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The postal code.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        address.country
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The country (ISO-3166 alpha-2 code).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tax_exempt
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Short-circuits tax to 0 with reason customer_exempt
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email_notifications
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      false stops automatic billing emails to this customer. Emails an operator sends explicitly still go out. Default true.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        dunning_excluded
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      true excludes this customer from dunning: a failed payment does not start dunning, and invoices already in dunning get no further retries or reminders. The first automatic payment attempt on a new invoice still runs. Time does not pass for dunning while the customer is excluded: setting false resumes dunning on those invoices, and every remaining retry, reminder and final action moves later by the length of the exclusion. Default false.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        exclude_from_reporting
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      true leaves this customer out of every metric and report: MRR, churn, revenue, payments, analytics and exports. Use it for internal and test accounts. Billing is not affected. A change restates the stored figures in the background. Default false.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        billing_cc_emails
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Addresses copied (CC) on this customer's invoice, receipt and credit note emails, in addition to contacts with <code>
        send_billing_email
      </code>
      
      . Default empty.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        billing_bcc_emails
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Addresses blind-copied (BCC) on this customer's invoice, receipt and credit note emails. Default empty.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tax_behavior
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Whether this customer's prices include tax. Set, it applies to every taxed line on the customer's invoices, whatever the price says. Default null: each price decides. One of <code>
        inclusive
      </code>
      
      , <code>
        exclusive
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        dunning_policy
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The dunning policy (dpol_…) for this customer's invoices. Absent or null: the business dunning settings. dunning_excluded still applies first.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        vat_number
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      B2B / reverse-charge registration number
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        withholding_rate_bps
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      TDS: payer withholds this % of the net base (1000 = 10%)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        custom_fields
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Custom-field values; or pass top-level cf_<name> params
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        credit_settings
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      Credit policy for this customer: an override of what happens when credit is used up (ignored after <code>
        override_expires_at
      </code>
      
      ), and an overdraft limit per currency. Replaced whole; null = the business's settings.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The customer's id (cus_…).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The customer's email address.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      DERIVED, read-only (deprecated 2026-08-23): <code>
        first_name last_name
      </code>
      
      , else <code>
        company
      </code>
      
      , else null. There is no <code>
        customer.name
      </code>
      
       any more — sending this field to create or update returns 400. It is emitted only so a caller has a flat display string. Two distinct identities exist and neither is derived from the other: <code>
        first_name
      </code>
      
      /<code>
        last_name
      </code>
      
      /<code>
        company
      </code>
      
       are the ACCOUNT HOLDER (lists, emails, portal greeting), while <code>
        address.first_name
      </code>
      
      /<code>
        last_name
      </code>
      
      /<code>
        company
      </code>
      
       are the BILLING CONTACT, which is what gets printed on invoices and credit notes and sent to the gateway as the billing name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        currency
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The currency the operator pinned on the customer, if any. Prefer effective_currency when deciding what to transact in.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        effective_currency
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      DERIVED, read-only: the currency to transact in — <code>
        currency
      </code>
      
       when the operator set one, else the currency of the customer's live (active/in_trial) subscriptions, highest MRR winning a tie. Emitted by GET (detail) and by the list; absent from create/patch/archive responses. Null when there is nothing to derive from — fall back to the business default. Never write it back to <code>
        currency
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        lifetime_revenue
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      DERIVED, read-only: cash collected from this customer, one entry per currency — succeeded payments minus succeeded refunds. Credits applied to invoices are not cash and are excluded. Emitted by GET (detail) only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tax_exempt
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True if the customer is exempt from tax.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email_notifications
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Whether the customer gets billing emails.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        marketing_opt_in
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      The customer's answer to the marketing opt-in at checkout. Null when they were never asked.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        marketing_opt_in_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      The marketing opt in time (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        dunning_excluded
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True if the customer is excluded from dunning.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        exclude_from_reporting
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True if the customer is left out of metrics and reports.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        billing_cc_emails
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      Addresses copied on the customer's invoice and receipt emails.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        billing_bcc_emails
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      Addresses blind-copied on the customer's invoice and receipt emails.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tax_behavior
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Whether every taxed line for this customer is inclusive or exclusive. Null = each price decides. One of <code>
        inclusive
      </code>
      
      , <code>
        exclusive
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        dunning_policy
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The customer's dunning policy.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        vat_number
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The customer's VAT number.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        withholding_rate_bps
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The withholding rate on the customer's payments, in basis points (100 = 1%).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        custom_fields
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      Stored custom-field values; also flattened onto the object as cf_<name>
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        201
      </code>
    </td>
    
    <td>
      Created
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      Invalid body
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        409
      </code>
    </td>
    
    <td>
      Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload.
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X POST "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/customers" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "maya@example.com",
    "first_name": "Maya",
    "last_name": "Castillo"
  }'
```

</template>

<template v-slot:response="">
<code-group>

```json [201 Created]
{
  "credit_settings": {
    "on_exhausted": "block",
    "override_expires_at": "2026-04-14T09:30:00Z",
    "overdraft_limit_minor": {}
  },
  "object": "customer",
  "id": "cus_XXXXXXXXXXXX01",
  "email": "maya@example.com",
  "name": "Maya Castillo",
  "currency": "USD",
  "effective_currency": "USD",
  "lifetime_revenue": [
    {
      "currency": "USD",
      "amount_minor": 2900,
      "paid_invoices_count": 1,
      "first_paid_at": "2026-03-14T09:30:00Z"
    }
  ],
  "tax_exempt": false,
  "email_notifications": false,
  "marketing_opt_in": false,
  "marketing_opt_in_at": "2026-03-14T09:30:00Z",
  "dunning_excluded": false,
  "exclude_from_reporting": false,
  "billing_cc_emails": [
    "maya@example.com"
  ],
  "billing_bcc_emails": [
    "maya@example.com"
  ],
  "tax_behavior": "inclusive",
  "dunning_policy": "Dunning policy",
  "vat_number": "EU123456789",
  "withholding_rate_bps": 1000,
  "custom_fields": {
    "cf_region": "West"
  }
}
```

```json [400 Bad Request]
{
  "error": {
    "type": "invalid_request_error",
    "message": "Invalid body"
  }
}
```

```json [409 Conflict]
{
  "error": {
    "type": "idempotency_error",
    "message": "Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload."
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
