Customer/add

Content-Type: application/json

Description coming soon

ParametersDescription
customer_name* string The customer name as displayed in PowerPanel, this could be a person name, or a Company name if it's a B.v.
address_data object Address data
street* string The street line. For example: `Plantage Kerklaan`
house_number* string The house number. For example: `38` or `39C`
zipcode* string The zipcode, for example: `2000 AB`
city* string The city name, for example: `Amsterdam`
country_code* string Country code. For example: `nl`, `uk`, `de`. Known as the ISO 3166-1 alpha-2 code
users array Users object. This array contains multiple objects of users { }
object User object
first_name* string First name
last_name* string Last name
email_address* string The email address. This can only be unique within the vendor
gender string The Gender. M/F Not required. Standard: M
language string language code. NL, EN, DE, etc. Not required. Standard: EN
Default value: "en"
status integer Customer status.
1 = new customer, they are required to pay first (iDeal/Creditcard/etc) before their order is pushed.
2 = Active, customers with this status can order until their credit is empty
Default value: 1
phone_numbers array An array with one or multiple phone numbers. Not required
string Phone number
company_number string The company number. In The Netherlands also called `kvk`
vat_number string The vat number. Or `BTW-Nummer`
credit_limit double Set the credit limit for this customer. Not required. If used, this customer can only order the amount lower than this number automatically before any manual action is required
Default value: "The default in the reseller settings"
customer_type integer Customer type.
1 = Personal
2 = Company
Default value: 1
vendor_id integer Use this only if you want to create a customer for a sub-reseller under your account
force boolean When this is false, it will fail if the customer already exists. Use this option to create another customer with the exact same name
Default value: false
send_welcome_email boolean This will send all the users for the customer the welcome email template. (Make sure you have the template enabled!)
Default value: false

* = required.
Colors indicate one of the fields must be entered, you can choose which one you want to use

Json example

{
    "customer_name": "TestingCompany Bv.",
    "address_data": {
        "street": "Companystreet",
        "house_number": "132C",
        "zipcode": "2000AB",
        "city": "Amsterdam",
        "country_code": "nl"
    },
    "users": [{
        "first_name": "Myfirst",
        "last_name": "User",
        "email_address": "myfirst@user.com",
        "gender": "m",
        "language": "en"
    }],
    "phone_numbers": [
        "+31(0)88-7508918"
    ],
    "company_number": "kvk12345563",
    "vat_number": "123456789",
    "credit_limit": 100.20,
    "customer_type": 2
}
{
    "customer_name": "Myuser Lastname",
    "address_data": {
        "street": "Myuserstreet",
        "house_number": 154,
        "zipcode": "2000AB",
        "city": "Amsterdam",
        "country_code": "nl"
    }
}

Ok response

{
  "code": 1,
  "msg": [],
  "status": "ok",
  "result": {
    "customer_id": "ABCD25023",
    "cu_id": 925096
  }
}
{
  "code": 1,
  "msg": [],
  "status": "ok",
  "result": {
    "customer_id": "ABCD25023",
    "cu_id": 925096
  }
}

Error response

{
  "code": 2,
  "msg": [
    "Customer already exists. Use force => true if you want to add another customer with the same name"
  ],
  "status": "error",
  "result": {
    "customer_id": "ABCD2550",
    "cu_id": "925095"
  }
}
{
  "code": 2,
  "msg": [
    "This email address is invalid"
  ],
  "status": "error"
}