Create and update a customer

  • Customers
  • Customer account
  • 3 routes
How do I create a customer and then complete the profile?

This scenario explains how to create a new customer account, read the resulting profile, and update the customer data needed by downstream journeys. It fits CRM, assisted-sales, and onboarding flows that must secure a reusable customer record before quotation or booking.

The flow starts with customer creation, reuses the returned customer_id, then reads and updates the profile in a controlled way.

Overview

This scenario helps an application create a customer account and enrich the profile immediately after creation.

Prerequisites

  • A valid authentication context with authorization, accept-language, and x-api-key.
  • The identity and contact data required to create the customer.
  • The customer_id returned by the creation step to continue the flow.

Expected result

The application creates a reusable customer account, verifies the created profile, and updates the information required for the next sales or booking steps.

Process workflow

Legend:
Mandatory
Optional
1

Create a new customer

Mandatory

Use POST/v1/customers to create a customer account before reading or enriching the profile. This step returns the customer_id that will be reused by the next profile steps.

Prerequisites

  • Send accept-language, authorization, and x-api-key.
  • Prepare the customer identity and contact fields required by your onboarding flow.
  • Add force_address only if your integration needs to bypass standard address validation.

Calling CURL

curl -X 'POST' \
  'https://api.clubmed.com/v1/customers' \
  -H 'accept: application/json' \
  -H 'accept-language: en-US' \
  -H 'authorization: Bearer YOUR_TOKEN' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ ... }'

Example answer

{
  "id": "123456789",
  "gm_number": "987654321",
  "email": "tom@example.com",
  "identity": {
    "first_name": "Tom",
    "last_name": "Smith"
  },
  "locale": "en-US"
}

info: Keep the returned customer_id because it becomes the key reference for the profile retrieval and update steps.


Response codes

  • OK Response (201): the customer was created and the new account identifiers are returned.
  • Error (400): the payload is invalid or a required field is missing.
  • Error (401): authentication is missing, invalid, or expired.
  • Error (404): non documented in Swagger.
POST/v1/customers
See more
2

Retrieve the complete customer profile

Mandatory

Use GET/v2/customers/{customer_id}/profile to read the full customer profile after creation or before an update. This step exposes identity, contact data, loyalty information, and locale settings.

Prerequisites

  • Reuse a valid customer_id.
  • Send accept-language, authorization, and x-api-key.
  • Make sure the authenticated context is allowed to read this customer profile.

Calling CURL

curl -X 'GET' \
  'https://api.clubmed.com/v2/customers/123456789/profile' \
  -H 'accept: application/json' \
  -H 'accept-language: en-US' \
  -H 'authorization: Bearer YOUR_TOKEN' \
  -H 'x-api-key: YOUR_API_KEY'

Example answer

{
  "email": "tom@example.com",
  "gm_number": "123456789",
  "first_name": "Tom",
  "last_name": "Smith",
  "phones": [
    {
      "number": "0623456789",
      "type": "MOBILE"
    }
  ],
  "loyalty_program": {
    "status": "EXCLUDED",
    "points": 1200
  },
  "locale": "en-US"
}

info: v2 is the reference profile payload to verify contact data and loyalty context before sending an update.


Response codes

  • OK Response (200): returns the detailed customer profile for the selected account.
  • Error (400): request validation failed or one input value is malformed.
  • Error (401): authentication is missing, invalid, or expired.
  • Error (403): access to this customer profile is forbidden for the current context.
  • Error (404): the customer profile was not found.
GET/v2/customers/{customer_id}/profile
See more
3

Update the customer profile

Mandatory

Use PATCH/v1/customers/{customer_id}/profile to update only the customer fields that must change. Missing or undefined fields are ignored, while null or empty strings clear the corresponding value.

Prerequisites

  • Reuse a valid customer_id.
  • Send accept-language, authorization, and x-api-key.
  • Prepare only the fields that really need to change.

Calling CURL

curl -X 'PATCH' \
  'https://api.clubmed.com/v1/customers/123456789/profile' \
  -H 'accept: application/json' \
  -H 'accept-language: en-US' \
  -H 'authorization: Bearer YOUR_TOKEN' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ ... }'

Example answer

HTTP/1.1 204 No Content

info: Use null or an empty string only when you explicitly want to clear an existing profile value.


Response codes

  • OK Response (204): the customer profile was updated successfully with no response body.
  • Error (400): the payload is invalid or one submitted field does not match the route rules.
  • Error (401): authentication is missing, invalid, or expired.
  • Error (403): access to this customer profile is forbidden for the current context.
  • Error (404): the customer profile was not found.
PATCH/v1/customers/{customer_id}/profile
See more