Browse Documentation
- Report
- Overview
- Organizations
- GET Get Organisation
- POST Update Organisation
- Invoices
- POST Create Invoice
- GET Get Invoice
- PUT Update Invoice
- DELETE Delete Invoice
- POST Approve Invoice
- POST Add Attachment
- DELETE Delete Attachment from Invoice
- POST Send Invoice
- POST Pay Invoice
- Purchases
- POST Create Purchase
- GET Get Purchase
- PUT Update Purchase
- DELETE Delete Purchase
- POST Approve Purchase
- POST Add Attachment to Purchase
- DELETE Delete Attachment from Purchase
- POST Pay Purchase
- Pos sales
- GET Get POS Sales
- POST Create POS Sale
- PUT Update POS Sale
- DELETE Delete POS Sale
- POST Add POSSales Payment
- Offers
- POST Create Offer
- GET Get Offer
- PUT Update Offer
- DELETE Delete Offer
- POST Add Attachment to Offer
- DELETE Delete Attachment from Offer
- POST Send Offer
- POST Convert to Invoice
- Items
- POST Create Item
- GET Get Item
- POST Update Item
- POST Add Item Picture
- DELETE Delete Item Picture
- Item categories
- Contacts
- POST Create Contact
- GET Get Contact
- PUT Update Contact
- Account types
- GET Account Types
- Accounts
- POST Create Account
- GET Get Account
- Financial accounts
- Taxes
- POST Create Tax
- GET Get Tax
- Invoice template
- GET Get Template
- POST Update Invoice Template
- POST Upload Template Logo
- POST Create New Invoice Template
- DELETE Delete Invoice Temaplate
- Inbox
- POST Upload Attachment
- GET Get Attachments
- DELETE Delete Attachment
- Payments
- DELETE Delete Payment
- Journals
- GET Get journals
- Banks
- GET List banks
- Team
- POST Create Team Member
- GET List Team Members
- DELETE Remove Team Members
PUT Update purchase
Update Purchase
PUT
/purchases/:id
Update an existing purchase
Parameters
Parameter | Type | Description |
---|---|---|
supplier_id | required | String | The supplier that provides the items |
date_issed | Date YYYY-MM-DD | The date the invoice was issued |
date_due | Date YYYY-MM-DD | The expiration date of the invoice |
reference | String | Any name that you wish to use as a reference |
Items | Array[object] | Items to be added to the invoice |
items[title] | required | String | Item title |
items[description] | String | Description of the item |
items[quantity] | required | Int | Item Quantity |
items[price] | required | Float|Int | Item Price |
items[tax_id] | required | String | Item Tax ID |
items[include_tax] | Bool | Enter 1 if you want the tax to be included and 0 if the tax to be excluded |
items[gl_account_id] | required | String | General ledger account |
Only parameters supplied will be updated. Parameters not part of the request will be left unchanged.
Updating, removing and adding offer items:
• When an id is added if an existing offer item that item will be updated
• When an item without id is part of the request a new item will be created
• When there are existing offer items that are not part of the request or their id was not supplied these items will be deleted.
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer token" \ -XPUT \ -d '{ "purchase": { "supplier_id": "1615c6926a25a72b31ee320d0889e82f6395511c", "date_issued": "2017-04-24", "items": [ { "id": "2417f43fb9ec75daa3abad35f0ab9a42eebc1910", "title": "item 01", "quantity": 1, "price": 100, "tax_id": "fd62ee6c1d65e4729da41f85cdd328dfc816d161" "gl_account-id": "aefb526889e1059a61ecce700a3363c388a93335" }, { "title": "item 03", "quantity": 5, "price": 60, "tax_id": "fd62ee6c1d65e4729da41f85cdd328dfc816d161" "gl_account-id": "aefb526889e1059a61ecce700a3363c388a93335" } ] } }' \ https://dev.accounteer.com/api/v0.1/offers/ba775d2a3f9612ab288489f20ceab582f7f62fd5
Response
{ "id": "ba775d2a3f9612ab288489f20ceab582f7f62fd5", "organization_id": "daa71f0644647c0d82dd2d03d0b29779644b1a48", "document_number": "OFF-2016012", "supplier_id": "1615c6926a25a72b31ee320d0889e82f6395511c", "template_id": "6510e39e71217f262c39b3525831f2a5405fc5e8", "total_amount": 484, "total_base_amount": 400, "total_tax_amount": 84, "currency": "EUR", "date_issued": "2017-04-24", "date_due": "2017-08-23", "date_created": "2017-07-24", "date_updated": "2017-07-24", "status": "approved", "reference": null, "items": [{ "id": "2417f43fb9ec75daa3abad35f0ab9a42eebc1910", "title": "item 01", "description": null, "quantity": 1, "item_base_amount": 100, "tax_id": "fd62ee6c1d65e4729da41f85cdd328dfc816d161", "tax_name": "VAT 21%", "tax_percentage": 21, "line_base_amount": 100, "line_tax_amount": 21, "line_total_amount": 121, "tax_included": false, "price": 100, "gl_account": { "id": "aefb526889e1059a61ecce700a3363c388a93335", "code": "611000", "title": "General and adminsitrative expenses", "description": null } }, { "id": "49994051623260b12d2744ef2753bd6b791c9792", "title": "item 03", "description": null, "quantity": 5, "item_base_amount": 60, "tax_id": "fd62ee6c1d65e4729da41f85cdd328dfc816d161", "tax_name": "VAT 21%", "tax_percentage": 21, "line_base_amount": 300, "line_tax_amount": 63, "line_total_amount": 363, "tax_included": false, "price": 300, "gl_account": { "id": "aefb526889e1059a61ecce700a3363c388a93335", "code": "611000", "title": "General and adminsitrative expenses", "description": null } }] }