Free online api for bills
Post body should have key 'data'
The value of data is json encoded array of objects:
A request example in PHP
params: role (the value of role can be 'customer', 'suplier' or 'owner')
Response:
Post bills info
url: https://bills.apcom.app/api/v1/billsPost body should have key 'data'
The value of data is json encoded array of objects:
[{"IDE_supplier":"CHE-457.610.847","IDE_customer":"CHE-199.781.513","doc_number":"2020000416","doc_type":14,"doc_date":"2020-03-26","doc_time":"","doc_reference":"20-03-0066","doc_currency":"CHF","line_type":1,"line_order":"","line_date":"","line_id":1536,"line_ean":"103.6963","line_sia":"80574904","line_description":"Interrupteur 1737 DAV","line_quantity":1,"line_unit_price":"11.35","line_unit":"ST","line_discount_percent":0,"line_discount_amount":"","line_total_price":"11.35","line_accounting":3015,"line_ch_vat_percent":7.7,"line_ch_vat_statut":2,"doc_discount_percent":0,"doc_discount_amount":"","doc_total_exclued_ch_vat":"12.20","doc_total_inclued_ch_vat":13.14,"doc_total_ch_vat":0.9394,"doc_ch_vat_rounded":0.94,"doc_paiement_deadline":"2020-07-14"}]
Array of objects:
[
{
IDE_supplier: "CHE-457.610.847",
IDE_customer: "CHE-199.781.513",
doc_number: "2020000416",
doc_type: 14,
doc_date: "2020-03-26",
doc_time: "",
doc_reference: "20-03-0066",
doc_currency: "CHF",
line_type: 1,
line_order: "",
line_date: "",
line_id: 1536,
line_ean: "103.6963",
line_sia: "80574904",
line_description: "Interrupteur 1737 DAV",
line_quantity: 1,
line_unit_price: "11.35",
line_unit: "ST",
line_discount_percent: 0,
line_discount_amount: "",
line_total_price: "11.35",
line_accounting: 3015,
line_ch_vat_percent: 7.7,
line_ch_vat_statut: 2,
doc_discount_percent: 0,
doc_discount_amount: "",
doc_post_discount_percent:0.00,
doc_post_discount_amount:0.00,
doc_general_rounding: 0.00,
doc_total_exclued_ch_vat: "12.20",
doc_total_inclued_ch_vat: 13.14,
doc_total_ch_vat: 0.9394,
doc_ch_vat_rounded: 0.94,
doc_paiement_deadline: "2020-07-14"
},
...
]
Correspondance:
| IDE_supplier | IDE number of the document issuer | Compulsory | |
| IDE_customer | IDE number of the document recipient if no IDE, corresponding ID |
||
| doc_number | 1 | Compulsory | |
| doc_type | 2 | 100 Offer 200 Order confirmation 300 Worksheet 400 Delivery slip 500 Invoice |
Compulsory |
| doc_date | 3 | Compulsory | |
| doc_time | 4 | Optional | |
| doc_reference | 5 | Optional | |
| doc_currency | 7 | Optional (default CHF) | |
| line_type | 49 | 10-20 Item 30 Texte 40 Subtotal, total 50 Title 60 Reduction |
Optional |
| line_order | 48 | The range of accepted vales goes from 1 to 9999 | Optional |
| line_date | 52 | Optional | |
| line_id | 50 | C(30) example: WINWORDXP2003 | Optional The field is compulsory if you want to add or update a WinBIZ item |
| line_ean | 81 | Bar code | Optional |
| line_sia | 88 | CAN number | Optional |
| line_description | 51 | Description | Optional |
| line_quantity | 53 | Quantity N(15,4) 1.0000 | Optional |
| line_unit_price | 54 | Unit price in local currency | Optional |
| line_unit | 55 | Unit | Optional |
| line_discount_percent | 56 | Rebate% | Optional The accepted range of values goes from 1 to 100 |
| line_discount_amount | 67 | Rebate amount N(13,2) | Optional |
| line_total_price | 57 | Total line amount N(12, 2) | Optional |
| line_accounting | 60 | Turnover account | Optional |
| line_ch_vat_percent | 61 | VAT% N(15, 2) | Compulsory |
| line_ch_vat_statut | 62 | TVA Included/Excluded (0,1=includes 2=excluded) | Compulsory |
| doc_discount_percent | Total discount % | Optional | |
| doc_discount_amount | 144 | Discount amount | Optional |
| doc_post_discount_percent | |||
| doc_post_discount_amount | |||
| doc_general_rounding | |||
| doc_total_exclued_ch_vat | 6 | Compulsory | |
| doc_total_inclued_ch_vat | Compulsory | ||
| doc_total_ch_vat | Compulsory | ||
| doc_ch_vat_rounded | 72 | Arrondi TVA |
Optional 0 - 1 = 1 ct, 2 = 5 cts, 4 = 0.1 ct; |
| doc_paiement_deadline | 141 | Delay to due date in days | Optional |
$response = Http::withToken($access_token)->post( $url, [
'data' => collect($rows)->toJson() ,
]);
Response:
{
"status": "success"
}
Test with Postman :
Edit
If a old record has the same 'IDE_supplier', 'doc_number', 'line_type' and 'line_id' as a new record, the old record with be modified by the new one.Get bills info
url: https://bills.apcom.app/api/v1/billsparams: role (the value of role can be 'customer', 'suplier' or 'owner')
Response:
[
{
"id": 4,
"IDE_supplier": "CHE-457.610.847",
"IDE_customer": "CHE-199.781.513",
"doc_number": "2020000416",
"doc_type": "14",
"doc_date": "2020-03-26",
"doc_time": "",
"doc_reference": "20-03-0066",
"doc_currency": "CHF",
"line_type": "1",
"line_order": "",
"line_date": "",
"line_id": "1536",
"line_ean": "103.6963",
"line_sia": "80574904",
"line_description": "Interrupteur 1737 DAV",
"line_quantity": 1,
"line_unit_price": "11.35",
"line_unit": "ST",
"line_discount_percent": "0.00",
"line_discount_amount": "0.00",
"line_total_price": "11.35",
"line_accounting": "3015",
"line_ch_vat_percent": "7.70",
"line_ch_vat_statut": "2",
"doc_discount_percent": "0.00",
"doc_discount_amount": "0.00",
"doc_post_discount_percent": "0.00",
"doc_post_discount_amount": "0.00",
"doc_general_rounding":"0.00",
"doc_total_exclued_ch_vat": "12.20",
"doc_total_inclued_ch_vat": "13.14",
"doc_total_ch_vat": "0.9394",
"doc_ch_vat_rounded": "0.94",
"doc_paiement_deadline": "2020-07-14",
"created_at": "2020-06-16T06:49:21.000000Z",
"updated_at": "2020-06-16T06:56:53.000000Z"
},
...
]
Test with Postman: