(customerPortal->orders)
List orders of the authenticated customer.
Scopes: customer_portal:read
customer_portal:write
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
}
}
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. |
?Operations\CustomerPortalOrdersListResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Get an order by ID for the authenticated customer.
Scopes: customer_portal:read
customer_portal:write
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
}
Parameter | Type | Required | Description |
---|---|---|---|
security |
Operations\CustomerPortalOrdersGetSecurity | ✔️ | The security requirements to use for the request. |
id |
string | ✔️ | The order ID. |
?Operations\CustomerPortalOrdersGetResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Get an order's invoice data.
Scopes: customer_portal:read
customer_portal:write
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
}
Parameter | Type | Required | Description |
---|---|---|---|
security |
Operations\CustomerPortalOrdersInvoiceSecurity | ✔️ | The security requirements to use for the request. |
id |
string | ✔️ | The order ID. |
?Operations\CustomerPortalOrdersInvoiceResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |