Create purchase invoice
Authorization
bearer AuthorizationBearer <token>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.biterp.ai/purchase-invoices" \ -H "Content-Type: application/json" \ -d '{ "supplier_id": "3cb1e20c-c6c9-4e71-ba66-399c468f697c", "supplier_document_number": "string", "product_type": "goods", "purchase_date": "2019-08-24", "items": [ { "item_description": "string", "quantity": "2.000000", "unit_price": "150.000000" } ] }'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"supplier_id": "3cb1e20c-c6c9-4e71-ba66-399c468f697c",
"financial_account_id": "12004dd2-b67b-4561-b5c8-278b86c292fd",
"financial_category_id": "a6b66ee2-6cb9-4e40-8c14-5161236f36c0",
"reference_code": "string",
"supplier_document_number": "string",
"supplier_document_series": "string",
"status": "draft",
"situation": "string",
"operation_type": "string",
"product_type": "string",
"purchase_date": "2019-08-24",
"due_date": "2019-08-24",
"received_date": "2019-08-24",
"description": "string",
"notes": "string",
"discount_amount": "string",
"discount_rate": "string",
"subtotal": "string",
"items_discount": "string",
"total_discount": "string",
"total_tax": "string",
"withheld_total": "string",
"net_payable_total": "string",
"total": "string",
"items": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"purchase_invoice_id": "6494c12d-9877-4bea-b653-beca7297d403",
"product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
"item_description": "string",
"quantity": "string",
"unit_price": "string",
"discount_amount": "string",
"subtotal": "string",
"total": "string",
"position": 0,
"br_data": {
"purchase_invoice_item_id": "050b2c3c-e4e6-4e79-8bb8-1181b16398b4",
"ncm_code": "string",
"cest_code": "string",
"cfop": "string",
"cst": "string",
"ibs_cbs_cst": "string",
"ibs_cbs_classification": "string",
"ibs_cbs_operation_indicator_code": "string",
"ibs_cbs_is_personal_use": true
},
"us_data": {
"purchase_invoice_item_id": "050b2c3c-e4e6-4e79-8bb8-1181b16398b4",
"vendor_sku": "string",
"hts_code": "string",
"tax_code": "string",
"purchase_tax_category": "string"
}
}
],
"taxes": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"purchase_invoice_id": "6494c12d-9877-4bea-b653-beca7297d403",
"purchase_invoice_item_id": "050b2c3c-e4e6-4e79-8bb8-1181b16398b4",
"tax_code": "string",
"tax_name": "string",
"base_amount": "string",
"rate": "string",
"amount": "string",
"jurisdiction": "string",
"is_withheld": true,
"is_included": true,
"position": 0
}
],
"br_data": {
"purchase_invoice_id": "6494c12d-9877-4bea-b653-beca7297d403",
"nfe_access_key": "string",
"nfe_number": "string",
"nfe_series": "string",
"issuer_cnpj": "string",
"issuer_ie": "string",
"issuer_name": "string",
"capture_status": "string"
},
"us_data": {
"purchase_invoice_id": "6494c12d-9877-4bea-b653-beca7297d403",
"po_number": "string",
"vendor_invoice_number": "string",
"net_terms": 0,
"form_1099_type": "string",
"form_1099_reportable": true,
"use_tax_self_assessed": true
},
"supplier": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"legal_name": "string",
"trade_name": "string",
"tax_id": "string"
},
"deleted_by_user_id": "e06321af-43d5-4340-818b-555f83254c47",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted_at": "2019-08-24T14:15:22Z"
}{
"statusCode": 422,
"message": "Could not resolve provided geography fields",
"error": "Unprocessable Entity",
"details": {
"fields": {
"country_code": [
"Could not resolve country from '1112' (tried ISO2, ISO3, numeric code and names)"
],
"city": [
"Could not resolve city from 'CidadeQueNaoExiste' in country 'BR'"
]
}
}
}{
"statusCode": 404,
"message": "Customer not found",
"error": "Not Found",
"code": "CUSTOMER_NOT_FOUND"
}{
"statusCode": 404,
"message": "Customer not found",
"error": "Not Found",
"code": "CUSTOMER_NOT_FOUND"
}{
"statusCode": 404,
"message": "Customer not found",
"error": "Not Found",
"code": "CUSTOMER_NOT_FOUND"
}{
"statusCode": 422,
"message": "Could not resolve provided geography fields",
"error": "Unprocessable Entity",
"details": {
"fields": {
"country_code": [
"Could not resolve country from '1112' (tried ISO2, ISO3, numeric code and names)"
],
"city": [
"Could not resolve city from 'CidadeQueNaoExiste' in country 'BR'"
]
}
}
}{
"statusCode": 404,
"message": "Customer not found",
"error": "Not Found",
"code": "CUSTOMER_NOT_FOUND"
}
