API Documentation
API Endpoints/Invoices

Import External Document

Imports a document created outside the system and links it to an existing voucher record.

POST
/invoices/{invoiceReference}/importExternalDocument
AuthorizationBasic <token>

Basic authentication is a simple authentication scheme built into the HTTP protocol. To use it, send your HTTP requests with an Authorization header that contains the word Basic followed by a space and a base64-encoded string username:password.Example: Authorization: Basic ZGVtbzpwQDU1dzByZA==

In: header

Path Parameters

invoiceReferencestring

Your invoiceReference (The Invoice ID in your system)

description?string

Label of the communication, additional information about the document. Shown in our UI.

filefile

File to upload

Formatbinary
filenamestring

Name of the file, including extension. This will also be visible to your customer if the document is sent as an attachment. Allowed extensions are: pdf and eml

kindstring

Kind of communication, use what best describes the document, use "invoice" for the orignal invoice that was sent to the customer.

Value in"invoice" | "creditnote" | "reminder" | "dunning1" | "dunning2" | "dunning3" | "dunning4" | "email" | "letter"
label?string

Label of the communication to identity the document. Shown in our UI.

Response Body

curl -X POST "https://staging1.abillify.dev/api/invoices/string/importExternalDocument" \
  -F file="string" \
  -F filename="RE12345.pdf" \
  -F kind="invoice"
const body = new FormData();
body.set(file, "string")
body.set(filename, "RE12345.pdf")
body.set(kind, "invoice")

fetch("https://staging1.abillify.dev/api/invoices/string/importExternalDocument", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "mime/multipart"
  "bytes"
)

func main() {
  url := "https://staging1.abillify.dev/api/invoices/string/importExternalDocument"
  body := new(bytes.Buffer)
  mp := multipart.NewWriter(payload)
  mp.WriteField("file", `string`)
  mp.WriteField("filename", `RE12345.pdf`)
  mp.WriteField("kind", `invoice`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "multipart/form-data")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://staging1.abillify.dev/api/invoices/string/importExternalDocument"
body = {
  "file": "string",
  "filename": "RE12345.pdf",
  "kind": "invoice"
}
response = requests.request("POST", url, data = body, headers = {
  "Content-Type": "multipart/form-data"
})

print(response.text)
{
  "communicationReference": "_12345",
  "fileReference": "_67890",
  "voucherReference": "_1234"
}
{
  "code": 400,
  "details": [
    {
      "error": "Value for field 'debtor' is of wrong type, expected bigint.",
      "fields": [
        "debtor"
      ],
      "hint": "Value must be a number or a string containing only a number."
    }
  ],
  "message": "InvalidValue, see error details",
  "name": "ClientError",
  "type": "ERR_INVALID_VALUE"
}
{
  "code": 400,
  "details": [
    {
      "error": "Value for field 'debtor' is of wrong type, expected bigint.",
      "fields": [
        "debtor"
      ],
      "hint": "Value must be a number or a string containing only a number."
    }
  ],
  "message": "InvalidValue, see error details",
  "name": "ClientError",
  "type": "ERR_INVALID_VALUE"
}