Skip to content

Latest commit

 

History

History
1221 lines (838 loc) · 44.5 KB

File metadata and controls

1221 lines (838 loc) · 44.5 KB

Keap\Core\V2\SubscriptionsApi

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
createSubscriptionCustomFieldGroup() POST /rest/v2/subscriptions/model/customFields/groups Create a Subscription Custom Field Group
createSubscriptionCustomFieldTab() POST /rest/v2/subscriptions/model/customFields/tabs Create a Subscription Custom Field Tab
deleteSubscriptionCustomField() DELETE /rest/v2/subscriptions/model/customFields/{custom_field_id} Delete a Subscription Custom Field
deleteSubscriptionCustomFieldGroup() DELETE /rest/v2/subscriptions/model/customFields/groups/{group_id} Delete a Subscription Custom Field Group
deleteSubscriptionCustomFieldTab() DELETE /rest/v2/subscriptions/model/customFields/tabs/{tab_id} Delete a Subscription Custom Field Tab
getSubscription() GET /rest/v2/subscriptions/{subscription_id} Retrieve a Subscription
getSubscriptionCustomFieldGroup() GET /rest/v2/subscriptions/model/customFields/groups/{group_id} Retrieve a Subscription Custom Field Group
getSubscriptionCustomFieldTab() GET /rest/v2/subscriptions/model/customFields/tabs/{tab_id} Retrieve a Subscription Custom Field Tab
invoiceSubscription() POST /rest/v2/subscriptions/{subscription_id}:invoice Invoice a Subscription
listSubscriptionCustomFieldGroups() GET /rest/v2/subscriptions/model/customFields/groups List Subscription Custom Field Groups
listSubscriptionCustomFieldTabs() GET /rest/v2/subscriptions/model/customFields/tabs List Subscription Custom Field Tabs
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
updateSubscriptionCustomFieldGroup() PATCH /rest/v2/subscriptions/model/customFields/groups/{group_id} Update a Subscription Custom Field Group
updateSubscriptionCustomFieldTab() PATCH /rest/v2/subscriptions/model/customFields/tabs/{tab_id} Update a Subscription Custom Field Tab

cancelSubscription()

cancelSubscription($subscription_id, $cancel_subscription_request)

Cancel Subscription

Cancels the specified subscription

Example

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

Parameters

Name Type Description Notes
subscription_id string
cancel_subscription_request \Keap\Core\V2\Model\CancelSubscriptionRequest

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createSubscription()

createSubscription($create_subscription_request): \Keap\Core\V2\Model\Subscription

Create Subscription

Creates a subscription with the specified product and product subscription id.

Example

<?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 = new \Keap\Core\V2\Model\CreateSubscriptionRequest(); // \Keap\Core\V2\Model\CreateSubscriptionRequest

try {
    $result = $apiInstance->createSubscription($create_subscription_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->createSubscription: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
create_subscription_request \Keap\Core\V2\Model\CreateSubscriptionRequest

Return type

\Keap\Core\V2\Model\Subscription

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createSubscriptionCustomField()

createSubscriptionCustomField($create_custom_field_request): \Keap\Core\V2\Model\CustomFieldMetaData

Create a Subscription Custom Field

Creates a custom field of the specified type and options to the Subscription object

Example

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

Parameters

Name Type Description Notes
create_custom_field_request \Keap\Core\V2\Model\CreateCustomFieldRequest

Return type

\Keap\Core\V2\Model\CustomFieldMetaData

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createSubscriptionCustomFieldGroup()

createSubscriptionCustomFieldGroup($create_custom_field_group_request): \Keap\Core\V2\Model\CustomFieldGroup

Create a Subscription Custom Field Group

Creates a new custom field group for the Subscription record type. If tab_id is omitted, the group is added to the default 'Custom Fields' tab.

Example

<?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_group_request = new \Keap\Core\V2\Model\CreateCustomFieldGroupRequest(); // \Keap\Core\V2\Model\CreateCustomFieldGroupRequest

try {
    $result = $apiInstance->createSubscriptionCustomFieldGroup($create_custom_field_group_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->createSubscriptionCustomFieldGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
create_custom_field_group_request \Keap\Core\V2\Model\CreateCustomFieldGroupRequest

Return type

\Keap\Core\V2\Model\CustomFieldGroup

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createSubscriptionCustomFieldTab()

createSubscriptionCustomFieldTab($create_custom_field_tab_request): \Keap\Core\V2\Model\CustomFieldTab

Create a Subscription Custom Field Tab

Creates a new custom field tab for the Subscription record type.

Example

<?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_tab_request = new \Keap\Core\V2\Model\CreateCustomFieldTabRequest(); // \Keap\Core\V2\Model\CreateCustomFieldTabRequest

try {
    $result = $apiInstance->createSubscriptionCustomFieldTab($create_custom_field_tab_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->createSubscriptionCustomFieldTab: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
create_custom_field_tab_request \Keap\Core\V2\Model\CreateCustomFieldTabRequest

Return type

\Keap\Core\V2\Model\CustomFieldTab

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteSubscriptionCustomField()

deleteSubscriptionCustomField($custom_field_id)

Delete a Subscription Custom Field

Deletes a custom field from the Subscription object

Example

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

Parameters

Name Type Description Notes
custom_field_id string

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteSubscriptionCustomFieldGroup()

deleteSubscriptionCustomFieldGroup($group_id)

Delete a Subscription Custom Field Group

Deletes a custom field group. Returns 409 Conflict if the group still contains custom fields.

Example

<?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
);
$group_id = 'group_id_example'; // string

try {
    $apiInstance->deleteSubscriptionCustomFieldGroup($group_id);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->deleteSubscriptionCustomFieldGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteSubscriptionCustomFieldTab()

deleteSubscriptionCustomFieldTab($tab_id)

Delete a Subscription Custom Field Tab

Deletes a custom field tab. Returns 409 Conflict if the tab still contains groups.

Example

<?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
);
$tab_id = 'tab_id_example'; // string

try {
    $apiInstance->deleteSubscriptionCustomFieldTab($tab_id);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->deleteSubscriptionCustomFieldTab: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
tab_id string

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSubscription()

getSubscription($subscription_id): \Keap\Core\V2\Model\Subscription

Retrieve a Subscription

Retrieves a single subscription

Example

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

Parameters

Name Type Description Notes
subscription_id string

Return type

\Keap\Core\V2\Model\Subscription

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSubscriptionCustomFieldGroup()

getSubscriptionCustomFieldGroup($group_id): \Keap\Core\V2\Model\CustomFieldGroup

Retrieve a Subscription Custom Field Group

Retrieves a single custom field group by id for the Subscription record type.

Example

<?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
);
$group_id = 'group_id_example'; // string

try {
    $result = $apiInstance->getSubscriptionCustomFieldGroup($group_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->getSubscriptionCustomFieldGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string

Return type

\Keap\Core\V2\Model\CustomFieldGroup

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSubscriptionCustomFieldTab()

getSubscriptionCustomFieldTab($tab_id): \Keap\Core\V2\Model\CustomFieldTab

Retrieve a Subscription Custom Field Tab

Retrieves a single custom field tab by id for the Subscription record type.

Example

<?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
);
$tab_id = 'tab_id_example'; // string

try {
    $result = $apiInstance->getSubscriptionCustomFieldTab($tab_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->getSubscriptionCustomFieldTab: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
tab_id string

Return type

\Keap\Core\V2\Model\CustomFieldTab

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

invoiceSubscription()

invoiceSubscription($subscription_id): \Keap\Core\V2\Model\OrderV2

Invoice a Subscription

Generates invoices from all cycles of a subscription that are due. Returns the most recently billed invoice.

Example

<?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->invoiceSubscription($subscription_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->invoiceSubscription: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
subscription_id string

Return type

\Keap\Core\V2\Model\OrderV2

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listSubscriptionCustomFieldGroups()

listSubscriptionCustomFieldGroups($tab_id): \Keap\Core\V2\Model\ListCustomFieldGroupsResponse

List Subscription Custom Field Groups

Retrieves a list of custom field groups for the Subscription record type. Optionally filter by tab_id to scope to a specific tab.

Example

<?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
);
$tab_id = 'tab_id_example'; // string | Optional tab id to scope groups to a single tab

try {
    $result = $apiInstance->listSubscriptionCustomFieldGroups($tab_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->listSubscriptionCustomFieldGroups: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
tab_id string Optional tab id to scope groups to a single tab [optional]

Return type

\Keap\Core\V2\Model\ListCustomFieldGroupsResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listSubscriptionCustomFieldTabs()

listSubscriptionCustomFieldTabs(): \Keap\Core\V2\Model\ListCustomFieldTabsResponse

List Subscription Custom Field Tabs

Retrieves a list of custom field tabs for the Subscription record type.

Example

<?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->listSubscriptionCustomFieldTabs();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->listSubscriptionCustomFieldTabs: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\Keap\Core\V2\Model\ListCustomFieldTabsResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listSubscriptions()

listSubscriptions($filter, $order_by, $page_size, $page_token): \Keap\Core\V2\Model\ListSubscriptionsResponse

List Subscriptions

Retrieves a list of subscriptions using the specified search criteria.

Example

<?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` - (String) `id` - Allowable operators: \"==\", \"<=\", \"<\", \">=\", \">\", \"!=\" - (String) `billing_amount` - Allowable operators: \"==\", \"<=\", \"<\", \">=\", \">\", \"!=\" - (List[String]) `ids` - (List[String]) `subscription_plan_ids`  Custom fields can be filtered by their field_name (case-insensitive, as returned by GET /v2/subscriptions/model). A standard field above takes precedence over a custom field with the same name. The supported operators depend on the custom field's type: - Text-like fields (text, text area, name, email, phone, website, social security   number) and single-value choice fields with text options (dropdown, radio,   state): `==` only, with optional trailing wildcard (e.g. `_SubscriptionNote0%3D%3DValue%2A`) - Yes/No and drilldown fields: `==` only - Numeric fields (whole number, decimal, currency, percent, year, month, day of   week, user): `==`, `>`, `<`, `>=`, `<=` - Date fields: `==`, `>`, `<`, `>=`, `<=` using full ISO 8601 - Multi-select fields: `==` matches records that contain the given option Custom field filtering on non-indexed fields is supported but may be slower.  You will need to apply the `==` operator (or other supported operators), to check the equality of one of the filters with your searched word, in the encoded form `%3D%3D`. For the filters listed above, here are some examples: - `filter=contact_id%3D%3D123` - `filter=subscription_plan_id%3D%3D456` - `filter=status%3D%3DActive` - `filter=id%3E5` - `filter=billing_amount%3E%3D100` - `filter=ids%3D%3D1,10,4,24` - `filter=subscription_plan_ids%3D%3D10,20,30` - `filter=contact_id%3D%3D123%3Bstatus%3D%3DActive`  Custom field examples (for custom fields with field_name `_SubscriptionNote0` and `_SubscriptionCount1`): - `filter=_SubscriptionNote0%3D%3DTest` (custom field exact match) - `filter=_SubscriptionNote0%3D%3DTest%2A` (custom field prefix wildcard) - `filter=_SubscriptionCount1%3E100` (custom field numeric comparison) - `filter=contact_id%3D%3D123%3B_SubscriptionNote0%3D%3DActive` (combined standard + custom field filter)  For fields which allow wildcard matching, you may use the * wildcard character (or its encoded form %2A) for case-insensitive partial matching on text fields. Example of a valid pattern of wildcard usage: - `field==foo*` finds anything in `field` that begins with `foo`
$order_by = 'order_by_example'; // string | Attribute and direction to order items. One of the following fields: - `id` - `contact_id` - `subscription_plan_id` - `modification_time`  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;
}

Parameters

Name Type Description Notes
filter string Filter to apply, allowed fields are: - (String) `contact_id` - (String) `subscription_plan_id` - (String) `status` - (String) `id` - Allowable operators: &quot;==&quot;, &quot;<=&quot;, &quot;<&quot;, &quot;>=&quot;, &quot;>&quot;, &quot;!=&quot; - (String) `billing_amount` - Allowable operators: &quot;==&quot;, &quot;<=&quot;, &quot;<&quot;, &quot;>=&quot;, &quot;>&quot;, &quot;!=&quot; - (List[String]) `ids` - (List[String]) `subscription_plan_ids` Custom fields can be filtered by their field_name (case-insensitive, as returned by GET /v2/subscriptions/model). A standard field above takes precedence over a custom field with the same name. The supported operators depend on the custom field's type: - Text-like fields (text, text area, name, email, phone, website, social security number) and single-value choice fields with text options (dropdown, radio, state): `==` only, with optional trailing wildcard (e.g. `_SubscriptionNote0%3D%3DValue%2A`) - Yes/No and drilldown fields: `==` only - Numeric fields (whole number, decimal, currency, percent, year, month, day of week, user): `==`, `>`, `<`, `>=`, `<=` - Date fields: `==`, `>`, `<`, `>=`, `<=` using full ISO 8601 - Multi-select fields: `==` matches records that contain the given option Custom field filtering on non-indexed fields is supported but may be slower. You will need to apply the `==` operator (or other supported operators), to check the equality of one of the filters with your searched word, in the encoded form `%3D%3D`. For the filters listed above, here are some examples: - `filter=contact_id%3D%3D123` - `filter=subscription_plan_id%3D%3D456` - `filter=status%3D%3DActive` - `filter=id%3E5` - `filter=billing_amount%3E%3D100` - `filter=ids%3D%3D1,10,4,24` - `filter=subscription_plan_ids%3D%3D10,20,30` - `filter=contact_id%3D%3D123%3Bstatus%3D%3DActive` Custom field examples (for custom fields with field_name `_SubscriptionNote0` and `_SubscriptionCount1`): - `filter=_SubscriptionNote0%3D%3DTest` (custom field exact match) - `filter=_SubscriptionNote0%3D%3DTest%2A` (custom field prefix wildcard) - `filter=_SubscriptionCount1%3E100` (custom field numeric comparison) - `filter=contact_id%3D%3D123%3B_SubscriptionNote0%3D%3DActive` (combined standard + custom field filter) For fields which allow wildcard matching, you may use the * wildcard character (or its encoded form %2A) for case-insensitive partial matching on text fields. Example of a valid pattern of wildcard usage: - `field==foo*` finds anything in `field` that begins with `foo` [optional]
order_by string Attribute and direction to order items. One of the following fields: - `id` - `contact_id` - `subscription_plan_id` - `modification_time` 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]

Return type

\Keap\Core\V2\Model\ListSubscriptionsResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieveSubscriptionCustomFieldModel()

retrieveSubscriptionCustomFieldModel(): \Keap\Core\V2\Model\ObjectModel

Retrieve Subscription Custom Field Model

Get the custom fields for the Subscription object

Example

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

Parameters

This endpoint does not need any parameter.

Return type

\Keap\Core\V2\Model\ObjectModel

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateSubscription()

updateSubscription($subscription_id, $update_subscription_request, $update_mask): \Keap\Core\V2\Model\Subscription

Update a Subscription

Updates a Subscription

Example

<?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 = new \Keap\Core\V2\Model\UpdateSubscriptionRequest(); // \Keap\Core\V2\Model\UpdateSubscriptionRequest
$update_mask = array('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, $update_mask);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->updateSubscription: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
subscription_id string
update_subscription_request \Keap\Core\V2\Model\UpdateSubscriptionRequest
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]

Return type

\Keap\Core\V2\Model\Subscription

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateSubscriptionCustomField()

updateSubscriptionCustomField($custom_field_id, $update_custom_field_meta_data_request, $update_mask): \Keap\Core\V2\Model\CustomFieldMetaData

Update a Subscription Custom Field

Updates a custom field of the specified type and options to the Subscription object

Example

<?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 = array('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;
}

Parameters

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]

Return type

\Keap\Core\V2\Model\CustomFieldMetaData

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateSubscriptionCustomFieldGroup()

updateSubscriptionCustomFieldGroup($group_id, $update_mask, $update_custom_field_group_request): \Keap\Core\V2\Model\CustomFieldGroup

Update a Subscription Custom Field Group

Updates an existing custom field group. Only fields listed in update_mask are applied.

Example

<?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
);
$group_id = 'group_id_example'; // string
$update_mask = array('update_mask_example'); // string[] | Comma-separated list of fields to update
$update_custom_field_group_request = new \Keap\Core\V2\Model\UpdateCustomFieldGroupRequest(); // \Keap\Core\V2\Model\UpdateCustomFieldGroupRequest

try {
    $result = $apiInstance->updateSubscriptionCustomFieldGroup($group_id, $update_mask, $update_custom_field_group_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->updateSubscriptionCustomFieldGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string
update_mask string[] Comma-separated list of fields to update
update_custom_field_group_request \Keap\Core\V2\Model\UpdateCustomFieldGroupRequest

Return type

\Keap\Core\V2\Model\CustomFieldGroup

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateSubscriptionCustomFieldTab()

updateSubscriptionCustomFieldTab($tab_id, $update_mask, $update_custom_field_tab_request): \Keap\Core\V2\Model\CustomFieldTab

Update a Subscription Custom Field Tab

Updates an existing custom field tab. Only fields listed in update_mask are applied.

Example

<?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
);
$tab_id = 'tab_id_example'; // string
$update_mask = array('update_mask_example'); // string[] | Comma-separated list of fields to update
$update_custom_field_tab_request = new \Keap\Core\V2\Model\UpdateCustomFieldTabRequest(); // \Keap\Core\V2\Model\UpdateCustomFieldTabRequest

try {
    $result = $apiInstance->updateSubscriptionCustomFieldTab($tab_id, $update_mask, $update_custom_field_tab_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->updateSubscriptionCustomFieldTab: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
tab_id string
update_mask string[] Comma-separated list of fields to update
update_custom_field_tab_request \Keap\Core\V2\Model\UpdateCustomFieldTabRequest

Return type

\Keap\Core\V2\Model\CustomFieldTab

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]