You are here

API.txt in Invoice 7

Example data:

GET URI (replace 999 with invoice ID / number):
/invoice/api/invoice.json/999
/invoice/api/invoice.html/999
/invoice/api/invoice.pdf/999

POST URI:
/invoice/api/invoice.json

PUT URI (replace 999 with invoice ID / number):
/invoice/api/invoice.json/999

POST or PUT body

{
    "leading_zeros": "4",
    "prefix": "%Y",
    "description": "This is the invoice description",
    "template": "default",
    "pay_limit": 0,
    "pay_status": "paid",
    "customer": {
        "customer_number": 1,
        "company_name": "Awesome company",
        "firstname": "John",
        "lastname": "Doe",
        "street": "Example street",
        "building_number": 1,
        "zipcode": "1234 AB",
        "city": "Amsterdam",
        "state": "Noord-Holland",
        "country": "Nederland",
        "coc_number": 12345678,
        "vat_number": "NL012345678B01",
        "description": "Best company ever!"
    },
    "items": [
        {
            "description": "Subscription 01-01-2012 t/m 31-12-2012",
            "quantity": "1",
            "unitcost": "50.75",
            "vat": "21"
        },
        {
            "description": "Sent SMS messages",
            "quantity": "28",
            "unitcost": "0.22",
            "vat": "21"
        }
    ]
}

File

API.txt
View source
  1. Example data:
  2. GET URI (replace 999 with invoice ID / number):
  3. /invoice/api/invoice.json/999
  4. /invoice/api/invoice.html/999
  5. /invoice/api/invoice.pdf/999
  6. POST URI:
  7. /invoice/api/invoice.json
  8. PUT URI (replace 999 with invoice ID / number):
  9. /invoice/api/invoice.json/999
  10. POST or PUT body
  11. {
  12. "leading_zeros": "4",
  13. "prefix": "%Y",
  14. "description": "This is the invoice description",
  15. "template": "default",
  16. "pay_limit": 0,
  17. "pay_status": "paid",
  18. "customer": {
  19. "customer_number": 1,
  20. "company_name": "Awesome company",
  21. "firstname": "John",
  22. "lastname": "Doe",
  23. "street": "Example street",
  24. "building_number": 1,
  25. "zipcode": "1234 AB",
  26. "city": "Amsterdam",
  27. "state": "Noord-Holland",
  28. "country": "Nederland",
  29. "coc_number": 12345678,
  30. "vat_number": "NL012345678B01",
  31. "description": "Best company ever!"
  32. },
  33. "items": [
  34. {
  35. "description": "Subscription 01-01-2012 t/m 31-12-2012",
  36. "quantity": "1",
  37. "unitcost": "50.75",
  38. "vat": "21"
  39. },
  40. {
  41. "description": "Sent SMS messages",
  42. "quantity": "28",
  43. "unitcost": "0.22",
  44. "vat": "21"
  45. }
  46. ]
  47. }