Amili Docs
Home
Products
Products
  • Debt.collection
  • Account Receivable
  • Distribution
Go to amili.no
Home
Products
Products
  • Debt.collection
  • Account Receivable
  • Distribution
Go to amili.no
  1. Documents
  • Home
    • Welcome to Amili Docs
    • Responsible disclosure
    • Become a partner
  • Debt Collection
    • About the AutoCollect API
    • Getting started with the AutoCollect API
    • Webhooks
    • Example Workflow
    • Batches
      • GetBatchById
      • GetBatchesByOrganization
      • GetBatchById - Legacy (To be removed)
    • Collections
      • AcceptDebtCollectionList
      • RejectDebtCollectionList
      • PauseCase
      • WithdrawCase
      • ResumeCase
    • Correction
      • CreateCorrections
    • Invoice
      • CreateInvoices
      • GetInvoicesByOrganization
      • GetInvoiceById
    • Payment
      • CreatePayments
    • Settlement
      • GetSettlements
      • GetSettlement on Id
    • AutoCollect Legacy API
      • Attachment
        • /webapi/api/Attachment
      • Batch
        • /webapi/api/Batch
        • /webapi/api/Batch
      • Ping
        • /webapi/api/Ping
  • Accounts Receivable
    • Actions
      • POST (create) an action
      • POST (create) a reports action/generate a report
    • ArItems
      • GET a list of AR items
      • PUT (update) ar item details
      • GET one AR item
    • AutoPostings
      • POST (create) one or more auto postings
    • Batches
      • GET one batch
    • ClientConfigs
      • GET a list of client config values
      • GET values for one client config key
    • Codes
      • GET ARM system code values
    • Customers
      • POST (create) one customer
      • PUT (update) one customer
      • GET a list of customers
      • GET one customer
      • DELETE a customer
      • POST (create) a batch of customers
      • PUT (update) a batch of customers
    • DocumentBundles
      • GET a list of document bundles
      • GET one document bundle
    • Documents
      • POST (create) one document
        POST
      • GET a list of documents
        GET
      • GET one document
        GET
      • POST (create) a batch of documents
        POST
    • Files
      • GET one or more OS files
      • POST (upload) one or more OS files
      • GET one OS file
    • GlItems
      • Get one GL item
      • GET a list of GL items
    • GlMovements
      • Get movement/balance for the latest closed GL year/period
      • GET a list of GL movements/balances
    • Insights
      • GET a list of ADB intervals
    • LogItems
      • GET one log item
      • GET a list of log items
    • PaymentReservations
      • POST (create) a new payment reservation
    • Health
      • Check API health
  1. Documents

POST (create) one document

POST
/clients/{clientno}/documents
Create one document.
There are two ways to create new documents:
Use POST /clients/{clientno}/documents to create one new document; input one document object. The data will be validated and document created immediately and you will get a response describing the status and result. The new document is immediately active and ready to be posted etc. Or:
Use POST /clients/{clientno}/documents/batches to create a batch of new documents; input an array of document objects. The data will be stored, but not processed immediately. The output will present a batchUuid that you must keep track of. Processing is done asynchronously (later) and the bathcUuid can be used to retrieve the batch processing status and result using GET /clients/{clientno}/batches/{batchuuid}

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
Path Params

Body Params application/jsonRequired

Examples

Responses

🟢201
application/json
Document created
Headers

Body

🟠422
🟠400BadRequest
🟠401Unauthorized
🟠403Forbidden
🟠404NotFound
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/clients//documents' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "metadata": {
        "userId": "TestUser"
    },
    "document": {
        "documentType": "IN",
        "customerNo": "543210",
        "documentNo": "88776655",
        "documentDate": "2025-02-27",
        "dueDate": "2025-03-11",
        "currency": "NOK",
        "currencyAmounts": {
            "exclVat": 5200,
            "vat": 1300,
            "inclVat": 6500
        },
        "distribution": {
            "type": "M",
            "einvoiceCode": 0
        },
        "einvoiceAddress": {
            "address": "test@armresttest.no",
            "addressScheme": "",
            "operator": ""
        },
        "emailAddress": [
            "test@armresttest.no"
        ],
        "language": "en",
        "kid": "500221850000200350786",
        "marketingMessageCode": "0203",
        "customerMessage": "Happy holidays!",
        "attachmentFiles": [],
        "attachmentCodes": [],
        "customCodes": [],
        "salesOrderId": "B-0564311",
        "purchaseOrderId": "",
        "sellerReference": "C333",
        "buyerReference": "A1982",
        "additionalReference": "X99887",
        "subCustomerNo": "654655",
        "ledgerNote": "This is a note for the AR ledger",
        "documentLines": [
            {
                "lineNo": 1,
                "lineType": "PLH",
                "articleNo": "1300",
                "articleName": "Comb",
                "lineText": "Red comb",
                "quantityUnit": "pcs",
                "quantity": 1,
                "volumeUnit": "",
                "volume": 0,
                "price": 200,
                "currencyAmounts": {
                    "exclVat": 200,
                    "vat": 50,
                    "inclVat": 250
                },
                "itemGroup1": "500",
                "itemGroup2": "",
                "itemGroup3": ""
            },
            {
                "lineNo": 2,
                "lineType": "PLH",
                "articleNo": "1500",
                "articleName": "Pill",
                "lineText": "Purple pill",
                "quantityUnit": "dozen",
                "quantity": 1,
                "volumeUnit": "",
                "volume": 0,
                "price": 5000,
                "currencyAmounts": {
                    "exclVat": 5000,
                    "vat": 150,
                    "inclVat": 6250
                },
                "itemGroup1": "600",
                "itemGroup2": "",
                "itemGroup3": ""
            },
            {
                "lineNo": 3,
                "lineType": "TXT",
                "articleNo": "",
                "articleName": "",
                "lineText": "This is a text line with no amounts",
                "quantityUnit": "",
                "quantity": 0,
                "volumeUnit": "",
                "volume": 0,
                "price": 0,
                "currencyAmounts": {
                    "exclVat": 0,
                    "vat": 0,
                    "inclVat": 0
                },
                "itemGroup1": "",
                "itemGroup2": "",
                "itemGroup3": ""
            }
        ]
    }
}'
Response Response Example
201 - Document created
{
    "status": "PROCESSED",
    "result": "CREATED",
    "message": "CREATED",
    "clientNo": 2218,
    "accountNo": 500002,
    "referenceNo": 35078,
    "documentBundleId": 432795,
    "customerNo": "543210",
    "documentNo": "88776655",
    "warnings": [
        {
            "field": "EmailAddressDocument",
            "message": "Email address owea@ testarmrest.no was sanitized: owea@testarmrest.no was s"
        }
    ]
}
Modified at 2026-04-14 09:49:15
Previous
GET one document bundle
Next
GET a list of documents
Built with