Add new customer

POST customers

Request Structure

  • type: string ("business""individual")
  • name: string (Only applies to "business" type)
  • first_name: string, required
  • last_name: string, required
  • email: string, required
  • password: string, required
  • password_again: string, required
  • address: string, required
  • city: string, required
  • region: string, required
  • post_code: string, required
  • country: string, required
  • mobile_number: string
  • telephone_number: string

Example Request

POST /api/v1/customers HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
Content-Type: application/json

{
    "type": "business",
    "name": "New Customer",
    "first_name": "Customer",
    "last_name": "User",
    "email": "customeruser@example.com",
    "password": "validpass123",
    "password_again": "validpass123",
    "address": "123 Example Address",
    "city": "Example City",
    "region": "Example Region",
    "post_code": "123 EXAMPLE",
    "country": "US"
}

Response Structure

  • success: bool
  • messages: string (optional)
  • data: object
    • customer_id: int

Example Response

{
  "success":true,
  "messages":"Business customer created",
  "data":{
    "customer_id":2
  }
}