Skip to content

Check rows before importing them

POST
/imports/check
curl --request POST \
--url https://example.com/imports/check \
--header 'Content-Type: application/json' \
--cookie __Host-bottle.session_token=<__Host-bottle.session_token> \
--data '{ "kind": "customers", "fileName": "example", "rows": [ { "accountNumber": "example", "name": "example", "address": "example", "postcode": "example", "contactName": "example", "phone": "example", "email": "example", "notes": "example" } ], "skip": [ 1 ], "firstRow": 1, "mapping": { "additionalProperty": "example" } }'

Says what importing each row would do: add, update, leave as it is, or a problem in plain words. For cylinders, also lists each location Bottle could not place. Nothing is saved.

Media typeapplication/json
One of:
object
kind
required
string
Allowed values: customers
fileName
required
string
>= 1 characters <= 200 characters
rows
required
Array<object>
>= 1 items <= 5000 items
object
accountNumber
string
<= 500 characters
name
string
<= 500 characters
address
string
<= 500 characters
postcode
string
<= 500 characters
contactName
string
<= 500 characters
phone
string
<= 500 characters
email
string
<= 500 characters
notes
string
<= 2000 characters
skip
Array<integer>
<= 5000 items
firstRow
integer
>= 1
mapping
object
key
additional properties
string
<= 80 characters

What each row would do

Media typeapplication/json
object
rows
required
Array<object>
object
row
required
integer
action
required
string
Allowed values: create update same problem skip
label
required
string | null
problems
required
Array<string>
where
required
string | null
holderKind
required
string | null
state
required
string | null
Allowed values: active review faulty lost retired
condition
required
string | null
Allowed values: full empty
unplaced
required
string | null
counts
required
object
create
required
integer
update
required
integer
same
required
integer
problem
required
integer
skip
required
integer
unplaced
required
Array<object>
object
text
required
string
rows
required
integer

Example

{
"rows": [
{
"action": "create",
"state": "active",
"condition": "full"
}
]
}

Not signed in

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Not an owner or admin, or the plan does not open Assets

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Not found, or Assets is not available to this business

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Assets is switched off, or the import was already undone

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Validation failed, or rows still have problems

Media typeapplication/json
object
error
required
string
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string

Example

{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}