> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swervpay.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Customer

> create customers

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.swervpay.co/api/v1/customers \
    -H "Authorization: Bearer <TOKEN>" \
    -H "Content-Type: application/json" \
    -d '{
      "firstname": "user",
      "lastname": "user",
      "middlename": "user",
      "country": "user",
      "email": "user@mailinator.com"
    }'
  ```

  ```javascript Node.js theme={null}
  import { SwervpayClient } from '@swervpaydev/sdk';

  const config = {
      secretKey: "<SECRET_KEY>",
      businessId: "<BUSINESS_ID>"
  }

  const swervpay = new SwervpayClient(config);

  await swervpay.customer.create({
      firstname: "user",
      lastname: "user",
      middlename: "user",
      country: "user",
      email: "user@mailinator.com"
  })
  ```

  ```php PHP theme={null}
  use Swervpaydev\SDK\Swervpay;

  $config = [
  	'business_id' => '<BUSINESS_ID>',
  	'secret_key' => '<SECRET_KEY>'
  ];

  $client = new Swervpay($config);

  $client->customer()->create([
      "firstname" => "user",
      "lastname" => "user",
      "middlename" => "user",
      "country" => "user",
      "email" => "user@mailinator.com"
  ]);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"github.com/swerv-ltd/swervpay-go"
  	"log"
  )

  func main() {
  	ctx := context.Background()

  	client := swervpay.NewSwervpayClient(&swervpay.SwervpayClientOption{
          BusinessID: "<BUSINESS_ID>",
          SecretKey: "<SECRET_KEY>",
      })

      data := swervpay.CreateCustomerBody{
          Firstname: "user",
          Lastname: "user",
          Middlename: "user",
          Country: "user",
          Email: "user@mailinator.com"
      }

  	resp, err := client.Customer.Create(ctx, data)

  	if err != nil {
  		log.Fatal("error", err.Error())
  		return
  	}
  }
  ```
</RequestExample>


## OpenAPI

````yaml POST /customers
openapi: 3.0.0
info:
  title: Swervpay Developer API Specification
  version: 0.0.0
servers:
  - url: https://api.swervpay.co/api/v1
    description: Production API
  - url: https://sandbox.swervpay.co/api/v1
    description: Sandbox API
security:
  - bearerAuth: []
paths:
  /customers:
    post:
      tags:
        - customer
      description: create customers
      operationId: customerCreate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreateInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TypesBusinessCustomer'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
components:
  schemas:
    CustomerCreateInput:
      type: object
      properties:
        country:
          type: string
        email:
          type: string
        firstname:
          type: string
        lastname:
          type: string
        middlename:
          type: string
    TypesBusinessCustomer:
      type: object
      properties:
        country:
          type: string
        created_at:
          type: string
          format: date-time
        email:
          type: string
        first_name:
          type: string
        id:
          type: string
        is_blacklisted:
          type: boolean
        last_name:
          type: string
        middle_name:
          type: string
        phone_number:
          type: string
        status:
          type: string
        tier:
          type: string
        updated_at:
          type: string
          format: date-time
    UsererrorError:
      type: object
      properties:
        message:
          type: string
        values:
          type: object
          additionalProperties: {}
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````