Show Hide submodels

Authentication

Authentication keys are used to authenticate all of your api calls via HTTP Basic Auth. Keys can be retrieved and configured from within your admin. Each key is configured for either sandbox or production mode and either private use within serverside applications, or public use with javascript. Be careful about sharing private keys as they have very powerful privileges.

Versioning

All backwards incompatible changes we make to the API are released in a new version. When using a library it is recommended that you use the default version since it will be the most compatible with the methods. If you are changing versions, it is advised that you test your application with the new version before converting your entire app.

When an error is fixed in the system the version remains the same, so you do not have to make a version change unless new features are added.

Locale

By changing the locale you can set the language (English/Spanish) for the messages returned by Conekta to the client with the "message" parameter.

Orders

An Order represents a purchase. It contains all the details related to it, including payment method, shipment, charges, discounts, taxes and the products.

Order Object

Attributes
id
string
Unique identifier assigned at random.
object
string
Object class. In this case, "order".
created_at
integer (32-bit unix timestamp)
Date when the order was created.
updated_at
integer (32-bit unix timestamp)
Date when the order was last updated.
currency
string
Currency of the charge. A 3-letter code of the International Standard ISO 4217.
line_items
array
List of the products (line items) being sold in the order. It must contain at least one product.
shipping_lines
array
List of shipping costs. If the online store offers digital products this parameter is optional.
tax_lines
array (opcional)
List of the taxes.
discount_lines
array (opcional)
List of the discounts applied to the order.
livemode
boolean
false: Sandbox Mode. true: Production Mode.
metadata
hash (opcional)
Hash containing additional information related to the order.
shipping_contact
hash
Shipping details, mandatory when a shipping_line is included in the order. If the order is sent without a shipping_contact, the customer's default shipping_contact will be used.
amount
integer
Amount calculated based on line_items, shipping_lines, tax_lines and discount_lines.
amount_refunded
integer
Amount refunded through a call to orders/:order_id/refund.
payment_status
string
Status of the order's payment. This field is set by the system, it can be pending_payment, declined, expired, paid, refunded, partially_refunded, charged_back, pre_authorized and voided.
customer_info
hash
Hash containing information about the order's customer.
customer_id
string
Id of the customer. This is required if the other customer_info fields are not sent.
name
string
Customer's name. (optional if customer_id is sent)
phone
string
Customer's phone. (optional if customer_id is sent)
email
string
Customer's email. (optional if customer_id is sent)
corporate
boolean
It states if the customer is corporate or not, the default value is false. (optional)

charges
array
List of the charges generated to cover the order amount.

Create Order

Creates a new Order.

Arguments
currency
string
Currency of the charge. A 3-letter code of the International Standard ISO 4217.
line_items
array
List of the products (line items) being sold in the order. It must contain at least one product.
shipping_lines
array
List of shipping costs. If the online store offers digital products this parameter is optional.
tax_lines
array (opcional)
List of the taxes.
discount_lines
array (opcional)
List of the discounts applied to the order.
pre_authorize
boolean (opcional)
States if the charges of the order should be preauthorized.
customer_info
hash
Hash containing information about the order's customer.
customer_id
string
Id of the customer. This is required if the other customer_info fields are not sent.
name
string
Customer's name. (optional if customer_id is sent)
phone
string
Customer's phone. (optional if customer_id is sent)
email
string
Customer's email. (optional if customer_id is sent)
corporate
boolean
It states if the customer is corporate or not, the default value is false. (optional)

shipping_contact
hash
Shipping details, mandatory when a shipping_line is included in the order. If the order is sent without a shipping_contact, the customer's default shipping_contact will be used.
charges
array
List of the charges generated to cover the order amount.

Update Order

Updates an existing Order.

Arguments
id
string
The order's id.
currency
string
Currency of the charge. A 3-letter code of the International Standard ISO 4217.
line_items
array
List of the products (line items) being sold in the order. It must contain at least one product.
shipping_lines
array
List of shipping costs. If the online store offers digital products this parameter is optional.
tax_lines
array (opcional)
List of the taxes.
discount_lines
array (opcional)
List of the discounts applied to the order.
pre_authorize
boolean (opcional)
States if the charges of the order should be preauthorized.
customer_info
hash
Hash containing information about the order's customer.
customer_id
string
Id of the customer. This is required if the other customer_info fields are not sent.
name
string
Customer's name. (optional if customer_id is sent)
phone
string
Customer's phone. (optional if customer_id is sent)
email
string
Customer's email. (optional if customer_id is sent)
corporate
boolean
It states if the customer is corporate or not, the default value is false. (optional)

shipping_contact
hash
Shipping details, mandatory when a shipping_line is included in the order. If the order is sent without a shipping_contact, the customer's default shipping_contact will be used.
charges
array
List of the charges generated to cover the order amount.

Capture Order

Process a pre-authorized order.

Arguments
id
string
The order's id.

Refund Order

A Refund details the amount and reason why an order was refunded.

Arguments
id
string
Order's id.
reason
string
Reason for refund.
amount
integer (opcional)
If you want to partially refund and order.

Reasons

  • requested_by_client
  • cannot_be_fulfilled
  • duplicated_transaction
  • suspected_fraud
  • other

Customers

Customers allow you to store payment methods for clients and set up subscriptions.

Customer Object

Attributes
id
string
Customer's unique identifier.
name
string
Customer's name.
phone
string
Customer's phone number (international format).
email
string
Customer's email.
plan_id
string
Plan secondary id.
payment_sources
hash
The Source object describes a payment method. Go to Payment Sources for further details.
corporate
Indicates whether a user is corporate or not.
shipping_contacts
array
A Shipping Contact describes the details for the shipment. Go to Shipping contacts for further details.
subscriptions
array
Subscriptions bill your client a fixed amount on a recurring basis. You can change the plan of a subscription, pause, cancel and resume a subscription as you wish. Go to Subscriptions for further details.

Create Customer

Creates a new Customer.

Arguments
name
string
Customer's name.
phone
string
Customer's phone number (international format) (optional).
email
string
Customer's email.
plan_id
string
Plan secondary id (optional).
payment_sources
hash
The Source object describes a payment method. Go to Payment Sources for further details (optional).
corporate
Indicates whether a user is corporate or not (optional).
shipping_contacts
array
A Shipping Contact describes the details for the shipment. Go to Shipping contacts for further details (optional).
subscriptions
array
Subscriptions bill your client a fixed amount on a recurring basis. You can change the plan of a subscription, pause, cancel and resume a subscription as you wish. Go to Subscriptions for further details (optional).

Update Customer

Updates an existing Customer.

Arguments
id
string
Id of the customer.
name
string
Customer's name.
phone
string
Customer's phone number (international format) (optional).
email
string
Customer's email.
plan_id
string
Plan secondary id (optional).
payment_sources
hash
The Source object describes a payment method. Go to Payment Sources for further details (optional).
corporate
Indicates whether a user is corporate or not (optional).
shipping_contacts
array
A Shipping Contact describes the details for the shipment. Go to Shipping contacts for further details (optional).
subscriptions
array
Subscriptions bill your client a fixed amount on a recurring basis. You can change the plan of a subscription, pause, cancel and resume a subscription as you wish. Go to Subscriptions for further details (optional).

Delete Customer

Deletes an existing customer

Arguments
id
string
Id of the customer.

Plans

Plans are templates for subscriptions. They allow you to define the amount and frequency with which you would like to bill your clients.

Plan Object

Attributes
id
string
Unique plan identifier.
object
string
Object class. For this object "plan".
livemode
boolean
false: test mode. true: production mode.
created_at
integer (32-bit unix timestamp)
Timestamp of plan's creation.
name
string
Plan's name.
amount
integer
Charge's amount in cents.
currency
string
Currency of the charge. A 3-letter code of the International Standard ISO 4217.
interval
string
The interval for the charge. For example, to charge a customer every 2 months, set the interval attribute to month and the frequency to 2.
frequency
integer
The frequency for the charge. For example, to charge a customer every 2 months, set the interval attribute to month and the frequency to 2.
trial_period_days
integer
Days of the trial's duration.
expiry_count
integer
Number of charges that will be made before the subscription expires.

Create Plan

Creates a new plan using tokenized data.

Arguments
id
string (optional)
Unique plan identifier you can assign to the plan.
name
string
Plan's name.
amount
integer
Charge's amount in cents.
currency
string
Currency of the charge. A 3-letter code of the International Standard ISO 4217.
interval
string (optional)
The interval for the charge. For example, to charge a customer every 2 months, set the interval attribute to month and the frequency to 2. If no argument is sent, the default value is month.
frequency
string (optional)
The frequency for the charge. For example, to charge a customer every 2 months, set the interval attribute to month and the frequency to 2. If no argument is sent, the default value is 1.
trial_period_days
integer
Days of the trial's duration.
expiry_count
integer
Number of charges that will be made before the subscription expires. For example, an annual subscription would have an expiry_count of 12.

Update Plan

Updates plan data.

Arguments
id
string
Unique plan identifier. Remember you can't change it.
name
string
Plan's name.
amount
integer
Charge's amount in cents.

Delete Plan

Deletes plan data.

Arguments
id
string
Unique plan identifier.

Subscriptions

Subscriptions bill your client a fixed amount on a recurring basis. You can change the plan of a subscription, pause, cancel and resume a subscription as you wish.

Subscription Object

Attributes
id
string
Unique identifier.
object
string
Object class. For this model, "subscription".
created_at
string
Date of the subscription creation.
canceled_at
string
Date of the subscription cancelation.
paused_at
string
Date of the subscription pause.
billing_cycle_start
integer (32-bit unix timestamp)
Date of the billing cycle start.
billing_cycle_end
integer (32-bit unix timestamp)
Date of the billing cycle end.
trial_start
integer (32-bit unix timestamp)
Date of the trial start.
trial_end
integer (32-bit unix timestamp)
Date of the trial end.
plan_id
string
Id of the plan assigned to the subscription.
status
string
Status of the subscription. Allowed values are: in_trial, active, past_due, paused, and canceled.

Create Subscription

Creates a new subscription using tokenized data.

Arguments
customer_id
string
Id of the customer that will own the subscription.
paln
string
Id of the plan that will be used to create the subscription
card
string (optional)
Id of the card that will be used to process the subscription in case it's different than the primary card. The card must already be registered in the customer's cards.

Update Subscription

Updates a subscription with a different card or plan.

Arguments
customer_id
string
Id of the customer that will own the subscription.
paln
string
Id of the plan that will be used to create the subscription
card
string (optional)
Id of the card that will be used to process the subscription in case it's different than the primary card. The card must already be registered in the customer's cards.

Pause Subscription

Pauses a subscription.

Arguments
id
string
Id of the subscription.

Resume Subscription

Resumes a subscription.

Arguments
id
string
Id of the subscription.

Cancel Subscription

Cancels a subscription.

Arguments
id
string
Id of the subscription.

Pagination

A List represents a collection of objects in a format that's easy to navigate through. This is how we handle pagination.

List Object

Attributes
next_page_url
Next page.
previous_page_url
Previous page.
has_more
True if more pages to retrieve.
data
Array with page results.

Next

Fetch the next page of listed objects.

Attributes
limit
Page size.
next
Last resource id on current page.

Previous

Fetch the previous page of listed objects.

Attributes
limit
Page size.
previous
First resource id on current page.

Payment Sources

The Payment Source object describes a payment method. This can be online (card payments) or offline OXXO and SPEI. Remember that for offline payments you will need to add a webhook listener.

Payment Source Object

Attributes
id
string
Unique identifier randomly assigned.
object
string
Object's class. In this case "payment_source".
type
string
Payment source's type. At the time the only type supported is "card".
created_at
integer (32-bit unix timestamp)
Date when the payment source was created.
last4
string
Last 4 digits of the card.
name
string
Name of the card holder.
exp_month
string
Expiration month of the card.
exp_year
string
Expiration year of the card.
brand
string
Card's brand.
parent_id
string
Id of the customer that owns the payment source.

Create Payment Source

Creates a new Payment Source

Arguments
type
string
Payment source's type. At the time the only type supported is "card".
token_id
string
Token id that will be used to create a payment source of the type "card". See the subscriptions tutorial to see more information on tokenization of cards.

Update Payment Source

Updates an existing Payment Source.

Arguments
id
string
Id of the Payemnt Source.
name
string
Name of the card holder.
exp_month
string
Expiration month of the card.
exp_year
string
Expiration year of the card.
address
hash
Address of the cardholder.

Delete Payment Source

Deletes an existing Payment Source.

Arguments
index
integer
Index of the Payment Source.

Charges

Charge Object

The Charge object contains all information related to the payment of an order. This object belongs to the order object.

Attributes
id
string
Unique identifier, assigned at random.
created_at
integer (32-bit unix timestamp)
Date of the charge's creation.
currency
string
Currency of the charge. A 3-letter code of the International Standard ISO 4217.
amount
integer
The charge's amount, in cents.
reference_id
string (optional)
String containing additional information related to the order.
monthly_installments
integer
Monthly installments in which the charge will be divided, with no interest added. Conekta offers monthly installments of 3, 6, 9 and 12 payments.
livemode
boolean
false: Sandbox Mode. true: Production Mode.
payment_method
hash
Payment method of the charge.
object
string
Object class. In this case, "charge".
status
string
Status of the charge.
fee
integer
Amount of the fee in cents.
order_id
string
Id of the order that the charge belongs to.

Create Charge

Creates a new charge for an existing order.

Arguments
amount
integer
The charge's amount, in cents.
payment_method
hash
The method in which the charge is to be paid. Go to Payment Sources for further details.
expires_at
integer (32-bit unix timestamp)
Time of payment method expiration.
token_id
string
Card's token id. Required for card type.

Line Items

This object represents the Line Items in the order.

This object belongs to the order object.

Line Item Object

Attributes
id
string
Unique identifier for the line item.
name
string
Line item's name.
description
string
Short description of the item (<250). (optional)
unit_price
integer
Line item's price in cents.
quantity
integer
Line item's quantity for the order.
sku
string
The Storage Keeping Unit designated by the company. (optional)
tags
array
Array containing the line item's categories. (optional)
brand
string
Line item's brand. (optional)
metadata
hash
Hash containing additional information related to the line item. (optional)

Create Line Item

Arguments
name
string
Line item's name.
description
string
Short description of the item (<250). (optional)
unit_price
integer
Line item's price in cents.
quantity
integer
Line item's quantity for the order.
sku
string
The Storage Keeping Unit designated by the company. (optional)
tags
array
Array containing the line item's categories. (optional)
brand
string
Line item's brand. (optional)
metadata
hash
Hash containing additional information related to the line item. (optional)

Update Line Item

Arguments
name
string
Line item's name.
description
string
Short description of the item (<250). (optional)
unit_price
integer
Line item's price in cents.
quantity
integer
Line item's quantity for the order.
sku
string
The Storage Keeping Unit designated by the company. (optional)
tags
array
Array containing the line item's categories. (optional)
brand
string
Line item's brand. (optional)
metadata
hash
Hash containing additional information related to the line item. (optional)

Delete Line Item

Arguments
id
string
Id of the line item.

Shipping Lines

A Shipping Line describes the shipment details for an order such as the method, the amount, the carrier and the tracking number.

Shipping Line Object

Attributes
id
string
Unique identifier, assigned at random.
amount
integer
The shipping cost, in cents.
tracking_number
string
Tracking number provided by the carrier. (optional)
carrier
string
Name of the carrier.
method
string
Shipping method. (optional)
metadata
hash
Hash containing additional information related to the shipping line. (optional)

Create Shipping Line

Creates a new Shipping Line for an existing order.

Arguments
amount
integer
The shipping cost, in cents.
tracking_number
string
Tracking number provided by the carrier. (optional)
carrier
string
Name of the carrier.
method
string
Shipping method. (optional)
metadata
hash
Hash containing additional information related to the shipping line. (optional)

Update Shipping Line

Updates an existing Shipping Line for an existing order.

Arguments
id
string
Id of the Shipping Line.
amount
integer
The shipping cost, in cents.
tracking_number
string
Tracking number provided by the carrier. (optional)
carrier
string
Name of the carrier.
method
string
Shipping method. (optional)
metadata
hash
Hash containing additional information related to the shipping line. (optional)

Delete Shipping Line

Deletes an existing Shipping Line for an existing order.

Arguments
id
string
Id of the Shipping Line.

Shipping Contacts

Describes the customer's information for the shipment.

Shipping Contact Object

Attributes
id
string
Unique identifier, assigned at random.
phone
string
Contact's phone number.
receiver
string
Contact's name. (optional)
between_streets
string
Adjacent streets to the shipping address. (optional)
address
string
Shipping address.
address.street1
The first line for the shipping address. Usually used for the street and the number.
address.street2
The second line for the shipping address. Usually used for the internal number, suite, residential complex or county.
address.city
The city for the shipping address.
address.state
The state for the shipping address.
address.country
Destination country, use the two-digit format ISO 3166-1.
address.postal_code
The postal code for the shipping address.
address.residential
Boolean value that indicates whether it is a residential shipping andress. By default is taken as true (Optional).

Create Shipping Contact (Customer)

Creates a new Shipping Contact for an existing customer.

Arguments
phone
string
Contact's phone number.
receiver
string
Contact's name. (optional)
between_streets
string
Adjacent streets to the shipping address. (optional)
address
hash
Shipping address.
address.street1
The first line for the shipping address. Usually used for the street and the number.
address.street2
The second line for the shipping address. Usually used for the internal number, suite, residential complex or county.
address.city
The city for the shipping address.
address.state
The state for the shipping address.
address.country
Destination country, use the two-digit format ISO 3166-1.
address.postal_code
The postal code for the shipping address.
address.residential
Boolean value that indicates whether it is a residential shipping andress. By default is taken as true (Optional).

Create Shipping Contact (Order)

Creates a new Shipping Contact for an existing order.

Arguments
phone
string
Contact's phone number.
receiver
string (optional)
Contact's name. (optional)
between_streets
string (optional)
Adjacent streets to the shipping address. (optional)
address
hash
Shipping address.
address.street1
The first line for the shipping address. Usually used for the street and the number.
address.street2
The second line for the shipping address. Usually used for the internal number, suite, residential complex or county.
address.city
The city for the shipping address.
address.state
The state for the shipping address.
address.country
Destination country, use the two-digit format ISO 3166-1.
address.postal_code
The postal code for the shipping address.
address.residential
Boolean value that indicates whether it is a residential shipping andress. By default is taken as true (Optional).

Update Shipping Contact

Updates an existing Shipping Contact

Arguments
id
string
Id of the Shipping Contact.
phone
string
Contact's phone number.
receiver
string
Contact's name. (optional)
between_streets
string
Adjacent streets to the shipping address. (optional)
address
hash
Shipping address.
address.street1
The first line for the shipping address. Usually used for the street and the number.
address.street2
The second line for the shipping address. Usually used for the internal number, suite, residential complex or county.
address.city
The city for the shipping address.
address.state
The state for the shipping address.
address.country
Destination country, use the two-digit format ISO 3166-1.
address.postal_code
The postal code for the shipping address.
address.residential
Boolean value that indicates whether it is a residential shipping andress. By default is taken as true (Optional).

Delete Shipping Contact

Deletes an existing Shipping Contact

Arguments
id
string
Id of the Shipping Contact.
address.street1
The first line for the shipping address. Usually used for the street and the number.
address.street2
The second line for the shipping address. Usually used for the internal number, suite, residential complex or county.
address.city
The city for the shipping address.
address.state
The state for the shipping address.
address.country
Destination country, use the two-digit format ISO 3166-1.
address.postal_code
The postal code for the shipping address.
address.residential
Boolean value that indicates whether it is a residential shipping andress. By default is taken as true (Optional).

Discount Lines

Describes the discounts to be applied to the order.

Discount Line Object

Attributes
id
string
Unique identifier, assigned at random.
code
string
Discount line's code.
type
string
It can be loyalty, campaign, coupon or sign.
amount
integer
The discount's amount, in cents.

Create Discount Line

Creates a new discount line.

Arguments
code
string
Discount line's code.
type
string
It can be loyalty, campaign, coupon or sign.
amount
integer
The discount's amount, in cents.

Update Discount Line

Updates an existing discount line.

Arguments
id
string
Discount line's id.
code
string
Discount line's code.
type
string
It can be loyalty, campaign, coupon or sign.
amount
integer
The discount's amount, in cents.

Delete Discount Line

Deletes an existing discount line.

Arguments
id
string
Discount Line's id.

Tax Lines

Describes the taxes of the order.

Tax Line Object

Attributes
id
string
Unique identifier for the tax.
description
string
Tax code.
amount
integer
The tax amount to be paid.
metadata
hash
Hash containing additional information related to the tax line. (optional)

Create Tax Line

Creates a new Tax Line.

Arguments
description
string
Tax code.
amount
integer
The tax amount to be paid in cents.
metadata
hash
Hash containing additional information related to the tax line. (optional)

Update Tax Line

Updates an existing tax line.

Arguments
id
string
Tax Line's id.
description
string
Tax code.
amount
integer
The tax amount to be paid in cents.
metadata
hash
Hash containing additional information related to the tax line. (optional)

Delete Tax Line

Deletes an existing tax line.

Arguments
id
string
Tax Line's id.

Events

Events are how we communicate anything that has happened in your account. To notify you we create an event object, which contains all the information you need to know about the event. An example of an event is when a payment is successfully created through charge.paid.

Through the API, you can make calls to obtain information about a specific event.

Or you can receive these events through WebHooks where we send events directly to your server. To know more about WebHooks, visit the section webhooks.

NOTE: If your server has any restrictions due to a Firewall you must add the IP of our server events 52.200.151.182. Also, you can select a specific port for your Webhooks. The ports we support are 80, 443 and any in the range of 1025 to 10001.

Event Object

Attributes
id
string
Unique Identifier assigned to the charge at random.
object
string
Object class. In this case, "event."
livemode
boolean
false: test mode. true: production mode.
created_at
integer (32-bit unix timestamp)
Creation date.
type
string
Type of event. Example: charge.paid, charge.refunded, etc.
data
hash
Hash that contains all the information associated with the event.
Event types
charge.created (Event related to a charge)
This event occurs when a charge has been created but has not yet been paid.
charge.paid (Event related to a charge)
This event occurs when a charge has been paid.
charge.refunded (Event related to a charge)
This event occurs when a charge has been refunded in full to a client.
charge.chargeback.created (Event related to a chargeback)
This event ocurrs when the cardholder doesn´t recognize the charge and contacts his bank to generate a chargeback. For more information about chargebacks, please visit the chargebacks section.
charge.chargeback.updated (Event related to a chargeback)
This event ocurrs when someone in your account updates the chargeback with evidence supporting the chargeback. For more information about chargebacks, please visit the chargebacks section.
charge.chargeback.under_review (Event related to a chargeback)
This event ocurrs when a chargeback has been blocked and the evidence you have provided has been sent to the acquiring bank to review the case. For more information about chargebacks, please visit the chargebacks section.
charge.chargeback.won (Event related to a chargeback)
This event ocurrs when the chargeback has been resolved in your favor. At this moment, the amount of the chargeback that had been retained will be returned to your balance and will be available with the next deposit into your account. For more information about chargebacks, please visit the chargebacks section.
charge.chargeback.lost (Event related to a chargeback)
This event ocurrs when the chargeback has been resolved in favor of the cardholder. The amount of the chargeback that was retained will be sent to the cardholder. For more information about chargebacks, please visit the chargebacks section.
subscription.created (Event related to a suscription)
This event ocurrs when a new subscription has been created.
subscription.paused (Event related to a suscription)
This event ocurrs when a subscription has been paused.
subscription.resumed (Event related to a suscription)
This event ocurrs when a paused subscription has been resumed.
subscription.canceled (Event related to a suscription)
This event ocurrs when a subscription has been canceled. In addition to you or the customer canceling the subscription, a subscription will be canceled after several attemps to perform a charge to the customer.
subscription.updated (Event related to a suscription)
This event ocurrs when a subscription has been updated either with a new plan or card.
subscription.paid (Event related to a suscription)
This event ocurrs when a subscription has been paid.
subscription.payment_failed (Event related to a suscription)
This event ocurrs when a subscription payment has failed. If the subscription cannot be processed after 3 consecutive attempts, the subscription will be canceled.

Errors

When creating any call to our service, using the API, you will be notified in the event of any errors and provided with all the respective error information.

Attributes
type
array
Contains the error type and error code.
log_id
string
The id of the http log of the request which was performed.
data
hash
The modified object in the event of an error, for example if you receive a processing_error when creating an order, the order will still be created.
details
array of hashes
Detailed list of the errors.
message
string
Human-readable message which provides more details about the error. This message is meant to be shown to purchasers and it is available in English and Spanish. For card charges, the message can be displayed to the user.
debug_message
string
Human-readable message which provides more details about the error. This message is meant to be used for internal debugging and it is only available in English. For card charges, the message can be displayed to the user.
params
string
The parameter to which the error is related. You can use this to highlight erroneous form fields.
code
string
A short, specific error code to elaborate on processing_error.
Error types
api_error
HTTP 500
An unexpected error thrown by Conekta. And this error is catchable via ApiError class.
authentication_error
HTTP 401
The api key provided in the request was invalid, or it did not have permissions to perform this request. And this error is catchable via AuthenticationError class.
conflict_error
HTTP 409
A version conflict occured, most likely an invalid version was provided in your request headers.
malformed_request_error
HTTP 400
The JSON body of your request was not a valid JSON object and could not be parsed or the request was improperly encoded. And this error is catchable via MalformedRequestError class
parameter_validation_error
HTTP 422
Some of the parameters in your request were missing or had invalid values, see the details section of your error for more information. And this error is catchable via ParameterValidationError class
precondition_required_error
HTTP 412
Some additional steps need to be performed before processing your request. If you are processing an order for example, the sum of the line_items must be greater than zero before it can be processed.
processing_error
HTTP 402
This is an expected error when processing credit cards, and will routinely occur when an operation cannot be performed (e.g. processing a credit card). And this error is catchable via ProcessingError class
resource_not_found_error
HTTP 404
The object on which you wished to perform this operation could not be found, this often occurs when your are using keys with incorrect permissions or for the wrong account. And this error is catchable via ResourceNotFoundError class
Methods
getConektaMessage()
object
Retrieve an object with the error stack. This object contains all attributes mentioned before, all objects are mapped to in to array positions, composed by two root arrays details with validation errors and type with error code response and error type response.
Classes
Handler
Exception
Handler class manage and auto instance mapped error classes by http response code

Github