Invoice Line Items

Get a list of all line items

ENDPOINT
  GET /lineItems

SAMPLE CALL
  curl -u [your_bullet_username]:[your_api_key] https://accounts-app-intl.bullethq.com/api/v1/lineItems


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
[{
    "id" : 1
    "name": "An API Line Item name",
    "defaultDescription": "The default description for this line item",
    "defaultQuantity": 50,
    "defaultRate": "40",
    "defaultSalesTaxCode": "STANDARD_2012",
    "displayQuantity": false,
    "displayRate": false
}, {
    "id" : 3
    "name": "Another API Line Item name",
    "defaultDescription": "The default description for this line item",
    "defaultQuantity": 5,
    "defaultRate": "400",
    "defaultSalesTaxCode": "REDUCED_2011",
    "displayQuantity": false,
    "displayRate": false
}]

Create a line item

Only "name" is a mandatory field when creating a line item.

Sales Taxes for your company must be set up in Bullet before you start using the api. When creating a sales tax, you have to set a unique string "code" to identify the sales tax. It is this value that should be used for "defaultSalesTaxCode" field.

ENDPOINT
  POST /lineItems


SAMPLE CALL
     curl -u [your_bullet_username]:[your_api_key]
    -H "Accept: application/json"
    -H "Content-type: application/json"
    -X POST
    https://accounts-app-intl.bullethq.com/api/v1/lineItems
    --data @createLineItem.json

SAMPLE createLineItem.json

{
    "name": "An API Line Item name",
    "defaultDescription": "The default description for this line item",
    "defaultQuantity": 50,
    "defaultRate": "40",
    "defaultSalesTaxCode": "STANDARD_2012",
    "displayQuantity": false,
    "displayRate": false
}

RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id" : 1
    "name": "An API Line Item name",
    "defaultDescription": "The default description for this line item",
    "defaultQuantity": 50,
    "defaultRate": "40",
    "defaultSalesTaxCode": "STANDARD_2012",
    "displayQuantity": false,
    "displayRate": false
}

Get a line item

ENDPOINT
  GET /lineItems/[lineItem_id]


SAMPLE CALL
    curl -u [your_bullet_username]:[your_api_key] \
    -H "Accept: application/json" \
    -H "Content-type: application/json" \
    -X GET \
    https://accounts-app-intl.bullethq.com/api/v1/lineItems/3


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id": 3,
    "name": "An API Line Item name",
    "defaultDescription": "The default description for this line item",
    "defaultQuantity": 50,
    "defaultRate": "40",
    "defaultSalesTaxCode": "STANDARD_2012",
    "displayQuantity": false,
    "displayRate": false
}

Update a line item

When updating the line it is necessary to put the "id" of the element in the body aswell as the url otherwise you might get an error complaining that "name" is already used

ENDPOINT
  PUT /lineItems/[lineItem_id]

SAMPLE CALL
     curl -u [your_bullet_username]:[your_api_key]
    -H "Accept: application/json"
    -H "Content-type: application/json"
    -X PUT
    https://accounts-app-intl.bullethq.com/api/v1/lineItems/3
    --data @updateLineItem.json

SAMPLE updateLineItem.json

{
    "id": 3
    "name": "Updated API Line Item name",
    "defaultDescription": "new description",
    "defaultQuantity": 50,
    "defaultRate": "40",
    "defaultSalesTaxCode": "STANDARD_2012",
    "displayQuantity": true,
    "displayRate": true
}


RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE

{
    "id": 3
    "name": "Updated API Line Item name",
    "defaultDescription": "new description",
    "defaultQuantity": 50,
    "defaultRate": "40",
    "defaultSalesTaxCode": "STANDARD_2012",
    "displayQuantity": true,
    "displayRate": true
}

Delete a line item

ENDPOINT
  DELETE /lineItems/[lineItem_id]

SAMPLE CALL
    curl -u [your_bullet_username]:[your_api_key]  \
    -H "Accept: application/json"  \
    -H "Content-type: application/json"
    -X DELETE   \
    https://accounts-app-intl.bullethq.com/api/v1/lineItems/1

RESPONSE CODES
  200 - Successful call

SAMPLE RESPONSE
{
    "id" : 1
    "name": "An API Line Item name",
    "defaultDescription": "The default description for this line item",
    "defaultQuantity": 50,
    "defaultRate": "40",
    "defaultSalesTaxCode": "STANDARD_2012",
    "displayQuantity": false,
    "displayRate": false
}