Skip to content

Latest commit

 

History

History
156 lines (98 loc) · 10.6 KB

README.md

File metadata and controls

156 lines (98 loc) · 10.6 KB

BenefitGrants

(customerPortal->benefitGrants)

Overview

Available Operations

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

get

Get a benefit grant by ID for the authenticated customer or user.

Example Usage

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
}

Parameters

Parameter Type Required Description
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 */*

list

List benefits grants of the authenticated customer or user.

Example Usage

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
    }
}

Parameters

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

Response

?Operations\CustomerPortalBenefitGrantsListResponse

Errors

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

update

Update a benefit grant for the authenticated customer or user.

Example Usage

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
}

Parameters

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

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 */*