Skip to content
This repository was archived by the owner on Jul 22, 2026. It is now read-only.

Latest commit

 

History

History
176 lines (117 loc) · 16.1 KB

File metadata and controls

176 lines (117 loc) · 16.1 KB

CustomerPortal.BenefitGrants

Overview

Available Operations

  • list - List Benefit Grants
  • get - Get Benefit Grant
  • update - Update Benefit Grant

list

List benefits grants 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\CustomerPortalBenefitGrantsListRequest();
$requestSecurity = new Operations\CustomerPortalBenefitGrantsListSecurity(
    customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);

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


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

Parameters

Parameter Type Required Description
$request Operations\CustomerPortalBenefitGrantsListRequest ✔️ The request object to use for the request.
security Operations\CustomerPortalBenefitGrantsListSecurity ✔️ The security requirements to use for the request.

Response

?Operations\CustomerPortalBenefitGrantsListResponse

Errors

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

get

Get a benefit grant 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\CustomerPortalBenefitGrantsGetSecurity(
    customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);

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

);

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

Parameters

Parameter Type Required Description
security Operations\CustomerPortalBenefitGrantsGetSecurity ✔️ The security requirements to use for the request.
id string ✔️ The benefit grant ID.

Response

?Operations\CustomerPortalBenefitGrantsGetResponse

Errors

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

update

Update a benefit grant for the authenticated customer.

Scopes: customer_portal:write

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


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

$response = $sdk->customerPortal->benefitGrants->update(
    security: $requestSecurity,
    id: '<value>',
    customerBenefitGrantUpdate: new Components\CustomerBenefitGrantLicenseKeysUpdate()

);

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

Parameters

Parameter Type Required Description
security Operations\CustomerPortalBenefitGrantsUpdateSecurity ✔️ The security requirements to use for the request.
id string ✔️ The benefit grant ID.
customerBenefitGrantUpdate Components\CustomerBenefitGrantDiscordUpdate|Components\CustomerBenefitGrantGitHubRepositoryUpdate|Components\CustomerBenefitGrantDownloadablesUpdate|Components\CustomerBenefitGrantLicenseKeysUpdate|Components\CustomerBenefitGrantCustomUpdate|Components\CustomerBenefitGrantMeterCreditUpdate|Components\CustomerBenefitGrantFeatureFlagUpdate ✔️ N/A

Response

?Operations\CustomerPortalBenefitGrantsUpdateResponse

Errors

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