Payment Methods
Important changes on the Public API
When creating transactions and payment sources, and because we keep our users privacy in the top of our priorities, the usage of Acceptance Tokens is now mandatory when creating either of these resources through our API.
Every time you create a transaction using our API, you have the option of processing the payment using different payment methods. Currently, the available payment methods are:
- Credit or Debit Cards: Allows your customers to pay using credit or debit cards.
- Bancolombia Transfer Button: Allows your customers to pay using their savings or checking account from Bancolombia.
- Nequi: Allows your customers to pay with Nequi using their cellphone to complete the payment.
- PSE: Allows your customers to pay with PSE using the savings or checking account from any Colombian bank.
- Cash Payment in Corresponsal Bancario Bancolombia: Allows your customers to pay with cash in any of the more than 15,000 physical points of payment from Bancolombia called Corresponsales Bancarios Bancolombia.
- PCOL: Allow your customer to pay redeeming points from Puntos Colombia loyalty program.
- BNPL BANCOLOMBIA: Enabling your clients to choose a BANCOLOMBIA free investment credit option, with zero interest, split into 4 monthly installments for transactions exceeding $100,000 pesos.
- DAVIPLATA: Provide your customers with the option to use their Daviplata account to make payments conveniently.
- SU+ PAY - COMMING SOON: It allows users to purchase products or services and pay for them in installments, facilitating financial management and access to a wide range of products.
To use a payment method you must POST in the /transactions endpoint with:
- Specify the field
payment_method_typeand specify one of these 3 values:CARD,NEQUIorPSE. - Specify the field
payment_methodwith a JSON object that contains more specific details with each of the methods outlined below.
To end the payment process for any of the available payment methods, we recommend periodically verifying (long polling) the state of a transaction, waiting for a final status (approved, denied, voided or error), using the transaction ID and our API, since none of the payment methods deliver an instant synchronous response. A transaction that has just been created always has a PENDING status.
Final status of a transaction
The final status of a transaction can be: APPROVED (approved) , DECLINED (declined), VOIDED (anulled, applies to transactions with card only) or ERROR (if there is an external error with a payment method during the transaction).
Credit or Debit Cards
In Wompi, your customers can process payments using a Visa, Mastercard or Amex Credit or Debit Card, as long as the card has a CVC (card verification code), usually printed on the back of the card.
The payment method type that you must use to create the transaction is CARD. When using the payment method CARD you need to take into account that:
- You must first tokenize a card (more details below).
- You must ask the end how many installments does he wants to make his payment.
Tokenize a Credit or Debit Card
To securely tokenize a credit or debit card, you must use the endpoint (using your public key on the authentication header):
POST /v1/tokens/cards
To this endpoint, you must send the following card information inside the request body:
{
"number": "4242424242424242", // Card number (13 to 19 digits)
"cvc": "123", // Card verification code (3 or 4 digits, depending on franchise)
"exp_month": "08", // Expiration month (2 digits string)
"exp_year": "28", // Expiration year (2 digits string)
"card_holder": "John Smith" // Card holder name
}
The endpoint will respond something like the following:
{
"status": "CREATED",
"data": {
"id": "tok_prod_1_BBb749EAB32e97a2D058Dd538a608301", // TOKEN you must when creating the transaction
"created_at": "2020-01-02T18:52:35.850+00:00",
"brand": "VISA",
"name": "VISA-4242",
"last_four": "4242",
"bin": "424242",
"exp_year": "28",
"exp_month": "08",
"card_holder": "John Smith",
"expires_at": "2020-06-30T18:52:35.000Z"
}
}
In this response, the value of the "id" field is the token you must use inside the "payment_method" object (in this case "tok_prod_1_BBb749EAB32e97a2D058Dd538a608301"), to later on create a transaction.
Create the Transaction
After obtaining the token details and having asked the user the number of ("installments"). The payment method fields for a new transaction with a card should be similar to the following:
{
"payment_method": {
"type": "CARD",
"installments": 2, // Number of installments
"token": "tok_prod_e6S2sAz383mdCQ38dj32z" // Card token
}
// Other transaction fields...
}
Finally, it is essential to periodically verify the status of a transaction in Wompi from your system. To obtain the transaction status, use the transaction ID and access the following endpoint:
GET /v1/transactions/<ID_TRANSACCION>
Make sure to replace <ID_TRANSACCION> with the actual transaction ID you want to query. This endpoint will provide you with details about the transaction status and payment information.
You will find an example of the fields required to perform a new credit or debit card transaction below:
{
"data": {
"id": "0101010-0101010101-10101",
"created_at": "2023-01-17T18:16:06.287Z",
"amount_in_cents": 1000000,
"reference": "Prime_102305887219213_108224918",
"currency": "COP",
"payment_method_type": "CARD",
"payment_method": {
"type": "CARD",
"extra": {
"name": "MASTERCARD-0110",
"brand": "MASTERCARD",
"last_four": "0110",
"processor_response_code": "51" // Response code from the card processor and/or issuer
},
"installments": 2
},
"redirect_url": null,
"status": "DECLINED",
"status_message": "Fondos Insuficientes",
"merchant": {
"name": "HULU PRIME",
"legal_name": " HULU S.A.S.",
"contact_name": "John Doe",
"phone_number": "+573001111111",
"logo_url": null,
"legal_id_type": "NIT",
"email": "payins+01codiprime@hulu.com",
"legal_id": "100111111-01"
},
"taxes": []
},
"meta": {}
}
In the response, the processor_response_code, status, and status_message of the transaction are provided.
NOTE: We recommend using the processor_response_code field to obtain the processor's response. Additionally, please be aware that the endpoint response may include additional fields in the extra object.
Bancolombia Transfer Button
Simple Payment
In Wompi, your clients can complete the payment of a transaction using their Bancolombia savings or checking account. The name of the payment method that you must use when creating the transaction is BANCOLOMBIA_TRANSFER.
When using the BANCOLOMBIA_TRANSFER payment method type, you must take the following into account:
- Your client must choose what type of person they are in the
user_typefield. At the moment only Natural Person is available, as 'PERSON'.- You must specify a name of what is being paid in the
payment_descriptionfield. Maximum 64 characters. You cannot include single quotes in this data (').
- You must specify a name of what is being paid in the
Thus, the payment method fields of a new transaction with BANCOLOMBIA_TRANSFER must be similar to the following:
{
"payment_method": {
"type": "BANCOLOMBIA_TRANSFER",
"user_type": "PERSON", // Type of person
"payment_description": "Payment to Wompi Store", // Name of what is being paid. Maximum 64 characters
"ecommerce_url": "https://comercio.co/thankyou_page" // Allows the customer to skip the wompi transaction summary screen, and redirect to a personalized summary of the current transaction
}
// Other fields of the transaction to create...
}
When creating the transaction, you must query it continuously (long polling) until it contains a field called async_payment_url inside an extra object, which will be inside the payment_method property. Once you obtain it, you must redirect your client to this URL to complete the payment at the respective financial institution (bank). The field you should expect from the transaction would look like the following:
{
"payment_method": {
"type": "BANCOLOMBIA_TRANSFER",
// Other payment_method fields
"extra": {
"async_payment_url": "https://..." // URL to redirect to the client
}
}
// Other fields of the transaction...
}
Recurring Purchase New
Within Wompi's platform, we offer to your clients the possibility of allowing recurring payments from their Bancolombia account. This service is the perfect solution for those seeking convenience and efficiency in managing their periodic payments. This innovative payment option allows customers to securely authorize automatic and scheduled charges.
To create a recurring transaction, it is necessary to have created a payment source as seen here.
With the <<ID_SOURCE_PAYMENT>> field, you will proceed to create the transaction. If the token is in the APPROVED state, the transaction will be carried out without the need for the client to authenticate in Bancolombia
{
"payment_method": {
"type": "BANCOLOMBIA_TRANSFER",
"user_type": "PERSON", // Type of person
"payment_description": "Payment to Wompi Store", // Name of what is being paid. Maximum 64 characters
"ecommerce_url": "https://comercio.co/thankyou_page" // Allows the customer to skip the wompi transaction summary screen, and redirect to a personalized summary of the current transaction
},
"payment_source_id": <<PAYMENT_SOURCE_ID>>, // ID of the previously created payment source
// Other fields of the transaction to create...
}
When the payment process through Bancolombia is completed, it will redirect to the redirect_url that you originally specified in the transaction, so that you can verify the result of the transaction, again with a long polling until obtaining a final status.
Finally, always remember to periodically check the status of a transaction in Wompi from your system using the transaction ID and our API, with the endpoint GET /v1/transactions/<TRANSACTION_ID>.
Bancolombia QR
Allow your customers to use their Bancolombia accounts and Nequi accounts by generating a QR that must be read by the respective bank app. The name of the payment method that you must use when creating the transaction is BANCOLOMBIA_QR. You must bear in mind that payments through this medium only apply to natural persons.
The payment method fields for a BANCOLOMBIA_QR transaction will look like the following:
{
"payment_method": {
"type": "BANCOLOMBIA_QR",
"payment_description": "Payment to Wompi Store", // Payment description
// The next field is ONLY required if you're using the Sandbox environment:
"sandbox_status": "APPROVED" // Desired final status. One of the following: APPROVED, DECLINED o ERROR
}
// Other transaction fields...
}
When creating the transaction, you must consult it continuously (long polling) until it contains a field called qr_image and qr_id, which will be inside the payment_method property, which will have the image of the QR in base64 inside an extra object.
Once you get it, you can render the QR in an img tag as follows:
<img src="data:image/svg+xml;base64 + ${qr_image}"/>
The field you need to check for will look like the following:
{
"payment_method": {
"type": "BANCOLOMBIA_QR",
// Other payment method fields
"extra": {
"qr_id": "a3827b90-501b-11ed-ae9b-3156df51ed75", // ID QR code
"qr_image": "PD94bWwgdmVyc2lvbj0iK.....", // Qr image code in base64
"external_identifier": "d00000000000" //Reconciliation ID once the payment is made
}
}
// Others transactions fields...
}
After finalizing the payment process through BANCOLOMBIA_QR, it will redirect the customer to the redirect_url that you specified in the transaction (if you did) so that you can verify the result of the transaction again using long polling, until you get a final status.
Lastly, remember to periodically check the state of the transaction in Wompi from your system using the transaction ID and our API endpoint GET /v1/transactions/<TRANSACTION_ID>.
Nequi
With Wompi your customers can complete a payment by using Nequi on their cellphones. The name of the payment method that you need to use to create the transaction is NEQUI.
By using the payment method NEQUIyou only need to ask your customer for a 10 digit colombian cellphone number that is registered with Nequi, to send it along with the information to our API. Remember to tell your customer that he must have le Nequi app installed on his phone to complete the payment using this method.
Once you have the customer's cellphone number, all the fields should look like the following example:
{
"payment_method": {
"type": "NEQUI"
"phone_number": "3107654321" // Nequi cellphone number
}
// Other transaction fields...
}
When creating a transaction, you should indicate your customers that they will get a push notification from Nequi on their cellphones, which they need to accept or reject the transaction. This results will be reflected in Wompi in a matter of seconds, once the user has taken action.
Lastly, remember to periodically check the state of the transaction in Wompi from your system using the transaction ID and our API endpoint GET /transactions/:id.
PSE
With Wompi your customers can complete a payment using their savings or checking bank accounts, for any Colombian bank, using PSE. The name of the payment method that you should use to create the transaction is PSE.
When using the PSE payment method, you need to take into account the following steps:
- You need to obtain a list of financial institutions using our API, in the endpoint
GET /v1/pse/financial_institutions - Your customer must choose the financial institution (bank) that he wants to pay with.
- Your customer must specify the legal type of person that he is: a natural (
0) or juridical (1) person. - Your customer must specify his legal Colombian ID Type and Number. All residents and foreigners in Colombia have one of these ID's.
- Your customer must specify their full name.
- Your customer must specify an e-mail account.
- Your customer must specify a phone number.
- Finally, you must specify a description of what your customer is paying for, maximum 64 characters.
After your clients have choosen a financial institution, use his (code) as the identifier you will send when you create the transaction. That way, the payment method fields for a PSE transaction will look like the following:
{
"customer_email": "cliente@example.com",
"payment_method": {
"type": "PSE",
"user_type": 0, // Person type, natural (0) or business (1)
"user_legal_id_type": "CC", // Document type, CC, CE or NIT
"user_legal_id": "1099888777", // Document number
"financial_institution_code": "1", // Financial institution code
"payment_description": "Payment to Wompi Store, ref: JD38USJW2XPLQA" // Descripción de lo que está pagando. Máximo 64 caracteres
},
"customer_data": {
"phone_number": "573145678901",
"full_name": "Name(s) Last name(s)"
}
// Other transaction fields...
}
To be taken into consideration: In order to mitigate fraud in the PSE service, additional actions have been defined that must be implemented by all companies linked to the Financial Services category. Among these actions is the inclusion of three mandatory fields in the transactional frame, related to the IP address of the user, the date the product was opened and the identification of the beneficiary.
To comply with the above description it is recommended to send the payment_method object with the fields reference_one, reference_two, reference_three and reference_three.
{
// Otros campos de la transacción...
"payment_method": {
"type": "PSE",
"user_type": 0,
"user_legal_id_type": "CC",
"user_legal_id": "1999888777",
"financial_institution_code": "1",
"payment_description": "Pago a Tienda Wompi",
"reference_one": "192.168.0.1", // IP address of the paying customer, if not sent, the source IP address of the request will be taken.
"reference_two": "20240101", // Product opening date in yyyymmdd format
"reference_three": "123456" // Document number of the beneficiary of the financial product
}
}
When creating a transaction, you must check it continually using long polling until it contains a field called async_payment_url in an obect extra, within payment_method. Once you have it, you need to redirect the customer to this URL so that he can complete the payment in the respective financial institution. The field you need to check for will look like the following:
{
"payment_method": {
// Other payment method fields
"extra": {
"async_payment_url": "https://..." // URL where user should be redirected to compelted the payment
}
}
// Other transaction fields...
}
After finalizing the payment process through PSE, it will redirect the customer to the redirect_url you specified in the transaction (if you did) so that you can verify the result of the transaction again using long polling, until you get a final status.
Lastly, remember to periodically check the state of the transaction in Wompi from your system using the transaction ID and our API endpoint GET /v1/transactions/<TRANSACTION_ID>.
Cash Payment in Corresponsal Bancario Bancolombia
Payment method availability
This payment method is not activaded by default. To make this payment method available to your customers, you need to follow the activation process. Click here to get started.This payment method allows your customer to make cash payments by going to any Bancolombia branch office. To create a cash payment intention, you need to follow these steps:
Step 1: Create transaction
You must create a transaction assigning the value BANCOLOMBIA_COLLECT to the type field of the payment_method object.
{
"payment_method": {
"type": "BANCOLOMBIA_COLLECT" // Cash referenced Bancolombia payment
}
// Other transaction fields...
}
You will receive a transaction where the status field will have a PENDING value.
Step 2: Query the transaction
After creating the transaction, you must query it through GET /v1/transactions/<ID_DE_TRANSACCION> by long polling until you get the business agreement data that will be presented to you in the payment_method object in the extra field as follows:
{
"payment_method": {
"type": "BANCOLOMBIA_COLLECT",
"extra": {
"business_agreement_code": "12345", // This is an example
"payment_intention_identifier": "65770204276" // This is an example
}
// Other transaction information...
}
Step 3: Share the payment information
Once you have the payment information from the previous step, you can share the business_agreement_code and payment_intention_identifier with your customers so they can personally make the payment at any Corresponsal Bancario Bancolombia physical points of payment.