Skip to content

Import invoices into a SmartBill integration

POST
/products/{productId}/integrations/{id}/invoices
curl --request POST \
--url https://api.motenya.app/v1/products/example/integrations/example/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "invoices": [ { "series": "example", "number": "example", "issuedAt": "2026-03-14", "dueAt": "2026-03-14", "clientName": "example", "clientVatNumber": "example", "clientEmail": "example", "currency": "RON", "total": "149.90", "tax": "149.90", "paidAmount": "149.90", "canceled": true } ] }'

Up to 100 per call, each on its own: an order of the company store with its client (matched by VAT number, else name), under the integration’s source as SERIES-NUMBER. Importing again updates; an invoice already paid stays paid. Those still owed are checked with SmartBill daily.

Requires crm:write.

productId
required
string
>= 1 characters <= 64 characters
id
required
string
>= 1 characters <= 64 characters
Media typeapplication/json
object
invoices
required
Array<object>
>= 1 items <= 100 items
object
series
required
string
>= 1 characters <= 20 characters
number
required

Digits, as SmartBill numbered it.

string
>= 1 characters <= 12 characters
issuedAt
required

A date (2026-03-14) or an ISO-8601 instant.

string
<= 40 characters

Example

2026-03-14
dueAt

A date (2026-03-14) or an ISO-8601 instant.

string | null
<= 40 characters

Example

2026-03-14
clientName
required
string
>= 1 characters <= 200 characters
clientVatNumber

CIF / VAT number; the client is matched by it, else by name.

string | null
<= 40 characters
clientEmail
string | null
<= 254 characters
currency

ISO 4217; the company store’s (RON) when omitted.

string | null
>= 3 characters <= 3 characters

Example

RON
total
required

VAT included.

string
<= 32 characters /^-?\d+(\.\d+)?$/

Example

149.90
tax

A decimal amount as a string, e.g. “149.90”.

string | null
<= 32 characters /^-?\d+(\.\d+)?$/

Example

149.90
paidAmount

Paid by the export’s date; omitted counts as nothing paid.

string | null
<= 32 characters /^-?\d+(\.\d+)?$/

Example

149.90
canceled
boolean | null

Success

Media typeapplication/json
Array<object>
object
index
required
integer
externalId
required

SERIES-NUMBER, the invoice’s id under the integration’s source.

string
ok
required
boolean
orderId
required
string | null
>= 1 characters <= 64 characters
created
required
boolean | null
userErrors
required
Array<object>
object
code
required
string
message
required
string
field
Array<string> | null
key
additional properties

Example generated

[
{
"index": 1,
"externalId": "example",
"ok": true,
"orderId": "example",
"created": true,
"userErrors": [
{
"code": "example",
"message": "example",
"field": [
"example"
]
}
]
}
]

Invalid request

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Missing, invalid, revoked or expired API key

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Missing scope, API turned off, published article without publish scope, or account suspended

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Not found, or outside the knowledge bases this key may use

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Slug or translation already exists

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Rejected by validation (e.g. unknown language or category)

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Rate limited; see Retry-After

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Internal error