All URIs are relative to https://api.keap.com/crm, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| cancelSubscription() | POST /rest/v2/subscriptions/{subscription_id}:deactivate | Cancel Subscription |
| createSubscription() | POST /rest/v2/subscriptions | Create Subscription |
| createSubscriptionCustomField() | POST /rest/v2/subscriptions/model/customFields | Create a Subscription Custom Field |
| deleteSubscriptionCustomField() | DELETE /rest/v2/subscriptions/model/customFields/{custom_field_id} | Delete a Subscription Custom Field |
| getSubscription() | GET /rest/v2/subscriptions/{subscription_id} | Retrieve a Subscription |
| listSubscriptions() | GET /rest/v2/subscriptions | List Subscriptions |
| retrieveSubscriptionCustomFieldModel() | GET /rest/v2/subscriptions/model | Retrieve Subscription Custom Field Model |
| updateSubscription() | PATCH /rest/v2/subscriptions/{subscription_id} | Update a Subscription |
| updateSubscriptionCustomField() | PATCH /rest/v2/subscriptions/model/customFields/{custom_field_id} | Update a Subscription Custom Field |
cancelSubscription($subscription_id, $cancel_subscription_request)Cancel Subscription
Cancels the specified subscription
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\SubscriptionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$subscription_id = 'subscription_id_example'; // string
$cancel_subscription_request = new \Keap\Core\V2\Model\CancelSubscriptionRequest(); // \Keap\Core\V2\Model\CancelSubscriptionRequest
try {
$apiInstance->cancelSubscription($subscription_id, $cancel_subscription_request);
} catch (Exception $e) {
echo 'Exception when calling SubscriptionsApi->cancelSubscription: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| subscription_id | string | ||
| cancel_subscription_request | \Keap\Core\V2\Model\CancelSubscriptionRequest |
void (empty response body)
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createSubscription($create_subscription_request_detail): \Keap\Core\V2\Model\SubscriptionDetailCreate Subscription
Creates a subscription with the specified product and product subscription id.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\SubscriptionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$create_subscription_request_detail = new \Keap\Core\V2\Model\CreateSubscriptionRequestDetail(); // \Keap\Core\V2\Model\CreateSubscriptionRequestDetail
try {
$result = $apiInstance->createSubscription($create_subscription_request_detail);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SubscriptionsApi->createSubscription: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| create_subscription_request_detail | \Keap\Core\V2\Model\CreateSubscriptionRequestDetail |
\Keap\Core\V2\Model\SubscriptionDetail
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createSubscriptionCustomField($create_custom_field_request): \Keap\Core\V2\Model\CustomFieldMetaDataCreate a Subscription Custom Field
Creates a custom field of the specified type and options to the Subscription object
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\SubscriptionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$create_custom_field_request = new \Keap\Core\V2\Model\CreateCustomFieldRequest(); // \Keap\Core\V2\Model\CreateCustomFieldRequest
try {
$result = $apiInstance->createSubscriptionCustomField($create_custom_field_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SubscriptionsApi->createSubscriptionCustomField: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| create_custom_field_request | \Keap\Core\V2\Model\CreateCustomFieldRequest |
\Keap\Core\V2\Model\CustomFieldMetaData
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteSubscriptionCustomField($custom_field_id)Delete a Subscription Custom Field
Deletes a custom field from the Subscription object
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\SubscriptionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$custom_field_id = 'custom_field_id_example'; // string
try {
$apiInstance->deleteSubscriptionCustomField($custom_field_id);
} catch (Exception $e) {
echo 'Exception when calling SubscriptionsApi->deleteSubscriptionCustomField: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| custom_field_id | string |
void (empty response body)
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getSubscription($subscription_id): \Keap\Core\V2\Model\SubscriptionDetailRetrieve a Subscription
Retrieves a single subscription
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\SubscriptionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$subscription_id = 'subscription_id_example'; // string
try {
$result = $apiInstance->getSubscription($subscription_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SubscriptionsApi->getSubscription: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| subscription_id | string |
\Keap\Core\V2\Model\SubscriptionDetail
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listSubscriptions($filter, $order_by, $page_size, $page_token): \Keap\Core\V2\Model\ListSubscriptionsResponseListList Subscriptions
Retrieves a list of subscriptions using the specified search criteria.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\SubscriptionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$filter = 'filter_example'; // string | Filter to apply, allowed fields are: - (String) `contact_id` - (String) `subscription_plan_id` - (String) `status`
$order_by = 'order_by_example'; // string | Attribute and direction to order items. One of the following fields: - `id` - `contact_id` - `subscription_plan_id` One of the following directions: - `asc` - `desc`
$page_size = 0; // int | Total number of items to return per page
$page_token = 'page_token_example'; // string | Page token
try {
$result = $apiInstance->listSubscriptions($filter, $order_by, $page_size, $page_token);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SubscriptionsApi->listSubscriptions: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| filter | string | Filter to apply, allowed fields are: - (String) `contact_id` - (String) `subscription_plan_id` - (String) `status` | [optional] |
| order_by | string | Attribute and direction to order items. One of the following fields: - `id` - `contact_id` - `subscription_plan_id` One of the following directions: - `asc` - `desc` | [optional] |
| page_size | int | Total number of items to return per page | [optional] |
| page_token | string | Page token | [optional] |
\Keap\Core\V2\Model\ListSubscriptionsResponseList
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
retrieveSubscriptionCustomFieldModel(): \Keap\Core\V2\Model\ObjectModelRetrieve Subscription Custom Field Model
Get the custom fields for the Subscription object
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\SubscriptionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->retrieveSubscriptionCustomFieldModel();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SubscriptionsApi->retrieveSubscriptionCustomFieldModel: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
\Keap\Core\V2\Model\ObjectModel
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateSubscription($subscription_id, $update_subscription_request_detail, $update_mask): \Keap\Core\V2\Model\SubscriptionDetailUpdate a Subscription
Updates a Subscription
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\SubscriptionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$subscription_id = 'subscription_id_example'; // string
$update_subscription_request_detail = new \Keap\Core\V2\Model\UpdateSubscriptionRequestDetail(); // \Keap\Core\V2\Model\UpdateSubscriptionRequestDetail
$update_mask = 'update_mask_example'; // string | An optional list of properties to be updated. If set, only the provided properties will be updated and others will be skipped.
try {
$result = $apiInstance->updateSubscription($subscription_id, $update_subscription_request_detail, $update_mask);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SubscriptionsApi->updateSubscription: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| subscription_id | string | ||
| update_subscription_request_detail | \Keap\Core\V2\Model\UpdateSubscriptionRequestDetail | ||
| update_mask | string | An optional list of properties to be updated. If set, only the provided properties will be updated and others will be skipped. | [optional] |
\Keap\Core\V2\Model\SubscriptionDetail
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateSubscriptionCustomField($custom_field_id, $update_custom_field_meta_data_request, $update_mask): \Keap\Core\V2\Model\CustomFieldMetaDataUpdate a Subscription Custom Field
Updates a custom field of the specified type and options to the Subscription object
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\SubscriptionsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$custom_field_id = 'custom_field_id_example'; // string
$update_custom_field_meta_data_request = new \Keap\Core\V2\Model\UpdateCustomFieldMetaDataRequest(); // \Keap\Core\V2\Model\UpdateCustomFieldMetaDataRequest
$update_mask = 'update_mask_example'; // string | An optional list of properties to be updated. If set, only the provided properties will be updated and others will be skipped.
try {
$result = $apiInstance->updateSubscriptionCustomField($custom_field_id, $update_custom_field_meta_data_request, $update_mask);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SubscriptionsApi->updateSubscriptionCustomField: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| custom_field_id | string | ||
| update_custom_field_meta_data_request | \Keap\Core\V2\Model\UpdateCustomFieldMetaDataRequest | ||
| update_mask | string | An optional list of properties to be updated. If set, only the provided properties will be updated and others will be skipped. | [optional] |
\Keap\Core\V2\Model\CustomFieldMetaData
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]