(customerPortal->benefitGrants)
Get a benefit grant by ID for the authenticated customer or user.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$response = $sdk->customerPortal->benefitGrants->get(
id: '<value>'
);
if ($response->customerBenefitGrant !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
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 | */* |
List benefits grants of the authenticated customer or user.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$request = new Operations\CustomerPortalBenefitGrantsListRequest();
$responses = $sdk->customerPortal->benefitGrants->list(
request: $request
);
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. |
?Operations\CustomerPortalBenefitGrantsListResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Update a benefit grant for the authenticated customer or user.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$response = $sdk->customerPortal->benefitGrants->update(
id: '<value>',
customerBenefitGrantUpdate: new Components\CustomerBenefitGrantLicenseKeysUpdate()
);
if ($response->customerBenefitGrant !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | The benefit grant ID. |
customerBenefitGrantUpdate |
Components\CustomerBenefitGrantDiscordUpdate|Components\CustomerBenefitGrantGitHubRepositoryUpdate|Components\CustomerBenefitGrantDownloadablesUpdate|Components\CustomerBenefitGrantLicenseKeysUpdate|Components\CustomerBenefitGrantAdsUpdate|Components\CustomerBenefitGrantCustomUpdate | ✔️ | 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 | */* |