Browse Documentation
PUT Update offer

Update Offer

PUT /offers/:id

Update an existing offer

Parameters

  Parameter
  Type
 Description
 client_id | required
  String
 The client you are sending the invoice to 
 date_issued
  Date YYYY-MM-DD
 The date the invoice was issued
 date_due
  Date YYYY-MM-DD
 The expiration date of the invoice
 template_id
  String
 Invoice Template for the invoice 
 invoice_id  String Invoice ID of the invoice that originated from this offer
 reference
  String
 Any name that you wish to use as a reference
 Items | required
  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]
  int
 Enter 1 if you want the tax to be included and 0 if the tax  to be excluded

A PUT request is expected to be sent to the above endpoint where the content body must be JSON string containing all parameters that are needed to update an existing offer. The below example demonstrates how to update an Offer.

Request

   
curl -s -H "Content-Type: application/json"
-H "Authorization: Bearer token" \
-XPUT \
-d '{
 "offer": {
 "client_id": "1615c6926a25a72b31ee320d0889e82f6395511c",
 "date_issued": "2017-04-24",
 "items": [
 {
      "id": "2417f43fb9ec75daa3abad35f0ab9a42eebc1910",  
 "title": "item 01",
 "quantity": 1,
 "price": 100,
 "tax_id": "fd62ee6c1d65e4729da41f85cdd328dfc816d161"
 },
 {
 "title": "item 03",
 "quantity": 5,
 "price": 60,
 "tax_id": "fd62ee6c1d65e4729da41f85cdd328dfc816d161"
 }
 ]
 }
}' \
https://dev.accounteer.com/api/v0.1/offers/ba775d2a3f9612ab288489f20ceab582f7f62fd5
     

Response

{
    "id": "ba775d2a3f9612ab288489f20ceab582f7f62fd5",
    "organization_id": "daa71f0644647c0d82dd2d03d0b29779644b1a48",
    "document_number": "OFF-2016012",
    "client_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
    }, {
         "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
    }]
}