Skip to content

Latest commit

 

History

History
1083 lines (760 loc) · 40.1 KB

File metadata and controls

1083 lines (760 loc) · 40.1 KB

Conekta\SubscriptionsApi

All URIs are relative to https://api.conekta.io, except if the operation defines another base path.

Method HTTP request Description
cancelSubscription() POST /customers/{id}/subscription/cancel Cancel Subscription [Deprecated]
createSubscription() POST /customers/{id}/subscription Create Subscription [Deprecated]
getSubscription() GET /customers/{id}/subscription Get Subscription [Deprecated]
getSubscriptionEvents() GET /customers/{id}/subscription/events Get Subscription Events [Deprecated]
pauseSubscription() POST /customers/{id}/subscription/pause Pause Subscription [Deprecated]
resumeSubscription() POST /customers/{id}/subscription/resume Resume Subscription [Deprecated]
subscriptionCancel() POST /customers/{customer_id}/subscriptions/{id}/cancel Cancel Subscription
subscriptionCreate() POST /customers/{customer_id}/subscriptions Create Subscription
subscriptionEvents() GET /customers/{customer_id}/subscriptions/{id}/events Get Subscription Events
subscriptionList() GET /customers/{customer_id}/subscriptions List Subscriptions
subscriptionPause() POST /customers/{customer_id}/subscriptions/{id}/pause Pause Subscription
subscriptionResume() POST /customers/{customer_id}/subscriptions/{id}/resume Resume Subscription
subscriptionUpdate() PUT /customers/{customer_id}/subscriptions/{id} Update Subscription
subscriptionsGet() GET /customers/{customer_id}/subscriptions/{id} Get Subscription
subscriptionsRetry() POST /customers/{customer_id}/subscriptions/{id}/retry Retry Failed Payment
updateSubscription() PUT /customers/{id}/subscription Update Subscription [Deprecated]

cancelSubscription()

cancelSubscription($id, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Cancel Subscription [Deprecated]

DEPRECATED: This endpoint will be removed in version 2.3.0.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

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

Parameters

Name Type Description Notes
id string Identifier of the resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

createSubscription()

createSubscription($id, $subscription_request, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Create Subscription [Deprecated]

DEPRECATED: This endpoint will be removed in version 2.3.0. You can create the subscription to include the plans that your customers consume

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$subscription_request = new \Conekta\Model\SubscriptionRequest(); // \Conekta\Model\SubscriptionRequest | requested field for subscriptions
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

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

Parameters

Name Type Description Notes
id string Identifier of the resource
subscription_request \Conekta\Model\SubscriptionRequest requested field for subscriptions
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.2.0+json

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

getSubscription()

getSubscription($id, $accept_language): \Conekta\Model\SubscriptionResponse

Get Subscription [Deprecated]

DEPRECATED: This endpoint will be removed in version 2.3.0.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$accept_language = es; // string | Use for knowing which language to use

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

Parameters

Name Type Description Notes
id string Identifier of the resource
accept_language string Use for knowing which language to use [optional] [default to 'es']

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

getSubscriptionEvents()

getSubscriptionEvents($id, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionEventsResponse

Get Subscription Events [Deprecated]

DEPRECATED: This endpoint will be removed in version 2.3.0. You can get the events of the subscription(s) of a client, with the customer id

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

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

Parameters

Name Type Description Notes
id string Identifier of the resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionEventsResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

pauseSubscription()

pauseSubscription($id, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Pause Subscription [Deprecated]

DEPRECATED: This endpoint will be removed in version 2.3.0.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

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

Parameters

Name Type Description Notes
id string Identifier of the resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

resumeSubscription()

resumeSubscription($id, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Resume Subscription [Deprecated]

DEPRECATED: This endpoint will be removed in version 2.3.0.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

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

Parameters

Name Type Description Notes
id string Identifier of the resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

subscriptionCancel()

subscriptionCancel($customer_id, $id, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Cancel Subscription

Cancel a specific subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$customer_id = cus_2tGzG1GxtDAZHEGPH; // string | Identifier of the customer resource
$id = sub_2tGzG1GxtDAZHEGPH; // string | Identifier of the subscription resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->subscriptionCancel($customer_id, $id, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->subscriptionCancel: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
customer_id string Identifier of the customer resource
id string Identifier of the subscription resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

subscriptionCreate()

subscriptionCreate($customer_id, $subscription_request, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Create Subscription

Create a new subscription for a customer (keeps existing subscriptions active)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$customer_id = cus_2tGzG1GxtDAZHEGPH; // string | Identifier of the customer resource
$subscription_request = new \Conekta\Model\SubscriptionRequest(); // \Conekta\Model\SubscriptionRequest | requested field for subscriptions
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->subscriptionCreate($customer_id, $subscription_request, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->subscriptionCreate: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
customer_id string Identifier of the customer resource
subscription_request \Conekta\Model\SubscriptionRequest requested field for subscriptions
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.2.0+json

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

subscriptionEvents()

subscriptionEvents($customer_id, $id, $accept_language, $x_child_company_id, $limit, $search, $next, $previous): \Conekta\Model\SubscriptionEventsResponse

Get Subscription Events

Get events for a specific subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$customer_id = cus_2tGzG1GxtDAZHEGPH; // string | Identifier of the customer resource
$id = sub_2tGzG1GxtDAZHEGPH; // string | Identifier of the subscription resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.
$limit = 20; // int | The numbers of items to return, the maximum value is 250
$search = 'search_example'; // string | General order search, e.g. by mail, reference etc.
$next = 'next_example'; // string | next page
$previous = 'previous_example'; // string | previous page

try {
    $result = $apiInstance->subscriptionEvents($customer_id, $id, $accept_language, $x_child_company_id, $limit, $search, $next, $previous);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->subscriptionEvents: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
customer_id string Identifier of the customer resource
id string Identifier of the subscription resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]
limit int The numbers of items to return, the maximum value is 250 [optional] [default to 20]
search string General order search, e.g. by mail, reference etc. [optional]
next string next page [optional]
previous string previous page [optional]

Return type

\Conekta\Model\SubscriptionEventsResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

subscriptionList()

subscriptionList($customer_id, $accept_language, $x_child_company_id, $limit, $search, $next, $previous): \Conekta\Model\SubscriptionResponse

List Subscriptions

Get a list of subscriptions for a customer

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$customer_id = cus_2tGzG1GxtDAZHEGPH; // string | Identifier of the customer resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.
$limit = 20; // int | The numbers of items to return, the maximum value is 250
$search = 'search_example'; // string | General order search, e.g. by mail, reference etc.
$next = 'next_example'; // string | next page
$previous = 'previous_example'; // string | previous page

try {
    $result = $apiInstance->subscriptionList($customer_id, $accept_language, $x_child_company_id, $limit, $search, $next, $previous);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->subscriptionList: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
customer_id string Identifier of the customer resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]
limit int The numbers of items to return, the maximum value is 250 [optional] [default to 20]
search string General order search, e.g. by mail, reference etc. [optional]
next string next page [optional]
previous string previous page [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

subscriptionPause()

subscriptionPause($customer_id, $id, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Pause Subscription

Pause a specific subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$customer_id = cus_2tGzG1GxtDAZHEGPH; // string | Identifier of the customer resource
$id = sub_2tGzG1GxtDAZHEGPH; // string | Identifier of the subscription resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->subscriptionPause($customer_id, $id, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->subscriptionPause: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
customer_id string Identifier of the customer resource
id string Identifier of the subscription resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

subscriptionResume()

subscriptionResume($customer_id, $id, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Resume Subscription

Resume a specific paused subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$customer_id = cus_2tGzG1GxtDAZHEGPH; // string | Identifier of the customer resource
$id = sub_2tGzG1GxtDAZHEGPH; // string | Identifier of the subscription resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->subscriptionResume($customer_id, $id, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->subscriptionResume: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
customer_id string Identifier of the customer resource
id string Identifier of the subscription resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

subscriptionUpdate()

subscriptionUpdate($customer_id, $id, $subscription_update_request, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Update Subscription

Update a specific subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$customer_id = cus_2tGzG1GxtDAZHEGPH; // string | Identifier of the customer resource
$id = sub_2tGzG1GxtDAZHEGPH; // string | Identifier of the subscription resource
$subscription_update_request = new \Conekta\Model\SubscriptionUpdateRequest(); // \Conekta\Model\SubscriptionUpdateRequest | requested field for update a subscription
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->subscriptionUpdate($customer_id, $id, $subscription_update_request, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->subscriptionUpdate: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
customer_id string Identifier of the customer resource
id string Identifier of the subscription resource
subscription_update_request \Conekta\Model\SubscriptionUpdateRequest requested field for update a subscription
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.2.0+json

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

subscriptionsGet()

subscriptionsGet($customer_id, $id, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Get Subscription

Retrieve a specific subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$customer_id = cus_2tGzG1GxtDAZHEGPH; // string | Identifier of the customer resource
$id = sub_2tGzG1GxtDAZHEGPH; // string | Identifier of the subscription resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->subscriptionsGet($customer_id, $id, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->subscriptionsGet: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
customer_id string Identifier of the customer resource
id string Identifier of the subscription resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

subscriptionsRetry()

subscriptionsRetry($customer_id, $id, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Retry Failed Payment

Retry a failed payment for a specific subscription

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$customer_id = cus_2tGzG1GxtDAZHEGPH; // string | Identifier of the customer resource
$id = sub_2tGzG1GxtDAZHEGPH; // string | Identifier of the subscription resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->subscriptionsRetry($customer_id, $id, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->subscriptionsRetry: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
customer_id string Identifier of the customer resource
id string Identifier of the subscription resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.2.0+json

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

updateSubscription()

updateSubscription($id, $subscription_update_request, $accept_language, $x_child_company_id): \Conekta\Model\SubscriptionResponse

Update Subscription [Deprecated]

DEPRECATED: This endpoint will be removed in version 2.3.0. You can modify the subscription to change the plans that your customers consume

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$subscription_update_request = new \Conekta\Model\SubscriptionUpdateRequest(); // \Conekta\Model\SubscriptionUpdateRequest | requested field for update a subscription
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->updateSubscription($id, $subscription_update_request, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubscriptionsApi->updateSubscription: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Identifier of the resource
subscription_update_request \Conekta\Model\SubscriptionUpdateRequest requested field for update a subscription
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.2.0+json

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