Create Invoice Line Items

This API allows you to create invoice line items. It can be used from various sources such as a web browser, native applications in Android, or iOS devices.

URL :

Endpoint :

http://<server-ip-address>/custom_api/capex_track_invoice_line_item/create

Method : POST

URL ParametersRequired
json (In the future, this parameter might change to become the default format)Yes

Form Data Parameters:

KeyDetailValue
business_unit_name:Specify the business unit nameAlmiranta1 / Aurora
request_numberThe request number associated with the invoice.AU-2020-4133
PO_numberThe associated purchase order number1
invoice_numberThe invoice number .1
amount_in_vendor_currencyThe amount in the vendor’s currency.58
vendor_currencyThe currency of the vendorUSD
assetThe asset related to the invoice line item.
work_orderWork order details.
invoice_dateThe date of the invoice .2020-02-02
general_cost_type_idID of the general cost type7
CERCER (Cost Estimation Request) information.
quantityQuantity of items being invoiced10
quantity_receivedQuantity received for the invoiced items895
unit_cost:Unit cost of the items9857
rateThe rate associated with the invoice.2
expense_typeType of expense, such as “Capital Expenditures”.

Header Parameters :

Authorization :

Bearer <Token> (Include a valid access token to authorize the API request)

Success Response:

Code : 200

Content :

{
  "code": 200,
  "message": "success",
  "data": []
}

Error Response :

Code: 401 BAD REQUEST

Content :

{
  "code": 401,
  "message": "fail",
  "data": {
    "error": "Invalid API Token"
  }
}

Code: 400

Content :

{
  "code": 400,
  "message": "fail",
  "data": {
    "[field_name]": [
      "This field is missing."
    ]
  }
}

Code: 400

Content :

{
  "code": 400,
  "message": "fail",
  "data": {
    "[PO_number]": "Multiple PO found!"
  }
}

Note : The success response may change in the future if necessary. Ensure you have a valid access token (Bearer Token) in the request header for authorization.

cURL Command :

Here’s an example of how you can use cURL to make a POST request to the API endpoint:

cURL -X POST :

'http://<server-ip-address>/custom_api/capex_track_invoice_line_item/create' \

     -H 'Authorization: Bearer <Token>' \

     -H 'Content-Type: application/x-www-form-urlencoded' \

     -d 'business_unit_name=Almiranta1' \

     -d 'request_number=AU-2020-4133' \

     -d 'PO_number=1' \

     -d 'invoice_number=I1' \

     -d 'amount_in_vendor_currency=58' \

     -d 'vendor_currency=USD' \

     -d 'asset=Asset' \

     -d 'work_order=Work Order' \

     -d 'invoice_date=2020-02-02' \

     -d 'general_cost_type_id=7' \

     -d 'CER=CER' \

     -d 'quantity=10' \

     -d 'quantity_received=895' \

     -d 'unit_cost=9857' \

     -d 'rate=2' \

     -d 'expense_type=Capital Expenditures'

Note : Replace and in the URL and Authorization header, respectively, with the actual server IP address and valid access token. Additionally, ensure that the form data parameters are correctly formatted according to the API’s requirements.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top