(checkoutLinks)
- create - Create Checkout Link
- delete - Delete Checkout Link
- get - Get Checkout Link
- list - List Checkout Links
- update - Update Checkout Link
Create a checkout link.
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();
$request = new Components\CheckoutLinkProductCreate(
productId: '<value>',
);
$response = $sdk->checkoutLinks->create(
request: $request
);
if ($response->checkoutLink !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Components\CheckoutLinkProductCreate|Components\CheckoutLinkPriceCreate | ✔️ | The request object to use for the request. |
?Operations\CheckoutLinksCreateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Delete a checkout link.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$response = $sdk->checkoutLinks->delete(
id: '<value>'
);
if ($response->statusCode === 200) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | The checkout link ID. |
?Operations\CheckoutLinksDeleteResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Get a checkout link by ID.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$response = $sdk->checkoutLinks->get(
id: '<value>'
);
if ($response->checkoutLink !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | The checkout link ID. |
?Operations\CheckoutLinksGetResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
List checkout links.
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\CheckoutLinksListRequest();
$responses = $sdk->checkoutLinks->list(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\CheckoutLinksListRequest | ✔️ | The request object to use for the request. |
?Operations\CheckoutLinksListResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Update a checkout link.
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();
$checkoutLinkUpdate = new Components\CheckoutLinkUpdate();
$response = $sdk->checkoutLinks->update(
id: '<value>',
checkoutLinkUpdate: $checkoutLinkUpdate
);
if ($response->checkoutLink !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | The checkout link ID. |
checkoutLinkUpdate |
Components\CheckoutLinkUpdate | ✔️ | N/A |
?Operations\CheckoutLinksUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |