Skip to content

Latest commit

 

History

History
274 lines (181 loc) · 17.4 KB

File metadata and controls

274 lines (181 loc) · 17.4 KB

CustomerPortal.Seats

Overview

Available Operations

listSeats

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\CustomerPortalSeatsListSeatsSecurity(
    customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);

$response = $sdk->customerPortal->seats->listSeats(
    security: $requestSecurity,
    subscriptionId: '<id>'

);

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

Parameters

Parameter Type Required Description
security Operations\CustomerPortalSeatsListSeatsSecurity ✔️ The security requirements to use for the request.
subscriptionId ?string Subscription ID
orderId ?string Order ID

Response

?Operations\CustomerPortalSeatsListSeatsResponse

Errors

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

assignSeat

Assign Seat

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Components;
use Polar\Models\Operations;

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

$request = new Components\SeatAssign();
$requestSecurity = new Operations\CustomerPortalSeatsAssignSeatSecurity(
    customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);

$response = $sdk->customerPortal->seats->assignSeat(
    request: $request,
    security: $requestSecurity
);

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

Parameters

Parameter Type Required Description
$request Components\SeatAssign ✔️ The request object to use for the request.
security Operations\CustomerPortalSeatsAssignSeatSecurity ✔️ The security requirements to use for the request.

Response

?Operations\CustomerPortalSeatsAssignSeatResponse

Errors

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

revokeSeat

Revoke Seat

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

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


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

$response = $sdk->customerPortal->seats->revokeSeat(
    security: $requestSecurity,
    seatId: '4b3d74b3-01ff-4aac-bd03-320535cd5ce4'

);

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

Parameters

Parameter Type Required Description
security Operations\CustomerPortalSeatsRevokeSeatSecurity ✔️ The security requirements to use for the request.
seatId string ✔️ N/A

Response

?Operations\CustomerPortalSeatsRevokeSeatResponse

Errors

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

resendInvitation

Resend Invitation

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

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


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

$response = $sdk->customerPortal->seats->resendInvitation(
    security: $requestSecurity,
    seatId: 'e3817437-8d53-4578-88d2-1dc256825965'

);

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

Parameters

Parameter Type Required Description
security Operations\CustomerPortalSeatsResendInvitationSecurity ✔️ The security requirements to use for the request.
seatId string ✔️ N/A

Response

?Operations\CustomerPortalSeatsResendInvitationResponse

Errors

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

listClaimedSubscriptions

List all subscriptions where the authenticated customer has claimed a seat.

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\CustomerPortalSeatsListClaimedSubscriptionsSecurity(
    customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);

$responses = $sdk->customerPortal->seats->listClaimedSubscriptions(
    security: $requestSecurity,
    page: 1,
    limit: 10

);


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

Parameters

Parameter Type Required Description
security Operations\CustomerPortalSeatsListClaimedSubscriptionsSecurity ✔️ The security requirements to use for the request.
page ?int Page number, defaults to 1.
limit ?int Size of a page, defaults to 10. Maximum is 100.

Response

?Operations\CustomerPortalSeatsListClaimedSubscriptionsResponse

Errors

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