---
title: 'Customer insert'
url: 'https://documentation.netstorming.net/customers-handling-api/customer-insert'
markdown: 'https://documentation.netstorming.net/customers-handling-api/customer-insert.md'
date: '2026-11-10'
description: 'URI: /api/customers/insert REQUEST: { "key": "Loremipsumdolorsitametconsecteturadipiscingelitlaoreet", "owner_code": "netstorming", "dry_run": true, "customers": [...] } Request parameters: Key Compulsory Value type Max length Notes key yes varchar API Key provided by Netsto…'
taxonomy:
  category:
    - docs
---

# Customer insert

[](#)  [ Customers Handling API ](https://documentation.netstorming.net/customers-handling-api)      Customer insert    

##### URI:

`/api/customers/insert`

##### REQUEST:

```
{
    "key": "Loremipsumdolorsitametconsecteturadipiscingelitlaoreet",
    "owner_code": "netstorming",
    "dry_run": true,
    "customers": [...]
}
```

Request parameters:

| Key | Compulsory | Value type | Max length | Notes |
|---|---|---|---|---|
| key | yes | varchar |  | API Key provided by Netstorming |
| owner\_code | yes | varchar | 3-12 alphanumeric chars | Owner you want the new customers belongs to |
| customers | yes | list of objects | see below: *Customer parameters* | List of customers data to be inserted |
| dry\_run | no | bool |  | If true, just performs a dry-run execution. Validity checks will be performed buth nothing will be written into databse. Useful for develpement purposes |

Request.customer parameters:

| Key | Compulsory | Value type | Max length | Notes |
|---|---|---|---|---|
| code | yes | varchar | 3-12 alphanumeric chars | Customer code in Netstorming sytstem |
| name | yes | varchar | 1-100 chars | Customer name / company name |
| address | yes | varchar | 1-150 chars |  |
| zip | yes | varchar | 8 numbers |  |
| country | yes | varchar | 2 chars | Country code (ISO 3166-1 alpha-2) |
| city | yes | varchar | 3-4 chars | Netstorming city code |
| mailstaff | yes | email | max 100 chars | Main customer email |
| notify\_lang | yes | varchar | 2 chars | Customer notification language |
| telephone | yes | varchar | 1-20 numbers |  |
| fax | yes | varchar | 1-20 numbers |  |
| currency | yes | varchar | 3 chars | ISO 4217 currency code |
| booking\_online | yes | bool |  | Enable customer to perform online bookings (otherwise it can run availability only) |
| blocked\_in\_deadline | yes | bool |  | Block reservations in deadline asking for prepayment with cc at the time of creation |
| credit\_card | yes | bool |  | Allow client to pay with credit card |
| admin\_user\_name | yes | varchar | 1-50 chars |  |
| admin\_user\_email | yes | email | max 100 chars |  |
| admin\_user\_login | yes | varchar | 3-12 alphanumeric chars |  |
| admin\_user\_psw | yes | varchar | 6-12 chars |  |
| admin\_user\_foreign\_code | no | varchar | 1-100 chars | [Foreign code](https://documentation.netstorming.net/single-sign-on/foreign-code) |
| vat | no | varchar | 30 chars |  |
| corporatename | no | varchar | 1-100 chars |  |
| mailaccountability | no | email | max 100 chars |  |
| tax\_code | no | varchar | max 100 chars |  |
| markuphotelsweb | no | int |  |  |
| markupcarsweb | no | int |  |  |
| markuptransfersweb | no | int |  |  |
| markuptoursweb | no | int |  |  |
| markupgenericservicesweb | no | int |  |  |
| sdi\_code | no | varchar | 7 chars |  |
| accounting | no | varchar | 1-20 chars |  |
| mobile\_phone | no | varchar | 1-20 numbers |  |
| pec\_address | no | email | max 100 chars |  |
| force\_contextual\_payment | no | bool |  | Force customer to pay reservation in advance, even if they are not in deadline yet |
| customer\_homepage | no | enum | \[HOME, HOTELSONLINE, BOOKINGSMANAGEMENT\] |  |
| emergency\_number | no | varchar | 1-20 numbers |  |
| payment\_date | no | enum | \[topay, deadline, startdate\] |  |
| prepayment\_days | no | int | \[0-30\] |  |
| block\_voucher | no | bool |  |  |
| booking\_autocancellation | no | bool |  | Automatically cancel unpaid bookings before the deadline date (usually 1 hour before) |
| hotels\_credit | no | int |  | If you want to disable, set to 0 |
| cars\_credit | no | int |  | If you want to disable, set to 0 |
| transfers\_credit | no | int |  | If you want to disable, set to 0 |
| tours\_credit | no | int |  | If you want to disable, set to 0 |
| additional\_users | no | list of objects | see below: *User parameters* | List of additional users to be inserted (other than the admin one) |

Request.customer.additional\_user parameters:

| Key | Compulsory | Value type | Max length | Notes |
|---|---|---|---|---|
| name | yes | varchar | 1-50 chars |  |
| email | yes | email | max 100 chars |  |
| login | yes | varchar | 3-12 alphanumeric chars |  |
| psw | yes | varchar | 6-12 chars |  |
| role | yes | enum | \[admin, user, limited\_access\_user\] |  |

##### RESPONSE:

```
{
    "dry_run": true,
    "results": [
        {
            "code": "test0123",
            "customer": false,
            "user": false
        }
    ],
    "errors": [
        {
            "line/index": 1,
            "errors": [
                "missing address",
                "invalid notify_lang",
                "invalid booking_online (valid values: yes, no, y, n, true, false, 1, 0)"
            ]
        }
    ]
}
```

Response parameters:

| Key | Compulsory | Value type | Notes |
|---|---|---|---|
| dry\_run | no | bool | Echo-value of the dry\_run parameter in request |
| results | yes | list of objects | one object for each customer, holding the insert results (more deails below) |
| errors | yes | list of objects | one object for each errpr, if any (more deails below) |

Response.results parameters:

| Key | Compulsory | Value type | Notes |
|---|---|---|---|
| code | yes | string | Echo-value of the dry\_run parameter in request |
| customer | yes | bool | Result of insert operation of customer. true = ok, false = failed |
| user | yes | bool | Result of insert operation of user. true = ok, false = failed. Always be false if customer = false |

Response.errors parameters:

| Key | Compulsory | Value type | Notes |
|---|---|---|---|
| line/index | yes | int | Index of item that generates the error |
| errors | yes | list of strings | Human-readable validation errors on the requested data |

##### Examples

You can find an example [here](https://documentation.netstorming.net/examples/customers-insert-examples)

 [ ](https://documentation.netstorming.net/customers-handling-api/basic-rules) [](https://documentation.netstorming.net/customers-handling-api/set-foreign-code)

---

## Navigation

- Parent: [Customers Handling API](https://documentation.netstorming.net/customers-handling-api.md)
- Previous: [Intro](https://documentation.netstorming.net/customers-handling-api/basic-rules.md)
- Next: [Set foreign code](https://documentation.netstorming.net/customers-handling-api/set-foreign-code.md)
