Step 1

Initialize your Conekta client by adding your private key and API version

If you don't already have your private key, you can get it here.

Step 2

Create a customer

When you create a customer with the information of your client and with the previously provided ConektaJS token, you will be able to retry the charge and make recurrent charges, as long as you have your customer's consent.

A customer can have many payment_sources but only one can be the default. The subscription will be charged to your default card.

While a customer may have more than one payment_source, only one will be used as the default if your customer does not otherwise specify the card that they are paying with.

The example shows the minimum set of attributes required, if you want to know more about the customer object, review our REST API.

Step 3

Create a billing plan

When you create a plan you will be able to create the relation with the customer.

The fields shown in the example are the minimum set of attributes required. If you want to improve the speed of your transaction you will need to know more about the order object, to do this review our REST API.

Step 4

Start a subscription

The fields shown in the example are the minimum set of attributes required. If you want to improve the speed of your transaction you will need to know more about the order object, to do this review our REST API.

Step 5

Process payment webhooks

You will receive payment notifations in a JSON format via an HTTP POST call to your servers. To receive these notifications you will first need to configure a Webhook in your Conekta Admin.

Use public URLs: If you do not have a public IP or domain, you can use services like ultrahook or localtunnel.

Webhooks reference.

Step 6

Notify your client

Step 7

Test your webhook

You can check the status of your webhooks and resend notifications from the Conekta admin.

What will you need? The webhook URL and access to Conekta Admin.

That's it! Please remember to exchange your sandbox keys for the production keys.

Pausing, resuming, canceling and updating subscriptions

Congratulations, you have set up a subscription payment workflow! To manage the life cycle of your clients don't forget to check out ways to change their billing plan, pause and cancel subscriptions.

Pause

Any active suscription can be paused for an indefinite amount of time.

Resume

Any paused suscription can be resumed at any time to complete the plan's indicated number of charges.

Cancel

You can cancel a plan at anytime if you wish to terminate a suscription before it has completed the indicated number of charges.

Update

To switch a customer from one plan to another you can simply update the plan id of the suscription. Remember that if you update a suscription from Plan A to Plan B it will wait for the billing cycle of Plan A to finish before making a charge for Plan B.