All URIs are relative to https://api.conekta.io
Method | HTTP request | Description |
---|---|---|
cancel_subscription | POST /customers/{id}/subscription/cancel | Cancel Subscription |
create_subscription | POST /customers/{id}/subscription | Create Subscription |
get_all_events_from_subscription | GET /customers/{id}/subscription/events | Get Events By Subscription |
get_subscription | GET /customers/{id}/subscription | Get Subscription |
pause_subscription | POST /customers/{id}/subscription/pause | Pause Subscription |
resume_subscription | POST /customers/{id}/subscription/resume | Resume Subscription |
update_subscription | PUT /customers/{id}/subscription | Update Subscription |
SubscriptionResponse cancel_subscription(id, accept_language=accept_language, x_child_company_id=x_child_company_id)
Cancel Subscription
You can cancel the subscription to stop the plans that your customers consume
- Bearer Authentication (bearerAuth):
import conekta
from conekta.models.subscription_response import SubscriptionResponse
from conekta.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.conekta.io
# See configuration.py for a list of all supported configuration parameters.
configuration = conekta.Configuration(
host = "https://api.conekta.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = conekta.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with conekta.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = conekta.SubscriptionsApi(api_client)
id = '6307a60c41de27127515a575' # str | Identifier of the resource
accept_language = es # str | Use for knowing which language to use (optional) (default to es)
x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional)
try:
# Cancel Subscription
api_response = api_instance.cancel_subscription(id, accept_language=accept_language, x_child_company_id=x_child_company_id)
print("The response of SubscriptionsApi->cancel_subscription:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->cancel_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the resource | |
accept_language | str | Use for knowing which language to use | [optional] [default to es] |
x_child_company_id | str | In the case of a holding company, the company id of the child company to which will process the request. | [optional] |
- Content-Type: Not defined
- Accept: application/vnd.conekta-v2.1.0+json
Status code | Description | Response headers |
---|---|---|
200 | successful | * Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type - |
401 | authentication error | - |
404 | not found entity | - |
500 | internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubscriptionResponse create_subscription(id, subscription_request, accept_language=accept_language, x_child_company_id=x_child_company_id)
Create Subscription
You can create the subscription to include the plans that your customers consume
- Bearer Authentication (bearerAuth):
import conekta
from conekta.models.subscription_request import SubscriptionRequest
from conekta.models.subscription_response import SubscriptionResponse
from conekta.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.conekta.io
# See configuration.py for a list of all supported configuration parameters.
configuration = conekta.Configuration(
host = "https://api.conekta.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = conekta.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with conekta.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = conekta.SubscriptionsApi(api_client)
id = '6307a60c41de27127515a575' # str | Identifier of the resource
subscription_request = conekta.SubscriptionRequest() # SubscriptionRequest | requested field for subscriptions
accept_language = es # str | Use for knowing which language to use (optional) (default to es)
x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional)
try:
# Create Subscription
api_response = api_instance.create_subscription(id, subscription_request, accept_language=accept_language, x_child_company_id=x_child_company_id)
print("The response of SubscriptionsApi->create_subscription:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->create_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the resource | |
subscription_request | SubscriptionRequest | requested field for subscriptions | |
accept_language | str | Use for knowing which language to use | [optional] [default to es] |
x_child_company_id | str | In the case of a holding company, the company id of the child company to which will process the request. | [optional] |
- Content-Type: application/json
- Accept: application/vnd.conekta-v2.1.0+json
Status code | Description | Response headers |
---|---|---|
200 | successful | * Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type - |
422 | parameter validation error | - |
401 | authentication error | - |
404 | not found entity | - |
500 | internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubscriptionEventsResponse get_all_events_from_subscription(id, accept_language=accept_language, x_child_company_id=x_child_company_id)
Get Events By Subscription
You can get the events of the subscription(s) of a client, with the customer id
- Bearer Authentication (bearerAuth):
import conekta
from conekta.models.subscription_events_response import SubscriptionEventsResponse
from conekta.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.conekta.io
# See configuration.py for a list of all supported configuration parameters.
configuration = conekta.Configuration(
host = "https://api.conekta.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = conekta.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with conekta.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = conekta.SubscriptionsApi(api_client)
id = '6307a60c41de27127515a575' # str | Identifier of the resource
accept_language = es # str | Use for knowing which language to use (optional) (default to es)
x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional)
try:
# Get Events By Subscription
api_response = api_instance.get_all_events_from_subscription(id, accept_language=accept_language, x_child_company_id=x_child_company_id)
print("The response of SubscriptionsApi->get_all_events_from_subscription:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->get_all_events_from_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the resource | |
accept_language | str | Use for knowing which language to use | [optional] [default to es] |
x_child_company_id | str | In the case of a holding company, the company id of the child company to which will process the request. | [optional] |
- Content-Type: Not defined
- Accept: application/vnd.conekta-v2.1.0+json
Status code | Description | Response headers |
---|---|---|
200 | successful | * Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type - |
401 | authentication error | - |
402 | payment required error | - |
404 | not found entity | - |
422 | parameter validation error | - |
500 | internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubscriptionResponse get_subscription(id, accept_language=accept_language)
Get Subscription
- Bearer Authentication (bearerAuth):
import conekta
from conekta.models.subscription_response import SubscriptionResponse
from conekta.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.conekta.io
# See configuration.py for a list of all supported configuration parameters.
configuration = conekta.Configuration(
host = "https://api.conekta.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = conekta.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with conekta.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = conekta.SubscriptionsApi(api_client)
id = '6307a60c41de27127515a575' # str | Identifier of the resource
accept_language = es # str | Use for knowing which language to use (optional) (default to es)
try:
# Get Subscription
api_response = api_instance.get_subscription(id, accept_language=accept_language)
print("The response of SubscriptionsApi->get_subscription:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->get_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the resource | |
accept_language | str | Use for knowing which language to use | [optional] [default to es] |
- Content-Type: Not defined
- Accept: application/vnd.conekta-v2.1.0+json
Status code | Description | Response headers |
---|---|---|
200 | successful | * Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type - |
401 | authentication error | - |
404 | not found entity | - |
500 | internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubscriptionResponse pause_subscription(id, accept_language=accept_language, x_child_company_id=x_child_company_id)
Pause Subscription
You can pause the subscription to stop the plans that your customers consume
- Bearer Authentication (bearerAuth):
import conekta
from conekta.models.subscription_response import SubscriptionResponse
from conekta.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.conekta.io
# See configuration.py for a list of all supported configuration parameters.
configuration = conekta.Configuration(
host = "https://api.conekta.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = conekta.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with conekta.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = conekta.SubscriptionsApi(api_client)
id = '6307a60c41de27127515a575' # str | Identifier of the resource
accept_language = es # str | Use for knowing which language to use (optional) (default to es)
x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional)
try:
# Pause Subscription
api_response = api_instance.pause_subscription(id, accept_language=accept_language, x_child_company_id=x_child_company_id)
print("The response of SubscriptionsApi->pause_subscription:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->pause_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the resource | |
accept_language | str | Use for knowing which language to use | [optional] [default to es] |
x_child_company_id | str | In the case of a holding company, the company id of the child company to which will process the request. | [optional] |
- Content-Type: Not defined
- Accept: application/vnd.conekta-v2.1.0+json
Status code | Description | Response headers |
---|---|---|
200 | successful | * Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type - |
401 | authentication error | - |
402 | payment required error | - |
404 | not found entity | - |
500 | internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubscriptionResponse resume_subscription(id, accept_language=accept_language, x_child_company_id=x_child_company_id)
Resume Subscription
You can resume the subscription to start the plans that your customers consume
- Bearer Authentication (bearerAuth):
import conekta
from conekta.models.subscription_response import SubscriptionResponse
from conekta.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.conekta.io
# See configuration.py for a list of all supported configuration parameters.
configuration = conekta.Configuration(
host = "https://api.conekta.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = conekta.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with conekta.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = conekta.SubscriptionsApi(api_client)
id = '6307a60c41de27127515a575' # str | Identifier of the resource
accept_language = es # str | Use for knowing which language to use (optional) (default to es)
x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional)
try:
# Resume Subscription
api_response = api_instance.resume_subscription(id, accept_language=accept_language, x_child_company_id=x_child_company_id)
print("The response of SubscriptionsApi->resume_subscription:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->resume_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the resource | |
accept_language | str | Use for knowing which language to use | [optional] [default to es] |
x_child_company_id | str | In the case of a holding company, the company id of the child company to which will process the request. | [optional] |
- Content-Type: Not defined
- Accept: application/vnd.conekta-v2.1.0+json
Status code | Description | Response headers |
---|---|---|
200 | successful | * Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type - |
401 | authentication error | - |
402 | payment required error | - |
404 | not found entity | - |
422 | parameter validation error | - |
500 | internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubscriptionResponse update_subscription(id, subscription_update_request, accept_language=accept_language, x_child_company_id=x_child_company_id)
Update Subscription
You can modify the subscription to change the plans that your customers consume
- Bearer Authentication (bearerAuth):
import conekta
from conekta.models.subscription_response import SubscriptionResponse
from conekta.models.subscription_update_request import SubscriptionUpdateRequest
from conekta.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.conekta.io
# See configuration.py for a list of all supported configuration parameters.
configuration = conekta.Configuration(
host = "https://api.conekta.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = conekta.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with conekta.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = conekta.SubscriptionsApi(api_client)
id = '6307a60c41de27127515a575' # str | Identifier of the resource
subscription_update_request = conekta.SubscriptionUpdateRequest() # SubscriptionUpdateRequest | requested field for update a subscription
accept_language = es # str | Use for knowing which language to use (optional) (default to es)
x_child_company_id = '6441b6376b60c3a638da80af' # str | In the case of a holding company, the company id of the child company to which will process the request. (optional)
try:
# Update Subscription
api_response = api_instance.update_subscription(id, subscription_update_request, accept_language=accept_language, x_child_company_id=x_child_company_id)
print("The response of SubscriptionsApi->update_subscription:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SubscriptionsApi->update_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the resource | |
subscription_update_request | SubscriptionUpdateRequest | requested field for update a subscription | |
accept_language | str | Use for knowing which language to use | [optional] [default to es] |
x_child_company_id | str | In the case of a holding company, the company id of the child company to which will process the request. | [optional] |
- Content-Type: application/json
- Accept: application/vnd.conekta-v2.1.0+json
Status code | Description | Response headers |
---|---|---|
200 | successful | * Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type - |
422 | parameter validation error | - |
401 | authentication error | - |
404 | not found entity | - |
500 | internal server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]