Documents: Typeless documents

Typeless documents are documents of which the type is not yet known. For example, a document uploaded via email or via the bulk uploader. It is not possible to update a typeless document, except for adding attachments. You will need to set its type first. You cannot set the type of typeless documents using the API yet, but you can do it via the website.

List ids and versions of typeless documents

Returns all documents in the administration. The list contains the document id and the version of the document. Check if the version of the document is newer than the version you have stored locally, use the POST variant for fetching documents with the given ids.

Parameters

Parameter Type Description
filter String

String terms, example: key1:value1,key2:value2.

Example: retrieves all ids for synchronization

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/documents/typeless_documents/synchronization.json?
    

Response

        
          
          Status: 200 OK
        
      
[
  {
    "id": "433546225328850653",
    "version": 1727681921
  },
  {
    "id": "433546225340384991",
    "version": 1727681921
  },
  {
    "id": "433546225351919329",
    "version": 1727681921
  }
]
      

Fetch typeless documents with given ids

Given a list of document ids, returns the document information belonging to the documents. Returns a maximum of 100 documents, even if more ids are provided.

Parameters

Parameter Type Description
ids Array[integer]

Required

Example: retrieves documents for given ids

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPOST \
  -d '{"ids":[433546225558488813,433546225571071727]}' \
  https://moneybird.com/api/v2/123/documents/typeless_documents/synchronization.json
    

Response

        
          
          Status: 200 OK
        
      
[
  {
    "id": "433546225558488813",
    "administration_id": 123,
    "contact_id": null,
    "contact": null,
    "reference": "20130456",
    "date": "2024-09-30",
    "state": "new",
    "origin": null,
    "created_at": "2024-09-30T07:38:41.980Z",
    "updated_at": "2024-09-30T07:38:41.980Z",
    "version": 1727681921,
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 1727681857838,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": {
        },
        "created_at": "2024-09-30T07:38:41.984Z",
        "updated_at": "2024-09-30T07:38:41.984Z"
      }
    ]
  },
  {
    "id": "433546225571071727",
    "administration_id": 123,
    "contact_id": null,
    "contact": null,
    "reference": "20130456",
    "date": "2024-09-30",
    "state": "new",
    "origin": null,
    "created_at": "2024-09-30T07:38:41.992Z",
    "updated_at": "2024-09-30T07:38:41.992Z",
    "version": 1727681921,
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 1727681857838,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": {
        },
        "created_at": "2024-09-30T07:38:41.997Z",
        "updated_at": "2024-09-30T07:38:41.997Z"
      }
    ]
  }
]
      

Get typeless documents

Returns a paginated list of documents of this type in the administration.

The filter argument allows you to filter on the list of documents. Filters are a combination of keys and values, separated by a comma: key:value,key2:value2. The most common filter method will be period: period:this_month. Filtering works the same as in the web application, for more advanced examples, change the filtering in the web application and learn from the resulting URI.

Parameters

Parameter Type Description
filter String

Required

String terms, example: key1:value1,key2:value2.

new_filter String

String terms, example: key1:value1,key2:value2.

page Integer
per_page Integer
exclude_new_general_journal_documents Boolean

Example: returns a list of typeless_documents

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/documents/typeless_documents.json?
    

Response

        
          
          Status: 200 OK
        
      
[
  {
    "id": "433546221815072355",
    "administration_id": 123,
    "contact_id": null,
    "contact": null,
    "reference": "20130456",
    "date": "2024-09-30",
    "state": "new",
    "origin": null,
    "created_at": "2024-09-30T07:38:38.411Z",
    "updated_at": "2024-09-30T07:38:38.411Z",
    "version": 1727681918,
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 1727681857838,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": {
        },
        "created_at": "2024-09-30T07:38:38.414Z",
        "updated_at": "2024-09-30T07:38:38.414Z"
      }
    ]
  },
  {
    "id": "433546221802489441",
    "administration_id": 123,
    "contact_id": null,
    "contact": null,
    "reference": "20130456",
    "date": "2024-09-30",
    "state": "new",
    "origin": null,
    "created_at": "2024-09-30T07:38:38.398Z",
    "updated_at": "2024-09-30T07:38:38.398Z",
    "version": 1727681918,
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 1727681857838,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": {
        },
        "created_at": "2024-09-30T07:38:38.402Z",
        "updated_at": "2024-09-30T07:38:38.402Z"
      }
    ]
  },
  {
    "id": "433546221789906527",
    "administration_id": 123,
    "contact_id": null,
    "contact": null,
    "reference": "20130456",
    "date": "2024-09-30",
    "state": "new",
    "origin": null,
    "created_at": "2024-09-30T07:38:38.386Z",
    "updated_at": "2024-09-30T07:38:38.386Z",
    "version": 1727681918,
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 1727681857838,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": {
        },
        "created_at": "2024-09-30T07:38:38.390Z",
        "updated_at": "2024-09-30T07:38:38.390Z"
      }
    ]
  }
]
      

Example: returns paginated typeless documents on page 1

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/documents/typeless_documents.json?per_page=1
    

Response

        
          
          Status: 200 OK
        
      
[
  {
    "id": "433546222014301811",
    "administration_id": 123,
    "contact_id": null,
    "contact": null,
    "reference": "20130456",
    "date": "2024-09-30",
    "state": "new",
    "origin": null,
    "created_at": "2024-09-30T07:38:38.601Z",
    "updated_at": "2024-09-30T07:38:38.601Z",
    "version": 1727681918,
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 1727681857838,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": {
        },
        "created_at": "2024-09-30T07:38:38.604Z",
        "updated_at": "2024-09-30T07:38:38.604Z"
      }
    ]
  }
]
      

Example: returns paginated typeless documents on page 2

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/documents/typeless_documents.json?page=2&per_page=1
    

Response

        
          
          Status: 200 OK
        
      
[
  {
    "id": "433546222194656897",
    "administration_id": 123,
    "contact_id": null,
    "contact": null,
    "reference": "20130456",
    "date": "2024-09-30",
    "state": "new",
    "origin": null,
    "created_at": "2024-09-30T07:38:38.772Z",
    "updated_at": "2024-09-30T07:38:38.772Z",
    "version": 1727681918,
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 1727681857838,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": {
        },
        "created_at": "2024-09-30T07:38:38.776Z",
        "updated_at": "2024-09-30T07:38:38.776Z"
      }
    ]
  }
]
      

Example: returns an error when too many typeless documents are requested

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/documents/typeless_documents.json?per_page=101
    

Response

        
          
          Status: 400 Bad Request
        
      
{
  "error": "Per Page is too big",
  "symbolic": {
    "per_page": "max"
  }
}
      

Get typeless documents

Example: returns the wanted typeless_document

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/documents/typeless_documents/433546222543832733.json?
    

Response

        
          
          Status: 200 OK
        
      
{
  "id": "433546222543832733",
  "administration_id": 123,
  "contact_id": null,
  "contact": null,
  "reference": "20130456",
  "date": "2024-09-30",
  "state": "new",
  "origin": null,
  "created_at": "2024-09-30T07:38:39.106Z",
  "updated_at": "2024-09-30T07:38:39.106Z",
  "version": 1727681919,
  "attachments": [

  ],
  "events": [
    {
      "administration_id": 123,
      "user_id": 1727681857838,
      "action": "document_saved",
      "link_entity_id": null,
      "link_entity_type": null,
      "data": {
      },
      "created_at": "2024-09-30T07:38:39.109Z",
      "updated_at": "2024-09-30T07:38:39.109Z"
    }
  ]
}
      

Example: only returns typeless_documents

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/documents/typeless_documents/433546222672807588.json?
    

Response

        
          
          Status: 404 Not Found
        
      
{
  "error": "record not found",
  "symbolic": {
    "id": "not_found"
  }
}
      

Create a new typeless documents

Parameters

Parameter Type Description
typeless_document[reference] String

Required

typeless_document[date] String

Required

typeless_document[contact_id] Integer

Should be a valid contact id.

Example: creates the typeless_document

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPOST \
  -d '{"typeless_document":{"reference":"foobar","contact_id":433546222786053803}}' \
  https://moneybird.com/api/v2/123/documents/typeless_documents.json
    

Response

        
          
          Status: 201 Created
        
      
{
  "id": "433546222903494323",
  "administration_id": 123,
  "contact_id": "433546222786053803",
  "contact": {
    "id": "433546222786053803",
    "administration_id": 123,
    "company_name": "Foobar Holding B.V.",
    "firstname": "",
    "lastname": "",
    "address1": "Hoofdstraat 12",
    "address2": "",
    "zipcode": "1234AB",
    "city": "Amsterdam",
    "country": "NL",
    "phone": "",
    "delivery_method": "Email",
    "customer_id": "1",
    "tax_number": "",
    "chamber_of_commerce": "",
    "bank_account": "",
    "is_trusted": false,
    "max_transfer_amount": null,
    "attention": "",
    "email": "info@example.com",
    "email_ubl": true,
    "send_invoices_to_attention": "",
    "send_invoices_to_email": "info@example.com",
    "send_estimates_to_attention": "",
    "send_estimates_to_email": "info@example.com",
    "sepa_active": false,
    "sepa_iban": "",
    "sepa_iban_account_name": "",
    "sepa_bic": "",
    "sepa_mandate_id": "",
    "sepa_mandate_date": null,
    "sepa_sequence_type": "RCUR",
    "credit_card_number": "",
    "credit_card_reference": "",
    "credit_card_type": null,
    "tax_number_validated_at": null,
    "tax_number_valid": null,
    "invoice_workflow_id": null,
    "estimate_workflow_id": null,
    "si_identifier": "",
    "si_identifier_type": null,
    "moneybird_payments_mandate": false,
    "created_at": "2024-09-30T07:38:39.336Z",
    "updated_at": "2024-09-30T07:38:39.336Z",
    "version": 1727681919,
    "sales_invoices_url": "https://moneybird.dev/123/sales_invoices/26deb31936c404be81d9f890de41071761475d663816a6fe2e4bf7368ba64430/all",
    "notes": [

    ],
    "custom_fields": [

    ],
    "contact_people": [

    ],
    "archived": false
  },
  "reference": "foobar",
  "date": "2024-09-30",
  "state": "new",
  "origin": "api",
  "created_at": "2024-09-30T07:38:39.448Z",
  "updated_at": "2024-09-30T07:38:39.448Z",
  "version": 1727681919,
  "attachments": [

  ],
  "events": [
    {
      "administration_id": 123,
      "user_id": 1727681857838,
      "action": "document_saved",
      "link_entity_id": null,
      "link_entity_type": null,
      "data": {
      },
      "created_at": "2024-09-30T07:38:39.451Z",
      "updated_at": "2024-09-30T07:38:39.451Z"
    }
  ]
}
      

Example: requires all input

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPOST \
  -d '{}' \
  https://moneybird.com/api/v2/123/documents/typeless_documents.json
    

Response

        
          
          Status: 400 Bad Request
        
      
{
  "error": "Typeless Document is required",
  "symbolic": {
    "typeless_document": "required"
  }
}
      

Delete a typeless documents

Parameters

Parameter Type Description
refresh_journal_entries Boolean

Example: deletes the typeless_document

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XDELETE \
  -d '{}' \
  https://moneybird.com/api/v2/123/documents/typeless_documents/433546223198144199.json
    

Response

Add attachment to typeless document

Example: uploads an attachment

Request

curl -s -H "Content-Type: multipart/mixed" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPOST \
  -F file=@/tmp/upload.pdf \
  https://moneybird.com/api/v2/123/documents/typeless_documents/433546223464482514/attachments.json
    

Response

Download attachment

Download the attachment. The response will be a redirect to a temporarily available URL where the attachment can be downloaded. Use the Location header in the response to download the attachment.

Delete an attachment

Deletes an attachment of an attachable.

Example: destroys an attachment

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XDELETE \
  -d '{}' \
  https://moneybird.com/api/v2/123/documents/typeless_documents/433546225743038201/attachments/433546225843701499.json
    

Response