Customers

Update a Customer

Update an existing Customer with the provided details

post/customers/{id}

Path parameters

idstring required

Request body

metadataobject nullable

Metadata used by merchants to store additional information about the entity.

emailstring email

The customer's email. Stored lowercased.

namestring

The customer's name

phoneNumberstring

The customer's phone number

dateOfBirthstring date-time

The customer's date of birth

gender'male' | 'female' | 'other'

The customer's gender

Example request

{
  "metadata": {
    "orderId": "12345",
    "notes": "Urgent delivery"
  },
  "email": "user@gmail.com",
  "name": "John Doe",
  "phoneNumber": "+1234567890",
  "dateOfBirth": "2020-01-01",
  "gender": "male"
}

Response

OK

createdAtstring date-time required

The date and time when the entity was created.

updatedAtstring date-time nullable required

The date and time when the entity was last updated.

metadataobject nullable

Metadata used by merchants to store additional information about the entity.

idstring required

The ID of the customer

emailstring required

The email of the customer

namestring nullable required

The name of the customer

phoneNumberstring nullable required

The phone number of the customer

dateOfBirthstring date nullable required

The date of birth of the customer

gender'male' | 'female' | 'other' | 'null' nullable required

The gender of the customer

restrictMitboolean

Whether the customer is restricted from making merchant-initiated payments. Only available from the dashboard or the API using a secret key.

restrictCitboolean

Whether the customer is restricted from making customer-initiated payments. Only available from the dashboard or the API using a secret key.

restrictReasonstring nullable

Reason for restricting the customer. Only available from the dashboard or the API using a secret key.

isRestrictedboolean

Whether the customer has at least one restriction applied (either restrictMit or restrictCit). Only available from the dashboard or the API using a secret key.

Example response

{
  "createdAt": "2024-02-18T12:00:00Z",
  "updatedAt": "2024-02-21T12:15:00Z",
  "metadata": {
    "key1": "value1",
    "key2": "value2"
  },
  "id": "cus_2QC7PqoUeOxQEWscJJt6B3PkvyL",
  "email": "user@gmail.com",
  "name": "John Doe",
  "phoneNumber": "+1234567890",
  "dateOfBirth": "2020-01-01",
  "gender": "male",
  "restrictReason": "Customer restricted due to suspicious activity",
  "isRestricted": true,
  "paymentMethods": [
    {
      "createdAt": "2024-02-18T12:00:00Z",
      "updatedAt": "2024-02-21T12:15:00Z",
      "metadata": {
        "key1": "value1",
        "key2": "value2"
      },
      "id": "pm_2QC7PqoUeOxQEWscJJt6B3PkvyL",
      "type": "card",
      "customer": "cus_2QC7PqoUeOxQEWscJJt6B3PkvyL",
      "card": {
        "brand": "amex",
        "lastFour": "1234",
        "bin": "123456",
        "expMonth": "12",
        "expYear": "2025",
        "cardholderName": "John Doe"
      },
      "applePay": {
        "displayName": "MasterCard 1234"
      }
    }
  ],
  "subscriptions": [
    {
      "createdAt": "2024-02-18T12:00:00Z",
      "updatedAt": "2024-02-21T12:15:00Z",
      "metadata": {
        "key1": "value1",
        "key2": "value2"
      },
      "id": "sub_2QC7PqoUeOxQEWscJJt6B3PkvyL",
      "status": "active",
      "autoBillingEnabled": true,
      "autoBillingDisabledReason": "subscription_cancelled",
      "cancelAtPeriodEnd": true,
      "cancelAtCycle": 2,
      "currentCycle": 1,
      "billingSettings": {
        "captureDelay": 3
      },
      "upcomingInvoice": {
        "amount": 1500,
        "currency": "usd",
        "periodStart": "2023-01-01T00:00:00Z",
        "periodEnd": "2023-01-31T23:59:59Z",
        "statementDescriptor": "SUBSCRIPTION",
        "comment": "Invoice for subscription 123, period January 2023"
      },
      "price": {
        "createdAt": "2024-02-18T12:00:00Z",
        "updatedAt": "2024-02-21T12:15:00Z",
        "metadata": {
          "key1": "value1",
          "key2": "value2"
        },
        "id": "price_2R4e2xDqbww8ewmkIYWE1A6Zcfp",
        "type": "recurring",
        "active": true,
        "name": "My Digital Subscription",
        "amount": 1500,
        "quantity": 1,
        "currency": "usd",
        "product": {
          "createdAt": "2024-02-18T12:00:00Z",
          "updatedAt": "2024-02-21T12:15:00Z",
          "metadata": {
            "key1": "value1",
            "key2": "value2"
          },
          "id": "prod_2QC7PqoUeOxQEWscJJt6B3PkvyL",
          "active": true,
          "name": "My product",
          "description": "Best selling product",
          "statementDescriptor": "Face Yoga subscription",
          "category": "digital",
          "sku": "FY-YOGA-MAT-01"
        },
        "billingSchedule": {
          "createdAt": "2024-02-18T12:00:00Z",
          "updatedAt": "2024-02-21T12:15:00Z",
          "metadata": {
            "key1": "value1",
            "key2": "value2"
          },
          "id": "bsch_2QC7PqoUeOxQEWscJJt6B3PkvyL",
          "currency": "usd",
          "cycleDefinitions": [
            {
              "createdAt": "2024-02-18T12:00:00Z",
              "updatedAt": "2024-02-21T12:15:00Z",
              "metadata": {
                "key1": "value1",
                "key2": "value2"
              },
              "position": 1,
              "amount": 1500,
              "currency": "usd"
            }
          ]
        },
        "recurringSchedule": {
          "intervalUnit": "month",
          "intervalCount": 1,
          "trial": {
            "intervalUnit": "day",
            "intervalCount": 7,
            "amount": 199
          }
        }
      },
      "invoices": [
        {
          "createdAt": "2024-02-18T12:00:00Z",
          "updatedAt": "2024-02-21T12:15:00Z",
          "metadata": {
            "key1": "value1",
            "key2": "value2"
          },
          "status": "open",
          "voidedReason": "Grace period expired",
          "comment": "This is a comment for the invoice",
          "amount": 999,
          "currency": "usd",
          "type": "setup",
          "number": "2W12-1004",
          "customer": {
            "createdAt": "2024-02-18T12:00:00Z",
            "updatedAt": "2024-02-21T12:15:00Z",
            "metadata": {
              "key1": "value1",
              "key2": "value2"
            },
            "id": "cus_2QC7PqoUeOxQEWscJJt6B3PkvyL",
            "email": "user@gmail.com",
            "name": "John Doe",
            "phoneNumber": "+1234567890",
            "dateOfBirth": "2020-01-01",
            "gender": "male",
            "restrictReason": "Customer restricted due to suspicious activity",
            "isRestricted": true
          }
        }
      ]
    }
  ]
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.