You send it as the body:
// $invoiceXml = ...;
$response = $client->request('POS', 'https://accountname.invoicexpress.com/invoices.xml', ['body' => $invoiceXml] );
See the Guzzle docs.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a button to create an invoice after a payment using this API "https://invoicexpress.com/api/invoices/create". I'm testing with test values for now using Guzzle. I'm a beginner with API´s and I'm not understanding the process.
In the documentation says that to create a new invoice is necessary to make a POST request to the following URL "https://{account-name}.app.invoicexpress.com/invoices.xml" with the XML data of the new invoice on the request body.
I'm not understanding that part of how to send a POST request to that URL with the necessary parameters.
I have a route and method for when a button to generate an invoice is clicked:
Method:
public function generateInvoice(){
$client = new \GuzzleHttp\Client();
$response = $client->request('POS', 'https://accountname.invoicexpress.com/invoices.xml');
dd($response->getStatusCode());
}
But how to send a Post request in the generateInvocie() to the URL of the API with the parameters? The URL doesn't have any parameter.
Please or to participate in this conversation.