List benefits grants 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\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
}
}| 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. |
?Operations\CustomerPortalBenefitGrantsListResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\HTTPValidationError | 422 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Get a benefit grant 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\CustomerPortalBenefitGrantsGetSecurity(
customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);
$response = $sdk->customerPortal->benefitGrants->get(
security: $requestSecurity,
id: '<value>'
);
if ($response->customerBenefitGrant !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
security |
Operations\CustomerPortalBenefitGrantsGetSecurity | ✔️ | The security requirements to use for the request. |
id |
string | ✔️ | The benefit grant ID. |
?Operations\CustomerPortalBenefitGrantsGetResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\ResourceNotFound | 404 | application/json |
| Errors\HTTPValidationError | 422 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Update a benefit grant for the authenticated customer.
Scopes: customer_portal:write
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
}| 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 |
?Operations\CustomerPortalBenefitGrantsUpdateResponse
| 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 | */* |