This topic is locked

Invoice API

12/19/2023 3:45:02 PM
Invoice template support forum
M
Malcolm Garbutt author

I am unable to get the invoice API to work. (PHPRunner 10.91). I have followed the blog (https://xlinesoft.com/blog/2019/02/07/using-invoice-template-as-a-checkout-solution/) and built each stage except the email code. Everything seems to be working although I am not sure of what validations are applied. Thus the $parameters and $header look okay to me. The $url is confusing as there are two invoices_add.php files (locally in output and in output/include/pages) but none in the invoice folder ($url = "https://yourwebsite.com/invoice/invoices_add.php";). I tried both with the same result.

It looks like the runner_post_request is not firing as this is the "$res = runner_post_request($url, $parameters, $headers);" returns
Array
(
[error] => CURL error:
[content] =>
)

Here are the $url, $parametes, and $header that I have used:
$url (running local whiel testing)
http://127.0.0.1:8086/include/pages/invoices_add.php // also http://127.0.0.1:8086/invoices_add.php

$parameters
Array
(
[invoice] => {"company_name":"Legal Verify","seller_info":"Legal Verify Info, Legal Verify Address ","buyer_info":"Verda A. Fulks","buyer_address":"buyer address","buyer_email":"buyer@email.com","tax":"0","terms":"terms","invoice_number":"INV-X0000020","details":[{"item":"item_Product 1","price":45.00,"quantity":1},{"item":"item_Product 2","price":32.00,"quantity":1},{"item":"item_Product 3","price":137.00,"quantity":1}]}
)

$headers
Array
(
[WWW-Authenticate] => <** the "API Key" in settings "Invoice API">
)

Any idea where I am going wrong?