All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| createPurchaseOrderV1() | POST /api/billing/v1/orders | Create purchase order |
createPurchaseOrderV1($billingV1OrderPurchaseRequest): \Hostinger\Model\BillingV1OrderOrderResourceCreate purchase order
Create a purchase order for any Hostinger product. This unified endpoint places an order for one or more catalog items and works across all Hostinger products, leveraging the existing billing infrastructure. Use the catalog endpoint to look up the item_id values available for purchase. If no payment method is provided, your default payment method will be used automatically. If the response is 202 Accepted, the payment is still being processed and the order will complete asynchronously once the payment is confirmed. This endpoint only places the order. Product-specific provisioning (e.g. VPS setup or domain registration) is not performed here — once the order completes, use the relevant product endpoints or hPanel to finalize setup. Use this endpoint to purchase any product available in the catalog.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\BillingOrdersApi(config: $config);
$billingV1OrderPurchaseRequest = new \Hostinger\Model\BillingV1OrderPurchaseRequest(); // \Hostinger\Model\BillingV1OrderPurchaseRequest
try {
$result = $apiInstance->createPurchaseOrderV1($billingV1OrderPurchaseRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BillingOrdersApi->createPurchaseOrderV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| billingV1OrderPurchaseRequest | \Hostinger\Model\BillingV1OrderPurchaseRequest |
\Hostinger\Model\BillingV1OrderOrderResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]