Skip to content

Latest commit

 

History

History
349 lines (240 loc) · 13.1 KB

SubscriptionsApi.md

File metadata and controls

349 lines (240 loc) · 13.1 KB

conekta.api.SubscriptionsApi

Load the API package

import 'package:conekta/api.dart';

All URIs are relative to https://api.conekta.io

Method HTTP request Description
cancelSubscription POST /customers/{id}/subscription/cancel Cancel Subscription
createSubscription POST /customers/{id}/subscription Create Subscription
getAllEventsFromSubscription GET /customers/{id}/subscription/events Get Events By Subscription
getSubscription GET /customers/{id}/subscription Get Subscription
pauseSubscription POST /customers/{id}/subscription/pause Pause Subscription
resumeSubscription POST /customers/{id}/subscription/resume Resume Subscription
updateSubscription PUT /customers/{id}/subscription Update Subscription

cancelSubscription

SubscriptionResponse cancelSubscription(id, acceptLanguage, xChildCompanyId)

Cancel Subscription

You can cancel the subscription to stop the plans that your customers consume

Example

import 'package:conekta/api.dart';

final api = Conekta().getSubscriptionsApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.cancelSubscription(id, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling SubscriptionsApi->cancelSubscription: $e\n');
}

Parameters

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

Return type

SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

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

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

createSubscription

SubscriptionResponse createSubscription(id, subscriptionRequest, acceptLanguage, xChildCompanyId)

Create Subscription

You can create the subscription to include the plans that your customers consume

Example

import 'package:conekta/api.dart';

final api = Conekta().getSubscriptionsApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final SubscriptionRequest subscriptionRequest = ; // SubscriptionRequest | requested field for subscriptions
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.createSubscription(id, subscriptionRequest, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling SubscriptionsApi->createSubscription: $e\n');
}

Parameters

Name Type Description Notes
id String Identifier of the resource
subscriptionRequest SubscriptionRequest requested field for subscriptions
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId String In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

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

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

getAllEventsFromSubscription

SubscriptionEventsResponse getAllEventsFromSubscription(id, acceptLanguage, xChildCompanyId)

Get Events By Subscription

You can get the events of the subscription(s) of a client, with the customer id

Example

import 'package:conekta/api.dart';

final api = Conekta().getSubscriptionsApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.getAllEventsFromSubscription(id, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling SubscriptionsApi->getAllEventsFromSubscription: $e\n');
}

Parameters

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

Return type

SubscriptionEventsResponse

Authorization

bearerAuth

HTTP request headers

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

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

getSubscription

SubscriptionResponse getSubscription(id, acceptLanguage)

Get Subscription

Example

import 'package:conekta/api.dart';

final api = Conekta().getSubscriptionsApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use

try {
    final response = api.getSubscription(id, acceptLanguage);
    print(response);
} catch on DioException (e) {
    print('Exception when calling SubscriptionsApi->getSubscription: $e\n');
}

Parameters

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

Return type

SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

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

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

pauseSubscription

SubscriptionResponse pauseSubscription(id, acceptLanguage, xChildCompanyId)

Pause Subscription

You can pause the subscription to stop the plans that your customers consume

Example

import 'package:conekta/api.dart';

final api = Conekta().getSubscriptionsApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.pauseSubscription(id, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling SubscriptionsApi->pauseSubscription: $e\n');
}

Parameters

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

Return type

SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

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

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

resumeSubscription

SubscriptionResponse resumeSubscription(id, acceptLanguage, xChildCompanyId)

Resume Subscription

You can resume the subscription to start the plans that your customers consume

Example

import 'package:conekta/api.dart';

final api = Conekta().getSubscriptionsApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.resumeSubscription(id, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling SubscriptionsApi->resumeSubscription: $e\n');
}

Parameters

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

Return type

SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

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

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

updateSubscription

SubscriptionResponse updateSubscription(id, subscriptionUpdateRequest, acceptLanguage, xChildCompanyId)

Update Subscription

You can modify the subscription to change the plans that your customers consume

Example

import 'package:conekta/api.dart';

final api = Conekta().getSubscriptionsApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final SubscriptionUpdateRequest subscriptionUpdateRequest = ; // SubscriptionUpdateRequest | requested field for update a subscription
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.updateSubscription(id, subscriptionUpdateRequest, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling SubscriptionsApi->updateSubscription: $e\n');
}

Parameters

Name Type Description Notes
id String Identifier of the resource
subscriptionUpdateRequest SubscriptionUpdateRequest requested field for update a subscription
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId String In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

SubscriptionResponse

Authorization

bearerAuth

HTTP request headers

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

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