Skip to content

Latest commit

 

History

History
151 lines (94 loc) · 4.36 KB

README.md

File metadata and controls

151 lines (94 loc) · 4.36 KB

Orders

(orders)

Overview

Available Operations

get

Get an order by ID.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Polar\Polar::builder()->setSecurity($security)->build();



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

if ($response->order !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
id string ✔️ The order ID.

Response

?Operations\OrdersGetResponse

Errors

Error Type Status Code Content Type
Errors\ResourceNotFound 404 application/json
Errors\HTTPValidationError 422 application/json
Errors\APIException 4XX, 5XX */*

invoice

Get an order's invoice data.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Polar\Polar::builder()->setSecurity($security)->build();



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

if ($response->orderInvoice !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
id string ✔️ The order ID.

Response

?Operations\OrdersInvoiceResponse

Errors

Error Type Status Code Content Type
Errors\ResourceNotFound 404 application/json
Errors\HTTPValidationError 422 application/json
Errors\APIException 4XX, 5XX */*

list

List orders.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Polar\Polar::builder()->setSecurity($security)->build();

$request = new Operations\OrdersListRequest();

$responses = $sdk->orders->list(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\OrdersListRequest ✔️ The request object to use for the request.

Response

?Operations\OrdersListResponse

Errors

Error Type Status Code Content Type
Errors\HTTPValidationError 422 application/json
Errors\APIException 4XX, 5XX */*