Skip to main content
GET
/
v1
/
orders
/
{id}
/
invoice
PHP (SDK)
declare(strict_types=1);

require 'vendor/autoload.php';

use Spaire;

$sdk = Spaire\Spaire::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->orders->invoice(
    id: '<value>'
);

if ($response->orderInvoice !== null) {
    // handle response
}
{
  "url": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.spairehq.com/llms.txt

Use this file to discover all available pages before exploring further.

The invoice must be generated first before it can be retrieved. You should call the POST /v1/orders/{id}/invoice endpoint to generate the invoice.If the invoice is not generated, you will receive a 404 error.

Authorizations

Authorization
string
header
required

You can generate an Organization Access Token from your organization's settings.

Path Parameters

id
string<uuid4>
required

The order ID.

Response

Successful Response

Order's invoice data.

url
string
required

The URL to the invoice.