Import invoices into a SmartBill integration
const url = 'https://api.motenya.app/v1/products/example/integrations/example/invoices';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Digits, as SmartBill numbered it.
A date (2026-03-14) or an ISO-8601 instant.
Example
2026-03-14A date (2026-03-14) or an ISO-8601 instant.
Example
2026-03-14CIF / VAT number; the client is matched by it, else by name.
ISO 4217; the company store’s (RON) when omitted.
Example
RONVAT included.
Example
149.90A decimal amount as a string, e.g. “149.90”.
Example
149.90Paid by the export’s date; omitted counts as nothing paid.
Example
149.90Responses
Section titled “Responses”Success
object
SERIES-NUMBER, the invoice’s id under the integration’s source.
object
Example generated
[ { "index": 1, "externalId": "example", "ok": true, "orderId": "example", "created": true, "userErrors": [ { "code": "example", "message": "example", "field": [ "example" ] } ] }]Invalid request
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing, invalid, revoked or expired API key
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing scope, API turned off, published article without publish scope, or account suspended
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Not found, or outside the knowledge bases this key may use
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Slug or translation already exists
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Rejected by validation (e.g. unknown language or category)
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Rate limited; see Retry-After
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Internal error