Documents: Purchase invoices

Show examples in: cURL Ruby

List ids and versions of purchase invoices

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/purchase_invoices/synchronization.json?

Response

Status: 200 OK
[
  {
    "id": "190119471000586193",
    "version": 1495532078
  },
  {
    "id": "190119471162066900",
    "version": 1495532078
  },
  {
    "id": "190119471337179095",
    "version": 1495532078
  }
]

Example: retrieves all ids for synchronization using a filter

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/documents/purchase_invoices/synchronization.json?filter=period%3Athis_month

Response

Status: 200 OK
[
  {
    "id": "190119471815329762",
    "version": 1495532079
  },
  {
    "id": "190119471950596069",
    "version": 1495532079
  },
  {
    "id": "190119472086910952",
    "version": 1495532079
  }
]

Fetch purchase invoices 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":[190119472618538998,190119472762193913]}' \
  https://moneybird.com/api/v2/123/documents/purchase_invoices/synchronization.json

Response

Status: 200 OK
[
  {
    "id": "190119472618538998",
    "administration_id": 123,
    "contact_id": "190119472203302893",
    "contact": {
      "id": "190119472203302893",
      "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": "",
      "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": "FRST",
      "credit_card_number": "",
      "credit_card_reference": "",
      "credit_card_type": null,
      "tax_number_validated_at": null,
      "invoice_workflow_id": null,
      "estimate_workflow_id": null,
      "created_at": "2017-05-23T09:34:39.408Z",
      "updated_at": "2017-05-23T09:34:39.408Z",
      "sales_invoices_url": "http://moneybird.dev/123/sales_invoices/45ed86e329e147d4a91c8039a71a58c4c360ce0defde9b6b116dbe27f3395e2e/all",
      "notes": [

      ],
      "custom_fields": [

      ]
    },
    "reference": "2013-01234",
    "date": "2017-05-23",
    "due_date": "2017-06-06",
    "entry_number": 3,
    "state": "open",
    "currency": "EUR",
    "exchange_rate": "1.0",
    "revenue_invoice": false,
    "prices_are_incl_tax": false,
    "origin": null,
    "paid_at": null,
    "tax_number": "",
    "total_price_excl_tax": "300.0",
    "total_price_excl_tax_base": "300.0",
    "total_price_incl_tax": "363.0",
    "total_price_incl_tax_base": "363.0",
    "created_at": "2017-05-23T09:34:39.802Z",
    "updated_at": "2017-05-23T09:34:39.811Z",
    "details": [
      {
        "id": "190119472621684727",
        "administration_id": 123,
        "tax_rate_id": "190119429771626316",
        "ledger_account_id": "190119429568202551",
        "product_id": null,
        "amount": null,
        "amount_decimal": 1,
        "description": "Delivery Apple iPad",
        "price": "300.0",
        "period": null,
        "row_order": 0,
        "total_price_excl_tax_with_discount": "300.0",
        "total_price_excl_tax_with_discount_base": "300.0",
        "tax_report_reference": [
          "NL/5b"
        ],
        "created_at": "2017-05-23T09:34:39.807Z",
        "updated_at": "2017-05-23T09:34:39.807Z"
      }
    ],
    "payments": [

    ],
    "notes": [

    ],
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 14955320389696,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": null,
        "created_at": "2017-05-23T09:34:39.819Z",
        "updated_at": "2017-05-23T09:34:39.819Z"
      }
    ]
  },
  {
    "id": "190119472762193913",
    "administration_id": 123,
    "contact_id": "190119472203302893",
    "contact": {
      "id": "190119472203302893",
      "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": "",
      "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": "FRST",
      "credit_card_number": "",
      "credit_card_reference": "",
      "credit_card_type": null,
      "tax_number_validated_at": null,
      "invoice_workflow_id": null,
      "estimate_workflow_id": null,
      "created_at": "2017-05-23T09:34:39.408Z",
      "updated_at": "2017-05-23T09:34:39.408Z",
      "sales_invoices_url": "http://moneybird.dev/123/sales_invoices/45ed86e329e147d4a91c8039a71a58c4c360ce0defde9b6b116dbe27f3395e2e/all",
      "notes": [

      ],
      "custom_fields": [

      ]
    },
    "reference": "2013-01234",
    "date": "2017-05-23",
    "due_date": "2017-06-06",
    "entry_number": 4,
    "state": "open",
    "currency": "EUR",
    "exchange_rate": "1.0",
    "revenue_invoice": false,
    "prices_are_incl_tax": false,
    "origin": null,
    "paid_at": null,
    "tax_number": "",
    "total_price_excl_tax": "300.0",
    "total_price_excl_tax_base": "300.0",
    "total_price_incl_tax": "363.0",
    "total_price_incl_tax_base": "363.0",
    "created_at": "2017-05-23T09:34:39.941Z",
    "updated_at": "2017-05-23T09:34:39.948Z",
    "details": [
      {
        "id": "190119472765339642",
        "administration_id": 123,
        "tax_rate_id": "190119429771626316",
        "ledger_account_id": "190119429568202551",
        "product_id": null,
        "amount": null,
        "amount_decimal": 1,
        "description": "Delivery Apple iPad",
        "price": "300.0",
        "period": null,
        "row_order": 0,
        "total_price_excl_tax_with_discount": "300.0",
        "total_price_excl_tax_with_discount_base": "300.0",
        "tax_report_reference": [
          "NL/5b"
        ],
        "created_at": "2017-05-23T09:34:39.945Z",
        "updated_at": "2017-05-23T09:34:39.945Z"
      }
    ],
    "payments": [

    ],
    "notes": [

    ],
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 14955320389696,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": null,
        "created_at": "2017-05-23T09:34:39.952Z",
        "updated_at": "2017-05-23T09:34:39.952Z"
      }
    ]
  }
]

Get purchase invoices

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.

page Integer
per_page Integer

Example: returns a list of purchase_invoices

Request

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

Response

Status: 200 OK
[
  {
    "id": "190119465001682730",
    "administration_id": 123,
    "contact_id": "190119464305428251",
    "contact": {
      "id": "190119464305428251",
      "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": "",
      "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": "FRST",
      "credit_card_number": "",
      "credit_card_reference": "",
      "credit_card_type": null,
      "tax_number_validated_at": null,
      "invoice_workflow_id": null,
      "estimate_workflow_id": null,
      "created_at": "2017-05-23T09:34:31.874Z",
      "updated_at": "2017-05-23T09:34:31.874Z",
      "sales_invoices_url": "http://moneybird.dev/123/sales_invoices/df792a179dbeafce3f9e34313fb8dfe83e532fff970a1be7b97042738cb97cd1/all",
      "notes": [

      ],
      "custom_fields": [

      ]
    },
    "reference": "2013-01234",
    "date": "2017-05-23",
    "due_date": "2017-06-06",
    "entry_number": 5,
    "state": "open",
    "currency": "EUR",
    "exchange_rate": "1.0",
    "revenue_invoice": false,
    "prices_are_incl_tax": false,
    "origin": null,
    "paid_at": null,
    "tax_number": "",
    "total_price_excl_tax": "300.0",
    "total_price_excl_tax_base": "300.0",
    "total_price_incl_tax": "363.0",
    "total_price_incl_tax_base": "363.0",
    "created_at": "2017-05-23T09:34:32.540Z",
    "updated_at": "2017-05-23T09:34:32.547Z",
    "details": [
      {
        "id": "190119465005877035",
        "administration_id": 123,
        "tax_rate_id": "190119429771626316",
        "ledger_account_id": "190119429568202551",
        "product_id": null,
        "amount": null,
        "amount_decimal": 1,
        "description": "Delivery Apple iPad",
        "price": "300.0",
        "period": null,
        "row_order": 0,
        "total_price_excl_tax_with_discount": "300.0",
        "total_price_excl_tax_with_discount_base": "300.0",
        "tax_report_reference": [
          "NL/5b"
        ],
        "created_at": "2017-05-23T09:34:32.544Z",
        "updated_at": "2017-05-23T09:34:32.544Z"
      }
    ],
    "payments": [

    ],
    "notes": [

    ],
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 14955320389696,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": null,
        "created_at": "2017-05-23T09:34:32.551Z",
        "updated_at": "2017-05-23T09:34:32.551Z"
      }
    ]
  },
  {
    "id": "190119464846493479",
    "administration_id": 123,
    "contact_id": "190119464305428251",
    "contact": {
      "id": "190119464305428251",
      "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": "",
      "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": "FRST",
      "credit_card_number": "",
      "credit_card_reference": "",
      "credit_card_type": null,
      "tax_number_validated_at": null,
      "invoice_workflow_id": null,
      "estimate_workflow_id": null,
      "created_at": "2017-05-23T09:34:31.874Z",
      "updated_at": "2017-05-23T09:34:31.874Z",
      "sales_invoices_url": "http://moneybird.dev/123/sales_invoices/df792a179dbeafce3f9e34313fb8dfe83e532fff970a1be7b97042738cb97cd1/all",
      "notes": [

      ],
      "custom_fields": [

      ]
    },
    "reference": "2013-01234",
    "date": "2017-05-23",
    "due_date": "2017-06-06",
    "entry_number": 4,
    "state": "open",
    "currency": "EUR",
    "exchange_rate": "1.0",
    "revenue_invoice": false,
    "prices_are_incl_tax": false,
    "origin": null,
    "paid_at": null,
    "tax_number": "",
    "total_price_excl_tax": "300.0",
    "total_price_excl_tax_base": "300.0",
    "total_price_incl_tax": "363.0",
    "total_price_incl_tax_base": "363.0",
    "created_at": "2017-05-23T09:34:32.392Z",
    "updated_at": "2017-05-23T09:34:32.400Z",
    "details": [
      {
        "id": "190119464850687784",
        "administration_id": 123,
        "tax_rate_id": "190119429771626316",
        "ledger_account_id": "190119429568202551",
        "product_id": null,
        "amount": null,
        "amount_decimal": 1,
        "description": "Delivery Apple iPad",
        "price": "300.0",
        "period": null,
        "row_order": 0,
        "total_price_excl_tax_with_discount": "300.0",
        "total_price_excl_tax_with_discount_base": "300.0",
        "tax_report_reference": [
          "NL/5b"
        ],
        "created_at": "2017-05-23T09:34:32.396Z",
        "updated_at": "2017-05-23T09:34:32.396Z"
      }
    ],
    "payments": [

    ],
    "notes": [

    ],
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 14955320389696,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": null,
        "created_at": "2017-05-23T09:34:32.407Z",
        "updated_at": "2017-05-23T09:34:32.407Z"
      }
    ]
  },
  {
    "id": "190119464702838564",
    "administration_id": 123,
    "contact_id": "190119464305428251",
    "contact": {
      "id": "190119464305428251",
      "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": "",
      "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": "FRST",
      "credit_card_number": "",
      "credit_card_reference": "",
      "credit_card_type": null,
      "tax_number_validated_at": null,
      "invoice_workflow_id": null,
      "estimate_workflow_id": null,
      "created_at": "2017-05-23T09:34:31.874Z",
      "updated_at": "2017-05-23T09:34:31.874Z",
      "sales_invoices_url": "http://moneybird.dev/123/sales_invoices/df792a179dbeafce3f9e34313fb8dfe83e532fff970a1be7b97042738cb97cd1/all",
      "notes": [

      ],
      "custom_fields": [

      ]
    },
    "reference": "2013-01234",
    "date": "2017-05-23",
    "due_date": "2017-06-06",
    "entry_number": 3,
    "state": "open",
    "currency": "EUR",
    "exchange_rate": "1.0",
    "revenue_invoice": false,
    "prices_are_incl_tax": false,
    "origin": null,
    "paid_at": null,
    "tax_number": "",
    "total_price_excl_tax": "300.0",
    "total_price_excl_tax_base": "300.0",
    "total_price_incl_tax": "363.0",
    "total_price_incl_tax_base": "363.0",
    "created_at": "2017-05-23T09:34:32.255Z",
    "updated_at": "2017-05-23T09:34:32.262Z",
    "details": [
      {
        "id": "190119464704935717",
        "administration_id": 123,
        "tax_rate_id": "190119429771626316",
        "ledger_account_id": "190119429568202551",
        "product_id": null,
        "amount": null,
        "amount_decimal": 1,
        "description": "Delivery Apple iPad",
        "price": "300.0",
        "period": null,
        "row_order": 0,
        "total_price_excl_tax_with_discount": "300.0",
        "total_price_excl_tax_with_discount_base": "300.0",
        "tax_report_reference": [
          "NL/5b"
        ],
        "created_at": "2017-05-23T09:34:32.258Z",
        "updated_at": "2017-05-23T09:34:32.258Z"
      }
    ],
    "payments": [

    ],
    "notes": [

    ],
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 14955320389696,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": null,
        "created_at": "2017-05-23T09:34:32.267Z",
        "updated_at": "2017-05-23T09:34:32.267Z"
      }
    ]
  }
]

Example: returns paginated purchase invoices on page 1

Request

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

Response

Status: 200 OK
[
  {
    "id": "190119465972664126",
    "administration_id": 123,
    "contact_id": "190119465229223727",
    "contact": {
      "id": "190119465229223727",
      "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": "",
      "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": "FRST",
      "credit_card_number": "",
      "credit_card_reference": "",
      "credit_card_type": null,
      "tax_number_validated_at": null,
      "invoice_workflow_id": null,
      "estimate_workflow_id": null,
      "created_at": "2017-05-23T09:34:32.756Z",
      "updated_at": "2017-05-23T09:34:32.756Z",
      "sales_invoices_url": "http://moneybird.dev/123/sales_invoices/bd78ec8f2b9626628f88a0736410fe98d809814409e8bc9be5da46c1f63b5b87/all",
      "notes": [

      ],
      "custom_fields": [

      ]
    },
    "reference": "2013-01234",
    "date": "2017-05-23",
    "due_date": "2017-06-06",
    "entry_number": 5,
    "state": "open",
    "currency": "EUR",
    "exchange_rate": "1.0",
    "revenue_invoice": false,
    "prices_are_incl_tax": false,
    "origin": null,
    "paid_at": null,
    "tax_number": "",
    "total_price_excl_tax": "300.0",
    "total_price_excl_tax_base": "300.0",
    "total_price_incl_tax": "363.0",
    "total_price_incl_tax_base": "363.0",
    "created_at": "2017-05-23T09:34:33.466Z",
    "updated_at": "2017-05-23T09:34:33.473Z",
    "details": [
      {
        "id": "190119465975809855",
        "administration_id": 123,
        "tax_rate_id": "190119429771626316",
        "ledger_account_id": "190119429568202551",
        "product_id": null,
        "amount": null,
        "amount_decimal": 1,
        "description": "Delivery Apple iPad",
        "price": "300.0",
        "period": null,
        "row_order": 0,
        "total_price_excl_tax_with_discount": "300.0",
        "total_price_excl_tax_with_discount_base": "300.0",
        "tax_report_reference": [
          "NL/5b"
        ],
        "created_at": "2017-05-23T09:34:33.469Z",
        "updated_at": "2017-05-23T09:34:33.469Z"
      }
    ],
    "payments": [

    ],
    "notes": [

    ],
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 14955320389696,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": null,
        "created_at": "2017-05-23T09:34:33.477Z",
        "updated_at": "2017-05-23T09:34:33.477Z"
      }
    ]
  }
]

Example: returns paginated purchase invoices on page 2

Request

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

Response

Status: 200 OK
[
  {
    "id": "190119466600761167",
    "administration_id": 123,
    "contact_id": "190119466136241987",
    "contact": {
      "id": "190119466136241987",
      "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": "",
      "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": "FRST",
      "credit_card_number": "",
      "credit_card_reference": "",
      "credit_card_type": null,
      "tax_number_validated_at": null,
      "invoice_workflow_id": null,
      "estimate_workflow_id": null,
      "created_at": "2017-05-23T09:34:33.622Z",
      "updated_at": "2017-05-23T09:34:33.622Z",
      "sales_invoices_url": "http://moneybird.dev/123/sales_invoices/ec6d5cb0f3f4f951f44011e2db570945192b74d4503e6b382653743fb4092f1f/all",
      "notes": [

      ],
      "custom_fields": [

      ]
    },
    "reference": "2013-01234",
    "date": "2017-05-23",
    "due_date": "2017-06-06",
    "entry_number": 4,
    "state": "open",
    "currency": "EUR",
    "exchange_rate": "1.0",
    "revenue_invoice": false,
    "prices_are_incl_tax": false,
    "origin": null,
    "paid_at": null,
    "tax_number": "",
    "total_price_excl_tax": "300.0",
    "total_price_excl_tax_base": "300.0",
    "total_price_incl_tax": "363.0",
    "total_price_incl_tax_base": "363.0",
    "created_at": "2017-05-23T09:34:34.066Z",
    "updated_at": "2017-05-23T09:34:34.073Z",
    "details": [
      {
        "id": "190119466603906896",
        "administration_id": 123,
        "tax_rate_id": "190119429771626316",
        "ledger_account_id": "190119429568202551",
        "product_id": null,
        "amount": null,
        "amount_decimal": 1,
        "description": "Delivery Apple iPad",
        "price": "300.0",
        "period": null,
        "row_order": 0,
        "total_price_excl_tax_with_discount": "300.0",
        "total_price_excl_tax_with_discount_base": "300.0",
        "tax_report_reference": [
          "NL/5b"
        ],
        "created_at": "2017-05-23T09:34:34.069Z",
        "updated_at": "2017-05-23T09:34:34.069Z"
      }
    ],
    "payments": [

    ],
    "notes": [

    ],
    "attachments": [

    ],
    "events": [
      {
        "administration_id": 123,
        "user_id": 14955320389696,
        "action": "document_saved",
        "link_entity_id": null,
        "link_entity_type": null,
        "data": null,
        "created_at": "2017-05-23T09:34:34.078Z",
        "updated_at": "2017-05-23T09:34:34.078Z"
      }
    ]
  }
]

Example: returns an error when too many purchase invoices are requested

Request

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

Response

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

Get purchase invoices

Example: returns the wanted purchase_invoice

Request

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

Response

Status: 200 OK
{
  "id": "190119467788797809",
  "administration_id": 123,
  "contact_id": "190119467567548267",
  "contact": {
    "id": "190119467567548267",
    "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": "",
    "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": "FRST",
    "credit_card_number": "",
    "credit_card_reference": "",
    "credit_card_type": null,
    "tax_number_validated_at": null,
    "invoice_workflow_id": null,
    "estimate_workflow_id": null,
    "created_at": "2017-05-23T09:34:34.988Z",
    "updated_at": "2017-05-23T09:34:34.988Z",
    "sales_invoices_url": "http://moneybird.dev/123/sales_invoices/0d51b43a705927c47853254b3dbfa575113bf62df14d418330d592c3a382196c/all",
    "notes": [

    ],
    "custom_fields": [

    ]
  },
  "reference": "2013-01234",
  "date": "2017-05-23",
  "due_date": "2017-06-06",
  "entry_number": 2,
  "state": "open",
  "currency": "EUR",
  "exchange_rate": "1.0",
  "revenue_invoice": false,
  "prices_are_incl_tax": false,
  "origin": null,
  "paid_at": null,
  "tax_number": "",
  "total_price_excl_tax": "300.0",
  "total_price_excl_tax_base": "300.0",
  "total_price_incl_tax": "363.0",
  "total_price_incl_tax_base": "363.0",
  "created_at": "2017-05-23T09:34:35.198Z",
  "updated_at": "2017-05-23T09:34:35.204Z",
  "details": [
    {
      "id": "190119467791943538",
      "administration_id": 123,
      "tax_rate_id": "190119429771626316",
      "ledger_account_id": "190119429568202551",
      "product_id": null,
      "amount": null,
      "amount_decimal": 1,
      "description": "Delivery Apple iPad",
      "price": "300.0",
      "period": null,
      "row_order": 0,
      "total_price_excl_tax_with_discount": "300.0",
      "total_price_excl_tax_with_discount_base": "300.0",
      "tax_report_reference": [
        "NL/5b"
      ],
      "created_at": "2017-05-23T09:34:35.202Z",
      "updated_at": "2017-05-23T09:34:35.202Z"
    }
  ],
  "payments": [

  ],
  "notes": [

  ],
  "attachments": [

  ],
  "events": [
    {
      "administration_id": 123,
      "user_id": 14955320389696,
      "action": "document_saved",
      "link_entity_id": null,
      "link_entity_type": null,
      "data": null,
      "created_at": "2017-05-23T09:34:35.208Z",
      "updated_at": "2017-05-23T09:34:35.208Z"
    }
  ]
}

Example: only returns purchase_invoices

Request

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

Response

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

Create a new purchase invoices

Parameters

Parameter Type Description
purchase_invoice[contact_id] Integer

Required. Should be a valid contact id.

purchase_invoice[reference] String

Required.

purchase_invoice[date] String

Required

Required.

purchase_invoice[due_date] String
purchase_invoice[currency] String

ISO three-character currency code, e.g. EUR or USD.

purchase_invoice[prices_are_incl_tax] Boolean
purchase_invoice[revenue_invoice] Boolean
purchase_invoice[details_attributes][*][id] Integer

Should be a valid detail id.

purchase_invoice[details_attributes][*][description] String
purchase_invoice[details_attributes][*][period] String

String with a date range: 20140101..20141231, presets are also allowed: this_month, prev_month, next_month, etc.

purchase_invoice[details_attributes][*][price] Decimal

Both a decimal and a string ‘10,95’ are accepted.

purchase_invoice[details_attributes][*][amount] String
purchase_invoice[details_attributes][*][tax_rate_id] Integer

Should be a valid tax rate id.

purchase_invoice[details_attributes][*][ledger_account_id] Integer

Should be a valid ledger account id.

purchase_invoice[details_attributes][*][row_order] Integer
purchase_invoice[details_attributes][*][_destroy] Boolean

Example: creates the purchase_invoice

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPOST \
  -d '{"purchase_invoice":{"reference":"foobar","contact_id":190119468251219841,"details_attributes":{"0":{"description":"Lunch","price":20,"tax_rate_id":190119429771626316,"ledger_account_id":190119429568202551}}}}' \
  https://moneybird.com/api/v2/123/documents/purchase_invoices.json

Response

Status: 201 Created
{
  "id": "190119468574181258",
  "administration_id": 123,
  "contact_id": "190119468251219841",
  "contact": {
    "id": "190119468251219841",
    "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": "",
    "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": "FRST",
    "credit_card_number": "",
    "credit_card_reference": "",
    "credit_card_type": null,
    "tax_number_validated_at": null,
    "invoice_workflow_id": null,
    "estimate_workflow_id": null,
    "created_at": "2017-05-23T09:34:35.639Z",
    "updated_at": "2017-05-23T09:34:35.639Z",
    "sales_invoices_url": "http://moneybird.dev/123/sales_invoices/739dd58d776aea1edb8612e5c7afc022894cc17cc3b7637754debc65d9ab67c1/all",
    "notes": [

    ],
    "custom_fields": [

    ]
  },
  "reference": "foobar",
  "date": "2017-05-23",
  "due_date": null,
  "entry_number": 3,
  "state": "open",
  "currency": "EUR",
  "exchange_rate": "1.0",
  "revenue_invoice": false,
  "prices_are_incl_tax": false,
  "origin": null,
  "paid_at": null,
  "tax_number": "",
  "total_price_excl_tax": "20.0",
  "total_price_excl_tax_base": "20.0",
  "total_price_incl_tax": "24.2",
  "total_price_incl_tax_base": "24.2",
  "created_at": "2017-05-23T09:34:35.947Z",
  "updated_at": "2017-05-23T09:34:35.953Z",
  "details": [
    {
      "id": "190119468577326987",
      "administration_id": 123,
      "tax_rate_id": "190119429771626316",
      "ledger_account_id": "190119429568202551",
      "product_id": null,
      "amount": null,
      "amount_decimal": 1,
      "description": "Lunch",
      "price": "20.0",
      "period": null,
      "row_order": 0,
      "total_price_excl_tax_with_discount": "20.0",
      "total_price_excl_tax_with_discount_base": "20.0",
      "tax_report_reference": [
        "NL/5b"
      ],
      "created_at": "2017-05-23T09:34:35.950Z",
      "updated_at": "2017-05-23T09:34:35.950Z"
    }
  ],
  "payments": [

  ],
  "notes": [

  ],
  "attachments": [

  ],
  "events": [
    {
      "administration_id": 123,
      "user_id": 14955320389696,
      "action": "document_saved",
      "link_entity_id": null,
      "link_entity_type": null,
      "data": null,
      "created_at": "2017-05-23T09:34:35.957Z",
      "updated_at": "2017-05-23T09:34:35.957Z"
    }
  ]
}

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/purchase_invoices.json

Response

Status: 400 Bad Request
{
  "error": "Purchase Invoice is required",
  "symbolic": {
    "purchase_invoice": "required"
  }
}

Delete a purchase invoices

Example: deletes the purchase_invoice

Request

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

Response

Status: 200 OK
200

Update a purchase invoices

Parameters

Parameter Type Description
purchase_invoice[contact_id] Integer

Required. Should be a valid contact id.

purchase_invoice[reference] String

Required.

purchase_invoice[date] String

Required

Required.

purchase_invoice[due_date] String
purchase_invoice[currency] String

ISO three-character currency code, e.g. EUR or USD.

purchase_invoice[prices_are_incl_tax] Boolean
purchase_invoice[revenue_invoice] Boolean
purchase_invoice[details_attributes][*][id] Integer

Should be a valid detail id.

purchase_invoice[details_attributes][*][description] String
purchase_invoice[details_attributes][*][period] String

String with a date range: 20140101..20141231, presets are also allowed: this_month, prev_month, next_month, etc.

purchase_invoice[details_attributes][*][price] Decimal

Both a decimal and a string ‘10,95’ are accepted.

purchase_invoice[details_attributes][*][amount] String
purchase_invoice[details_attributes][*][tax_rate_id] Integer

Should be a valid tax rate id.

purchase_invoice[details_attributes][*][ledger_account_id] Integer

Should be a valid ledger account id.

purchase_invoice[details_attributes][*][row_order] Integer
purchase_invoice[details_attributes][*][_destroy] Boolean

Example: updates the purchase_invoice

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPATCH \
  -d '{"purchase_invoice":{"reference":"updated reference"}}' \
  https://moneybird.com/api/v2/123/documents/purchase_invoices/190119469223249824.json

Response

Status: 200 OK
200

Example: updates invoice details

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPATCH \
  -d '{"purchase_invoice":{"details_attributes":{"0":{"description":"New detail","price":99,"amount":1,"tax_rate_id":190119429771626316,"ledger_account_id":190119429568202551},"1":{"id":190119469632194477,"_destroy":true}}}}' \
  https://moneybird.com/api/v2/123/documents/purchase_invoices/190119469629048748.json

Response

Status: 200 OK
200

Register a payment for a purchase invoice

Parameters

Parameter Type Description
payment[payment_date] String

Required

payment[price] Decimal

Required

Both a decimal and a string ‘10,95’ are accepted. Should be a number -1,000,000,000 <= n <= 1,000,000,000.

payment[price_base] Decimal

Amount in base currency. Should be a number -1,000,000,000 <= n <= 1,000,000,000.

payment[financial_account_id] Integer

Should be a valid financial account id.

payment[financial_mutation_id] Integer

Should be a valid financial mutation id.

linked_payment_id Integer
refresh_journal_entries Boolean

Add attachment to purchase invoice

Example: uploads an attachment

Request

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

Response

Status: 200 OK
200

Top