Skip to content

Latest commit

 

History

History
117 lines (77 loc) · 8.24 KB

File metadata and controls

117 lines (77 loc) · 8.24 KB

CustomerPortal.Wallets

Overview

Available Operations

  • list - List Wallets
  • get - Get Wallet

list

List wallets of the authenticated customer.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

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


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

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

);


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

Parameters

Parameter Type Required Description
security Operations\CustomerPortalWalletsListSecurity ✔️ 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.
sorting array<Components\CustomerWalletSortProperty> Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.

Response

?Operations\CustomerPortalWalletsListResponse

Errors

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

get

Get a wallet by ID for the authenticated customer.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

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


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

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

);

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

Parameters

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

Response

?Operations\CustomerPortalWalletsGetResponse

Errors

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