Skip to content

Latest commit

 

History

History
151 lines (94 loc) · 4.94 KB

README.md

File metadata and controls

151 lines (94 loc) · 4.94 KB

PolarOrders

(customerPortal->orders)

Overview

Available Operations

get

Get an order by ID for the authenticated customer or user.

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->customerPortal->orders->get(
    id: '<value>'
);

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

Parameters

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

Response

?Operations\CustomerPortalOrdersGetResponse

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->customerPortal->orders->invoice(
    id: '<value>'
);

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

Parameters

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

Response

?Operations\CustomerPortalOrdersInvoiceResponse

Errors

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

list

List orders of the authenticated customer or user.

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\CustomerPortalOrdersListRequest();

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


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

Parameters

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

Response

?Operations\CustomerPortalOrdersListResponse

Errors

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