# Create a customer

Creates a new customer object. You can attach a card to the customer so it can be reused for [recurring charges](/docs/api/shift4-gateway/charges/createcharge).

Endpoint: POST /customers
Version: 1.0.0
Security: BasicAuth

## Request fields (application/x-www-form-urlencoded):

  - `email` (string, required)
    Customer email address.
    Example: john.doe@example.com

  - `phoneNumber` (string)
    Customer phone number.
    Example: +14155550132

  - `description` (string)
    An arbitrary description for the customer.
    Example: Premium customer

  - `card` (any)

  - `card.number` (string, required)
    The card number.
    Example: 4242424242424242

  - `card.expMonth` (string, required)
    Two-digit expiration month.
    Example: 12

  - `card.expYear` (string, required)
    Four-digit expiration year.
    Example: 2030

  - `card.cvc` (string, required)
    Card verification code.
    Example: 123

  - `card.cardholderName` (string)
    Name of the cardholder.
    Example: John Doe

  - `card.addressLine1` (string)
    Example: 1234 Market St

  - `card.addressLine2` (string)
    Example: Suite 500

  - `card.addressCity` (string)
    Example: San Francisco

  - `card.addressState` (string)
    Example: CA

  - `card.addressZip` (string)
    Example: 94103

  - `card.addressCountry` (string)
    Country represented as a three-letter ISO country code.
    Example: USA

  - `card.fraudCheckData` (object)
    Additional data used for fraud protection.

  - `card.fraudCheckData.ipAddress` (string)
    IP address of the user.
    Example: 203.0.113.42

  - `card.fraudCheckData.ipCountry` (string)
    Country derived from the user's IP address (two-letter ISO country code).
    Example: US

  - `card.fraudCheckData.email` (string)
    E-mail address of the user.
    Example: john.doe@example.com

  - `card.fraudCheckData.phone` (string)
    Phone number of the user.
    Example: +14155550132

  - `card.fraudCheckData.userAgent` (string)
    Value of the "User-Agent" HTTP header sent by the user.
    Example: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36

  - `card.fraudCheckData.acceptLanguage` (string)
    Value of the "Accept-Language" HTTP header sent by the user.
    Example: en-US,en;q=0.9

  - `card.fraudCheckData.browserFingerprint` (string)
    Hashed device identifier, available if Shift4.js was used to create the token.
    Example: 35a05229011ab99930545a2e1b2edc4e

  - `billing` (object)
    Billing details to store on the customer.

  - `billing.name` (string)
    Example: John Doe

  - `billing.email` (string)
    Example: john.doe@example.com

  - `billing.phone` (string)
    Example: +14155550132

  - `billing.vat` (string)
    Tax identification number
    Example: US123456789

  - `billing.address` (object)
    A postal address.

  - `billing.address.line1` (string)
    Example: 1234 Market St

  - `billing.address.line2` (string)
    Example: Suite 500

  - `billing.address.zip` (string)
    Example: 94103

  - `billing.address.city` (string)
    Example: San Francisco

  - `billing.address.state` (string)
    Example: CA

  - `billing.address.country` (string)
    Two-letter ISO 3166-1 country code
    Example: US

  - `paymentMethod` (object)
    A payment method to attach to the customer.

  - `paymentMethod.type` (string, required)
    The type of the payment method (for example `ach`, `blik`, `ideal`).
    Example: ideal

## Response 200 fields (application/json):

  - `id` (string)
    Unique identifier for the customer
    Example: cust_AoR0wvgntQWRUYMdZNLYMz5R

  - `created` (integer)
    Unix timestamp when the customer was created
    Example: 1711929600

  - `objectType` (string)
    Object type identifier
    Enum: "customer"

  - `email` (string)
    Customer email address
    Example: john.doe@example.com

  - `phoneNumber` (string)
    Customer phone number
    Example: +14155550132

  - `description` (string)
    Optional description
    Example: Premium customer

  - `defaultCardId` (string)
    ID of the default card used for charges created for this customer
    Example: card_8P7OWXA5xiTS1ISnyZcum1KV

  - `defaultPaymentMethodId` (string)
    ID of the default payment method used for charges created for this customer
    Example: pm_ORVCP4nH7Lk2QkYp

  - `billing` (object)
    Billing details associated with the customer.

  - `billing.name` (string)
    Example: John Doe

  - `billing.email` (string)
    Example: john.doe@example.com

  - `billing.phone` (string)
    Example: +14155550132

  - `billing.vat` (string)
    Tax identification number
    Example: US123456789

  - `billing.address` (object)
    A postal address.

  - `billing.address.line1` (string)
    Example: 1234 Market St

  - `billing.address.line2` (string)
    Example: Suite 500

  - `billing.address.zip` (string)
    Example: 94103

  - `billing.address.city` (string)
    Example: San Francisco

  - `billing.address.state` (string)
    Example: CA

  - `billing.address.country` (string)
    Two-letter ISO 3166-1 country code
    Example: US

  - `cards` (array)
    List of cards associated with this customer

  - `cards.id` (string)
    Unique identifier for the card
    Example: card_8P7OWXA5xiTS1ISnyZcum1KV

  - `cards.created` (integer)
    Unix timestamp
    Example: 1711929600

  - `cards.objectType` (string)
    Enum: "card"

  - `cards.first6` (string)
    First six digits of the card number
    Example: 424242

  - `cards.last4` (string)
    Last four digits of the card number
    Example: 4242

  - `cards.fingerprint` (string)
    Unique fingerprint for this card number
    Example: e3d8suyIDgFg3pE7

  - `cards.expMonth` (string)
    Two-digit expiration month
    Example: 12

  - `cards.expYear` (string)
    Four-digit expiration year
    Example: 2027

  - `cards.cardholderName` (string)
    Name of the cardholder
    Example: John Doe

  - `cards.brand` (string)
    Card brand
    Enum: "Visa", "MasterCard", "American Express", "Discover", "JCB", "Diners Club", "Unknown"

  - `cards.type` (string)
    Card type
    Enum: "Credit Card", "Debit Card", "Prepaid Card", "Unknown"

  - `cards.country` (string)
    Two-letter ISO 3166-1 country code of the card's issuing country
    Example: US

  - `cards.issuer` (string)
    Name of the bank that issued the card
    Example: Card Issuer Name

  - `cards.customerId` (string)
    ID of the customer this card belongs to, if any
    Example: cust_AoR0wvgntQWRUYMdZNLYMz5R

  - `cards.fraudCheckData` (object)
    Fraud-protection data captured when the card was created.

  - `cards.fraudCheckData.ipAddress` (string)
    IP address of the user.
    Example: 203.0.113.42

  - `cards.fraudCheckData.ipCountry` (string)
    Country derived from the user's IP address (two-letter ISO country code).
    Example: US

  - `cards.fraudCheckData.email` (string)
    E-mail address of the user.
    Example: john.doe@example.com

  - `cards.fraudCheckData.phone` (string)
    Phone number of the user.
    Example: +14155550132

  - `cards.fraudCheckData.userAgent` (string)
    Value of the "User-Agent" HTTP header sent by the user.
    Example: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36

  - `cards.fraudCheckData.acceptLanguage` (string)
    Value of the "Accept-Language" HTTP header sent by the user.
    Example: en-US,en;q=0.9

  - `cards.fraudCheckData.browserFingerprint` (string)
    Hashed device identifier, available if Shift4.js was used to create the token.
    Example: 35a05229011ab99930545a2e1b2edc4e

  - `cards.merchantAccountId` (string)
    Identifier of the merchant account used to create this card.
    Example: ma_RHCN1yhubdBpSCgKcYAGb0xH

  - `cards.addressLine1` (string)
    First line of the billing address associated with the card.
    Example: 1234 Market St

  - `cards.addressLine2` (string)
    Second line of the billing address associated with the card.
    Example: Suite 500

  - `cards.addressCity` (string)
    City of the billing address associated with the card.
    Example: San Francisco

  - `cards.addressState` (string)
    State of the billing address associated with the card.
    Example: CA

  - `cards.addressZip` (string)
    ZIP or postal code of the billing address associated with the card.
    Example: 94103

  - `cards.addressCountry` (string)
    Country of the billing address associated with the card, represented as a three-letter ISO country code.
    Example: USA

  - `cards.fastCredit` (object)
    Fast credit (fast payout) support status for this card.

  - `cards.fastCredit.supported` (boolean)
    Indicates whether the card supports fast credit.
    Example: true

  - `cards.fastCredit.updated` (integer)
    Unix timestamp of the last time the fast credit status was refreshed.
    Example: 1701432000

## Response 400 fields (application/json):

  - `error` (object)

  - `error.type` (string)
    Error type
    Enum: "invalid_request", "card_error", "gateway_error"

  - `error.code` (string)
    Machine-readable error code
    Example: invalid_number

  - `error.message` (string)
    Human-readable error message
    Example: Requested object does not exist

  - `error.chargeId` (string)
    ID of the charge associated with this error (if applicable)
    Example: char_ORVCrwOrTkGsDwM3H50OIW7Q

## Response 402 fields (application/json):

  - `error` (object)

  - `error.type` (string)
    Error type
    Enum: "invalid_request", "card_error", "gateway_error"

  - `error.code` (string)
    Machine-readable error code
    Example: invalid_number

  - `error.message` (string)
    Human-readable error message
    Example: Requested object does not exist

  - `error.chargeId` (string)
    ID of the charge associated with this error (if applicable)
    Example: char_ORVCrwOrTkGsDwM3H50OIW7Q

