---
title: "Create customer"
url: "https://nov18-dev.movespot.fyi/apis/konnect-metering-billing-0/versions/1801ac42-b9c2-4bc2-8094-1177df9ed25c/operations/create-customer"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-metering-billing-0/versions/1801ac42-b9c2-4bc2-8094-1177df9ed25c.md

# Create customer

`POST` `/openmeter/customers`

Operation ID: `create-customer`

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Customer created response.
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Konnect Metering & Billing
  version: 0.0.1
servers:
  - url: https://us.api.konghq.com/v3
    description: United-States Production region
  - url: https://eu.api.konghq.com/v3
    description: Europe Production region
  - url: https://au.api.konghq.com/v3
    description: Australia Production region
  - url: https://me.api.konghq.com/v3
    description: Middle-East Production region
  - url: https://in.api.konghq.com/v3
    description: India Production region
  - url: https://sg.api.konghq.com/v3
    description: Singapore Production region
paths:
  /openmeter/customers:
    post:
      operationId: create-customer
      summary: Create customer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateCustomerRequest"
      responses:
        "201":
          description: Customer created response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BillingCustomer"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      tags:
        - OpenMeter Customers
security:
  - systemAccountAccessToken: []
  - personalAccessToken: []
  - konnectAccessToken: []
components:
  schemas:
    CreateCustomerRequest:
      description: Customer create request.
      type: object
      properties:
        name:
          description: |-
            Display name of the resource.

            Between 1 and 256 characters.
          type: string
          maxLength: 256
          minLength: 1
        description:
          description: |-
            Optional description of the resource.

            Maximum 1024 characters.
          type: string
          maxLength: 1024
        labels:
          $ref: "#/components/schemas/Labels"
        key:
          $ref: "#/components/schemas/ExternalResourceKey"
        usage_attribution:
          description: Mapping to attribute metered usage to the customer by the event
            subject.
          type: object
          properties:
            subject_keys:
              description: >-
                The subjects that are attributed to the customer.

                Can be empty when no usage event subjects are associated with
                the customer.
              type: array
              items:
                $ref: "#/components/schemas/UsageAttributionSubjectKey"
              minItems: 0
              title: Subject Keys
          required:
            - subject_keys
          title: Usage Attribution
        primary_email:
          description: The primary email address of the customer.
          type: string
          title: Primary Email
        currency:
          description: |-
            Currency of the customer.
            Used for billing, tax and invoicing.
          type: string
          example: USD
          maxLength: 3
          minLength: 3
          pattern: ^[A-Z]{3}$
          title: Currency
        billing_address:
          description: |-
            The billing address of the customer.
            Used for tax and invoicing.
          type: object
          properties:
            country:
              description: Country code in [ISO
                3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2
                format.
              type: string
              example: US
              maxLength: 2
              minLength: 2
              pattern: ^[A-Z]{2}$
              title: Country
            postal_code:
              description: Postal code.
              type: string
              title: Postal Code
            state:
              description: State or province.
              type: string
              title: State
            city:
              description: City.
              type: string
              title: City
            line1:
              description: First line of the address.
              type: string
              title: Line 1
            line2:
              description: Second line of the address.
              type: string
              title: Line 2
            phone_number:
              description: Phone number.
              type: string
              title: Phone Number
          title: Billing Address
      required:
        - name
        - key
    BillingCustomer:
      description: Customers can be individuals or organizations that can subscribe to
        plans and have access to features.
      type: object
      properties:
        id:
          description: ULID (Universally Unique Lexicographically Sortable Identifier).
          type: string
          example: 01G65Z755AFWAKHE12NY0CQ9FH
          pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
          readOnly: true
          title: ULID
        name:
          description: |-
            Display name of the resource.

            Between 1 and 256 characters.
          type: string
          maxLength: 256
          minLength: 1
        description:
          description: |-
            Optional description of the resource.

            Maximum 1024 characters.
          type: string
          maxLength: 1024
        labels:
          $ref: "#/components/schemas/Labels"
        created_at:
          description: An ISO-8601 timestamp representation of entity creation date.
          type: string
          format: date-time
          example: 2023-01-01T01:01:01.001Z
          readOnly: true
          title: RFC3339 Date-Time
        updated_at:
          description: An ISO-8601 timestamp representation of entity last update date.
          type: string
          format: date-time
          example: 2023-01-01T01:01:01.001Z
          readOnly: true
          title: RFC3339 Date-Time
        deleted_at:
          description: An ISO-8601 timestamp representation of entity deletion date.
          type: string
          format: date-time
          example: 2023-01-01T01:01:01.001Z
          readOnly: true
          title: RFC3339 Date-Time
        key:
          $ref: "#/components/schemas/ExternalResourceKey"
        usage_attribution:
          description: Mapping to attribute metered usage to the customer by the event
            subject.
          type: object
          properties:
            subject_keys:
              description: >-
                The subjects that are attributed to the customer.

                Can be empty when no usage event subjects are associated with
                the customer.
              type: array
              items:
                $ref: "#/components/schemas/UsageAttributionSubjectKey"
              minItems: 0
              title: Subject Keys
          required:
            - subject_keys
          title: Usage Attribution
        primary_email:
          description: The primary email address of the customer.
          type: string
          title: Primary Email
        currency:
          description: |-
            Currency of the customer.
            Used for billing, tax and invoicing.
          type: string
          example: USD
          maxLength: 3
          minLength: 3
          pattern: ^[A-Z]{3}$
          title: Currency
        billing_address:
          description: |-
            The billing address of the customer.
            Used for tax and invoicing.
          type: object
          properties:
            country:
              description: Country code in [ISO
                3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2
                format.
              type: string
              example: US
              maxLength: 2
              minLength: 2
              pattern: ^[A-Z]{2}$
              title: Country
            postal_code:
              description: Postal code.
              type: string
              title: Postal Code
            state:
              description: State or province.
              type: string
              title: State
            city:
              description: City.
              type: string
              title: City
            line1:
              description: First line of the address.
              type: string
              title: Line 1
            line2:
              description: Second line of the address.
              type: string
              title: Line 2
            phone_number:
              description: Phone number.
              type: string
              title: Phone Number
          title: Billing Address
      required:
        - id
        - name
        - key
    Labels:
      description: >
        Labels store metadata of an entity that can be used for filtering an
        entity list or for searching across entity types. 


        Keys must be of length 1-63 characters, and cannot start with "kong",
        "konnect", "mesh", "kic", or "_".
      type: object
      example:
        env: test
      additionalProperties:
        type: string
        pattern: ^[a-z0-9A-Z]{1}([a-z0-9A-Z-._]*[a-z0-9A-Z]+)?$
        minLength: 1
        maxLength: 63
      maxProperties: 50
      title: Labels
    ExternalResourceKey:
      description: ExternalResourceKey is a unique string that is used to identify a
        resource in an external system.
      type: string
      example: 019ae40f-4258-7f15-9491-842f42a7d6ac
      maxLength: 256
      minLength: 1
      title: External Resource Key
    UsageAttributionSubjectKey:
      description: Subject key.
      type: string
      minLength: 1
    BadRequestError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          required:
            - invalid_parameters
          properties:
            invalid_parameters:
              $ref: "#/components/schemas/InvalidParameters"
    UnauthorizedError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 401
            title:
              example: Unauthorized
            type:
              example: https://httpstatuses.com/401
            instance:
              example: kong:trace:1234567890
            detail:
              example: Invalid credentials
    ForbiddenError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 403
            title:
              example: Forbidden
            type:
              example: https://httpstatuses.com/403
            instance:
              example: kong:trace:1234567890
            detail:
              example: Forbidden
    BaseError:
      description: standard error
      type: object
      properties:
        status:
          description: >
            The HTTP status code of the error. Useful when passing the response

            body to child properties in a frontend UI. Must be returned as an
            integer.
          type: integer
          readOnly: true
        title:
          description: |
            A short, human-readable summary of the problem. It should not
            change between occurences of a problem, except for localization.
            Should be provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
        type:
          description: The error type.
          type: string
          readOnly: true
        instance:
          description: |
            Used to return the correlation ID back to the user, in the format
            kong:trace:<correlation_id>. This helps us find the relevant logs
            when a customer reports an issue.
          type: string
          readOnly: true
        detail:
          description: >
            A human readable explanation specific to this occurence of the
            problem.

            This field may contain request/entity data to help the user
            understand

            what went wrong. Enclose variable values in square brackets. Should
            be

            provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
      required:
        - status
        - title
        - instance
        - detail
      title: Error
    InvalidParameters:
      description: invalid parameters
      type: array
      items:
        oneOf:
          - $ref: "#/components/schemas/InvalidParameterStandard"
          - $ref: "#/components/schemas/InvalidParameterMinimumLength"
          - $ref: "#/components/schemas/InvalidParameterMaximumLength"
          - $ref: "#/components/schemas/InvalidParameterChoiceItem"
          - $ref: "#/components/schemas/InvalidParameterDependentItem"
      minItems: 1
      nullable: false
      uniqueItems: true
    InvalidParameterStandard:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          $ref: "#/components/schemas/InvalidRules"
        source:
          type: string
          example: body
        reason:
          type: string
          example: is a required field
          readOnly: true
      additionalProperties: false
      required:
        - field
        - reason
    InvalidParameterMinimumLength:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - min_length
            - min_digits
            - min_lowercase
            - min_uppercase
            - min_symbols
            - min_items
            - min
          nullable: false
          readOnly: true
        minimum:
          type: integer
          example: 8
        source:
          type: string
          example: body
        reason:
          type: string
          example: must have at least 8 characters
          readOnly: true
      additionalProperties: false
      required:
        - field
        - reason
        - rule
        - minimum
    InvalidParameterMaximumLength:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - max_length
            - max_items
            - max
          nullable: false
          readOnly: true
        maximum:
          type: integer
          example: 8
        source:
          type: string
          example: body
        reason:
          type: string
          example: must not have more than 8 characters
          readOnly: true
      additionalProperties: false
      required:
        - field
        - reason
        - rule
        - maximum
    InvalidParameterChoiceItem:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - enum
          nullable: false
          readOnly: true
        reason:
          type: string
          example: is a required field
          readOnly: true
        choices:
          type: array
          items: {}
          minItems: 1
          nullable: false
          readOnly: true
          uniqueItems: true
        source:
          type: string
          example: body
      additionalProperties: false
      required:
        - field
        - reason
        - rule
        - choices
    InvalidParameterDependentItem:
      type: object
      properties:
        field:
          type: string
          example: name
          readOnly: true
        rule:
          description: invalid parameters rules
          type: string
          enum:
            - dependent_fields
          nullable: true
          readOnly: true
        reason:
          type: string
          example: is a required field
          readOnly: true
        dependents:
          type: array
          items: {}
          nullable: true
          readOnly: true
          uniqueItems: true
        source:
          type: string
          example: body
      additionalProperties: false
      required:
        - field
        - rule
        - reason
        - dependents
    InvalidRules:
      description: invalid parameters rules
      type: string
      enum:
        - required
        - is_array
        - is_base64
        - is_boolean
        - is_date_time
        - is_integer
        - is_null
        - is_number
        - is_object
        - is_string
        - is_uuid
        - is_fqdn
        - is_arn
        - unknown_property
        - missing_reference
        - is_label
        - matches_regex
        - invalid
        - is_supported_network_availability_zone_list
        - is_supported_network_cidr_block
        - is_supported_provider_region
        - type
      nullable: true
      readOnly: true
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/BadRequestError"
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/UnauthorizedError"
          examples:
            UnauthorizedExample:
              $ref: "#/components/examples/UnauthorizedExample"
    Forbidden:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ForbiddenError"
          examples:
            UnauthorizedExample:
              $ref: "#/components/examples/ForbiddenExample"
  examples:
    UnauthorizedExample:
      value:
        status: 401
        title: Unauthorized
        instance: kong:trace:8347343766220159418
        detail: Unauthorized
    ForbiddenExample:
      value:
        status: 403
        title: Forbidden
        instance: kong:trace:2723154947768991354
        detail: You do not have permission to perform this action
  securitySchemes:
    systemAccountAccessToken:
      type: http
      scheme: bearer
      bearerFormat: Token
      description: >
        The system account access token is meant for automations and
        integrations that are not directly associated with a human identity.

        You can generate a system account Access Token by creating a system
        account and then obtaining a system account access token for that
        account.

        The access token must be passed in the header of a request, for example:

        `curl -X GET 'https://global.api.konghq.com/v2/users/' --header
        'Authorization: Bearer spat_i2Ej...'`
    personalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: Token
      description: >
        The personal access token is meant to be used as an alternative to
        basic-auth when accessing Konnect via APIs.

        You can generate a Personal Access Token (PAT) from the [personal access
        token page](https://cloud.konghq.com/global/account/tokens/) in the
        Konnect dashboard.

        The PAT token must be passed in the header of a request, for example:

        `curl -X GET 'https://global.api.konghq.com/v2/users/' --header
        'Authorization: Bearer kpat_xgfT...'`
    konnectAccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        The Konnect access token is meant to be used by the Konnect dashboard
        and the decK CLI authenticate with.
```
