Skip to content

Latest commit

 

History

History
174 lines (115 loc) · 8.93 KB

README.md

File metadata and controls

174 lines (115 loc) · 8.93 KB

PolarOrders

(customerPortal->orders)

Overview

Available Operations

list

List orders of the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

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

$request = new Operations\CustomerPortalOrdersListRequest(
    organizationId: [
        '1dbfc517-0bbf-4301-9ba8-555ca42b9737',
    ],
);
$requestSecurity = new Operations\CustomerPortalOrdersListSecurity(
    customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);

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


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.
security Operations\CustomerPortalOrdersListSecurity ✔️ The security requirements to use for the request.

Response

?Operations\CustomerPortalOrdersListResponse

Errors

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

get

Get an order by ID for the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

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


$requestSecurity = new Operations\CustomerPortalOrdersGetSecurity(
    customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);

$response = $sdk->customerPortal->orders->get(
    security: $requestSecurity,
    id: '<value>'

);

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

Parameters

Parameter Type Required Description
security Operations\CustomerPortalOrdersGetSecurity ✔️ The security requirements to use for the request.
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.

Scopes: customer_portal:read customer_portal:write

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

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


$requestSecurity = new Operations\CustomerPortalOrdersInvoiceSecurity(
    customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);

$response = $sdk->customerPortal->orders->invoice(
    security: $requestSecurity,
    id: '<value>'

);

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

Parameters

Parameter Type Required Description
security Operations\CustomerPortalOrdersInvoiceSecurity ✔️ The security requirements to use for the request.
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 */*