Skip to main content

Methods of payment

Important change 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 following payment methods are available:

  • 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 points redemption from Puntos Colombia loyalty program.
  • BNPL BANCOLOMBIA: Enabling your clients to choose a BANCOLOMBIA revolving 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.

To use a payment method you must POSTto the /transactions endpoint with:

  1. Specify the field payment_method_type and specify one of these 3 values: CARD, NEQUIor PSE
  2. Specify the field payment_method with 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 a 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 statuses for a transaction

The final status for a transaction can be: APPROVED , DECLINED, VOIDED 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:

  1. You must first tokenize a card. (more details below)
  2. You need to ask the end user how many installments does he want his payment deferred to.
Never store card sensitive data!
We completely discourage the storage of card sensitive data on your end. Not only you risk your users' data, but you can face economic sanctions and legal problems. Wompi has a PCI DSS certification for securely handling, transmitting and processing card sensitive data, therefore preventing merchants from storing this data, by using only safely generated card tokens.

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 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 further create a transaction.

Don't use a token more than once!
If you need to create multiple transactions for the same card, use our Payment Sources feature.

Create the Transaction

Taking into account these detailsand having asked the end user the number 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...
}

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/:id.

Bancolombia Transfer Button

With Wompi your customers can complete a payment using their Bancolombia savings or checking account. The name of the payment method that you should use to create the transaction is BANCOLOMBIA_TRANSFER.

When using the BANCOLOMBIA_TRANSFER payment method, you need to take into account the following steps:

  1. Your customer must specify the legal type of person. Currently, the only available option is PERSON
  2. You should specify a payment description in a maximum of 64 characters.
  3. If you're using the Sandbox environment, you must send the sandbox_status field, specifying the final status you wish to simulate. It should be one of the following values: APPROVED, DECLINED or ERROR.

The payment method fields for a BANCOLOMBIA_TRANSFER transaction will look like the following:

{
"payment_method": {
"type": "BANCOLOMBIA_TRANSFER",
"user_type": "PERSON", // Legal type of the person
"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 a transaction, you must check it continually using a 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 comokete 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 BANCOLOMBIA_TRANSFER, it will redirect the customer to the redirect_url which 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>.

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 which 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, in 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 debit 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:

  1. You need to obtain a list of financial institutions using the API endpoint GET /v1/pse/financial_institutions
  2. Your customer much choose the financial institution (bank) which he wants to pay with.
  3. Your customer must specify the legal type of person that he is: a natural (0) or business (1) person.
  4. Your customer must specify his legal Colombian ID Type and Number. All residents and foreigners in Colombia have one of these ID's.
  5. Your customer must specify their full name.
  6. Your customer must specify an e-mail account.
  7. Your customer must specify a phone number.
  8. Finally you must specify a description of what your customer is paying for, maximum 64 characters.

After your clients have choosen a financial institurion, use his (code) as the identifier which you will send to 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...
}

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 comokete 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 which 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 hereto get started.

This payment method allows your customer to make cash paymentx 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.

PCOL

With Wompi your customers can complete a payment using their points from "Puntos Colombia". There are two options (i) Total payment with points (ii) Part of the payment with Points + a Second payment method that includes Tarjetas de Crédito o Débito, Botón de Transferencia Bancolombia, Nequi o PSE. The name of the payment method that you should use to create the transaction is PCOL.

Step 1: Create PCOL transaction

You must create a transaction assigning the value PCOL to the payment_method object.

{
"customer_email": "myemail@mail.com",
"customer_data": {
"phone_number": "+573121111111",
"full_name": "Nombre Apellido"
},
"payment_method": {
"type": "PCOL"
}
// Other transaction information...
}

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 start the the payment with points redemption. 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 information...
}

Step 2: Query PCOL transaction (Points redemption result)

At the end of the redemption process, your customer will be redirect to the redirect_url that you originally specified in the transaction, so that you can verify the result of the redemption, and identify if the total payment was make with points or partial and has a remaining amount to pay.

Upon receiving the redirection, a long polling of the transaction must be done again until the status field is different from PENDING and receving the fields point_redeemed, redeemed_amount_in_cents_pcol and remaining_amount_in_cents within an object extra, which will be inside the payment_method property:

{
"payment_method": {
"type": "PCOL",
"extra": {
"points_redeemed": 1000, // Points redeemed
"remaining_amount_in_cents": 0, // Remaining amount to pay with another payment method
"redeemed_amount_in_cents_pcol": 700000 // Amount redeemed using points
}
},
"status": "APPROVED"
// Other transaction information...
}

You should check the value within the field remaining_amount_in_cents: (i) If the value is 0, and transaction status APPROVED this means that the customer paid the transaction total amount with points. (ii) If the value is 0, and the status of the transaction is ERROR or DECLINED, this will indicate that any points were redeemed; in this case you can enable the customer the option to pay the total transaction with a second payment method. (Step 3) (iii) If the value is greater than 0, you must enable the option to pay with a second payment method the reamining amount. (Step 3)

Step 3: Second payment method

If the previous step results in (ii) or (iii) a second payment methos selection must be enabled with the options Tarjetas de Crédito o Débito, Botón de Transferencia Bancolombia, Nequi and PSE to pay the value in remaining_amount_in_cents. Once selected the second payment method, a second transaction must be created. In this case you should follow the documentation of the payment method and include a new field to associate the first transaction (parent_transaction_id):

Card as second payment method

{
"payment_method": {
"type": "CARD",
"installments": 2, // Número de cuotas
"token": "tok_prod_1_BBb749EAB32e97a2D058Dd538a608301" // Token de la tarjeta de crédito
},
"parent_transaction_id": "1929-1666902167-47609" // PCOL transaction
// Other transaction information...
}

Botón Transferencia Bancolombia as second payment method

{
"payment_method": {
"type": "BANCOLOMBIA_TRANSFER",
"user_type": "PERSON",
"payment_description": "Pago a Tienda Wompi",
"ecommerce_url": "https://comercio.co/thankyou_page"
},
"parent_transaction_id": "1929-1666902167-47609" // PCOL transaction
// Other transaction information...
}

Nequi as as second payment method

{
"payment_method": {
"type": "NEQUI"
"phone_number": "3107654321"
},
"parent_transaction_id": "1929-1666902167-47609" // PCOL Transaction
// Other transaction information...
}

PSE as second payment method

{
"payment_method": {
"type": "PSE",
"user_type": 0,
"user_legal_id_type": "CC",
"user_legal_id": "1099888777",
"financial_institution_code": "1",
"payment_description": "Pago a Tienda Wompi, ref: JD38USJW2XPLQA",
"ecommerce_url": "https://comercio.co/thankyou_page"
},
"parent_transaction_id": "1929-1666902167-47609" // PCOL transaction
// Other transaction information...
}

Lastly, remember to periodically check the state of the transacion in Wompi from your system using the transaction ID and our API endpoint GET /transactions/:id. When checking a PCOL transaction with second payment method associated, you will get a field called child_transaction_id witing the extra object, within the property payment_method; this field is the transaction id for the second payment method.

{
"payment_method": {
"type": "PCOL",
"extra": {
"points_redeemed": 0,
"async_payment_url": "https://....",
"external_identifier": "external-id-123",
"remaining_amount_in_cents": 300000,
"redeemed_amount_in_cents_pcol": 0,
"child_transaction_id": "11463-1666651097-12919" // Transacción segundo medio de pago
}
}
}

In the same way, when checking for the child_transaction_id you will get the PCOL transaction id within parent_transaction_id:

{
"payment_method": {
"type": "NEQUI", // Second payment method
"phone_number": "3222222222",
"extra": {
"parent_transaction_id": "11463-1666649502-97081" // PCOL Transaction
}
}

BNPL Bancolombia

Within the Wompi platform, we offer your clients the opportunity to complete their transactions using a revolving credit provided by BANCOLOMBIA, distinguished by its attractive 0% interest rate. This convenient service allows users to enjoy financial flexibility by splitting the payment into 4 monthly installments. Emphasizing its accessibility, this payment method is available for transactions with amounts starting from $100,000 COP, ensuring a financial experience tailored to diverse needs. For more information about this innovative payment option, we invite you to find additional details here.

Step 1: Create the transaction with BNPL Bancolombia Payment Method

To create a BNPL Bancolombia Payment transaction, the payment method fields should be similar to the following:

{
"amount_in_cents": 10000000, //$100.000 COP in cents
"currency": "COP", // Currency type
"customer_email": "myemail@mail.com", // Customer email
"reference": "{{REFERENCE}}", // Reference
"payment_method": {
"type": "BANCOLOMBIA_BNPL", // Payment method
"name": "Pedro", // Customer name
"last_name": "Perez", // Customer last name
"user_legal_id_type": "CC", // Customer type document
"user_legal_id": "12345678", // Customer number document
"phone_number": "3222222222", // Customer phone
"phone_code": "+57", // Customer phone code
"redirect_url": "https://www.wompi.com", // Redirection URL after the end of the BNPL experience
"payment_description": "Payment to Wompi Store, ref: JD38USJW2XPLQA" // Name of the item being paid. Maximum 30 characters
},
"acceptance_token": "{{ACCEPTANCE_TOKEN}}", // Acceptance token
"payment_method_type": "BANCOLOMBIA_BNPL" // Payment method
}

When creating the transaction, you must continuously check it (long polling) until it contains a field called url within an object extra, which will be inside the payment_method property. Once obtained, you should redirect your client to this URL to access the BNPL Bancolombia experience. The field you should expect from the transaction looks like the following:

{
"data": {
"id": "12041-1701116325-63662",
"created_at": "2023-11-27T20:18:45.527Z",
"finalized_at": null,
"amount_in_cents": 50000000,
"reference": "wvnofptru4s",
"currency": "COP",
"payment_method_type": "BANCOLOMBIA_BNPL",
"payment_method": {
"name": "Pedro",
"type": "BANCOLOMBIA_BNPL",
"extra": {
"url": "https://test.com", // <------ URL
"steps": ["ProvideAuthenticate"],
"is_three_ds": false
},
"last_name": "Perez",
"phone_code": "+57",
"phone_number": "3222222222",
"redirect_url": "https://www.wompi.com",
"user_legal_id": "12345678",
"user_legal_id_type": "CC",
"payment_description": "Payment to Wompi Store, ref: JD38USJW2XPLQA" // Name of the item being paid. Maximum 30 characters
},
"payment_link_id": null,
"redirect_url": null,
"status": "PENDING",
"status_message": null,
"merchant": {
"id": 1,
"name": "Test",
"legal_name": "Test",
"contact_name": "Test",
"phone_number": "+573222222222",
"logo_url": null,
"legal_id_type": "CC",
"email": "test@wompi.com",
"legal_id": "12345678",
"public_key": "{{PUBLIC_KEY}}"
},
"taxes": [],
"tip_in_cents": null
},
"meta": {}
}

Step 2: Validate Transaction Result

Upon completion of the redemption process through BNPL, it will redirect to the redirect_url that you originally specified in the transaction, allowing you to verify the transaction result. Upon receiving the redirection, you should perform long polling on the transaction again until the status field obtains a value other than PENDING:

{
"data": {
"id": "12041-1701116325-63662",
"created_at": "2023-11-27T20:18:45.527Z",
"finalized_at": null,
"amount_in_cents": 50000000,
"reference": "wvnofptru4s",
"currency": "COP",
"payment_method_type": "BANCOLOMBIA_BNPL",
"payment_method": {
"name": "Pedro",
"type": "BANCOLOMBIA_BNPL",
"extra": {
"url": "https://test.com",
"steps": ["ProvideAuthenticate"],
"is_three_ds": false
},
"last_name": "Perez",
"phone_code": "+57",
"phone_number": "3222222222",
"redirect_url": "https://www.wompi.com",
"user_legal_id": "12345678",
"user_legal_id_type": "CC",
"payment_description": "Payment to Wompi Store, ref: JD38USJW2XPLQA" // Name of the item being paid. Maximum 30 characters
},
"payment_link_id": null,
"redirect_url": null,
"status": "APPROVED", // <------ Status
"status_message": null,
"merchant": {
"id": 1,
"name": "Test",
"legal_name": "Test",
"contact_name": "Test",
"phone_number": "+573222222222",
"logo_url": null,
"legal_id_type": "CC",
"email": "test@wompi.com",
"legal_id": "12345678",
"public_key": "{{PUBLIC_KEY}}"
},
"taxes": [],
"tip_in_cents": null
},
"meta": {}
}

Daviplata - COMING SOON

Within the Wompi platform, we offer your customers the opportunity to streamline their payments by using their Daviplata account. This service provides a convenient alternative to complete transactions efficiently. Leveraging the user-friendly features of Daviplata, your customers can make payments easily, tailored to their financial lifestyle.

To use this payment method, it is necessary to request the customer's document type and number, as well as ensure phone coverage. Additionally, the customer must have the application installed on their mobile device. The system will conduct a search and send an OTP code via a text message to the phone number associated with the two aforementioned fields, with the purpose of confirming the transaction.

Step 1: Create the transaction with Daviplata payment method

To initiate a payment transaction with Daviplata, it is necessary for the transaction fields to adhere to the following structure:

{
"amount_in_cents": 150000, //Amount in cents ($1,500 Colombian pesos)
"currency": "COP", //Currency
"customer_email": "test@test.com", //Customer's email
"reference": "{{REFERENCE}}", //Reference created by the merchant
"payment_method": {
"type": "DAVIPLATA", //Payment method
"user_legal_id_type": "CC", //Customer's document type
"user_legal_id": "1134568019", //Customer's document number,
"payment_description": "Payment to Wompi Store, ref: JD38USJW2XPLQA" // Name of the item being paid. Maximum 30 characters
},
"acceptance_token": "{{ACCEPTANCE_TOKEN}}", //Acceptance token
"payment_method_type": "DAVIPLATA", //Payment method
"redirect_url": "https://www.google.com" //Optional field: Redirect URL upon completion of the transaction
}

When creating the transaction, it is necessary to perform continuous queries (long polling) until it includes a field named url, which will be located in the property data -> payment_method -> extra -> url:

{
"data": {
"id": "12518-1707838356-68178",
"created_at": "2024-02-13T15:32:37.046Z", //Creation date
"finalized_at": null,
"amount_in_cents": 150000, //Amount in cents ($1,500 Colombian pesos)
"reference": "6lmmyl8howq", //Reference created by the merchant
"currency": "COP", //Currency
"payment_method_type": "DAVIPLATA", //Payment method
"payment_method": {
"type": "DAVIPLATA", //Payment method
"extra": {
"url": "https://test.com", //Wompi interface URL for entering OTP code
"steps": ["Create"],
"is_three_ds": false,
"afe_decision": "FRAUD_CHECK",
"url_services": {
//Services for implementing OTP resend and confirmation
"token": "token", //JSON Token
"code_otp_send": "https://test.com", //URL for resending the OTP code
"code_otp_validate": "https://test.com" //URL for validating the OTP code
}
},
"user_legal_id": "53234234", //Customer's document number
"user_legal_id_type": "CC", //Customer's document type,
"payment_description": "Payment to Wompi Store, ref: JD38USJW2XPLQA" // Name of the item being paid. Maximum 30 characters
},
"payment_link_id": null,
"redirect_url": "https://www.test.com", //Redirect URL upon completion of the transaction (if specified)
"status": "PENDING", //Transaction status
"status_message": null,
"merchant": {
//Merchant information
"id": 999,
"name": "test",
"legal_name": "Pepito Perez",
"contact_name": "Pepito Perez",
"phone_number": "+573222222222",
"logo_url": null,
"legal_id_type": "CC",
"email": "test@gmail.com",
"legal_id": "32452341",
"public_key": "public_key" //Merchant's public key
},
"taxes": []
},
"meta": {}
}
  • Utilizing the Wompi experience

Once you have this information, you should redirect your client to the corresponding URL to access the experience we provide, where they can enter the confirmation OTP code. This experience looks like the following:

otp daviplata

  • Applying your experience

This time, we focus on the JSON data -> payment_method -> extra -> url_services. Here you will find the following fields:

  1. token: You must send this as a Bearer token in your Headers.
  2. code_otp_send: It is used to resend an OTP code to the client. To use it, you must make a POST type request. Don't forget to include the Bearer token in your Headers. In case of a successful request, the response will be as follows:
{
"status": 200,
"code": "OK",
"message": "Solicitud ejecutada correctamente.",
"data": {
"transaction": {
"PK": "12518-1707777099-36709", //Transaction identifier
"status": "PENDING", //Transaction status
"statusMessage": "",
"amountInCents": 150000, //Amount in cents ($1,500 Colombian pesos)
"steps": {
"PurchaseIntention": [
{
"fechaExpiracionToken": "2024-02-13T15:03:08.272-05:00", //OTP expiration date
"idSessionToken": "24748382" //OTP identifier
},
{
"fechaExpiracionToken": "2024-02-13T15:16:15.744-05:00", //OTP expiration date
"idSessionToken": "19935125" //OTP identifier
}
]
},
"redirectUrl": "https://www.google.com", //Redirect URL upon completion of the transaction (if specified)
"createdAt": "2024-02-12T22:31:57.903Z", //Creation date
"updatedAt": "2024-02-12T22:32:11.975Z" //Modification date
},
"authorization": {
"access_token": "access_token" //New access token
},
"attempts": {
"currentSendCode": 2, //Number of times you have requested the OTP code resend
"limitSendCode": 2, //Number of times you can request the OTP code
"currentValidateCode": 0, //Number of times you have confirmed the OTP
"limitValidateCode": 2 //Number of times you can confirm the OTP
}
}
}

IMPORTANT

When you resend an OTP code, before making the request to validate the new OTP code, you must update your Bearer token in the header, using the new access_token found in the authorization JSON field of the code_otp_send request.

  1. code_otp_validate: This function allows you to send the OTP code entered by the client to confirm the transaction. To validate the OTP, make a POST request ensuring that you include the Bearer token in the Headers and a JSON body, as shown below:
{
"code": 123456
}

In case of a successful request, the response will be as follows:

{
"status": 200,
"meta": {
"trace_id": "5d9eb010-c9f7-11ee-aaec-a50d7c8df505"
},
"code": "OK",
"message": "Solicitud ejecutada correctamente.",
"data": {
"transaction": {
"PK": "12518-1707777099-36709", //Transaction identifier
"status": "PENDING", //Transaction status
"statusMessage": "",
"amountInCents": 1500000, //Amount in cents ($1,500 Colombian pesos)
"steps": {
"PurchaseIntention": [
{
"fechaExpiracionToken": "2024-02-12T17:35:11.554-05:00",
"idSessionToken": "93016224"
}
],
"ConfirmIntention": [
{
"idTransaccionAutorizador": "000000368995", //ID Authorizador
"estado": "Aprobado", //Final status of the transaction(DAVIPLATA)
"fechaTransaccion": "2024-02-13T14:55:56", //Transaction completion date
"numAprobacion": "452341" //Approval number
}
]
},
"redirectUrl": "https://www.test.com", //Redirect URL upon completion of the transaction (if specified)
"createdAt": "2024-02-12T22:31:57.903Z", //Creation date
"updatedAt": "2024-02-12T22:37:56.592Z" //Modification date
},
"authorization": {
"access_token": "access_token" //access token
},
"attempts": {
"currentSendCode": 1, //Number of times you have requested the OTP code resend
"limitSendCode": 2, //Number of times you can request the OTP code
"currentValidateCode": 1, //Number of times you have confirmed the OTP
"limitValidateCode": 2 //Number of times you can confirm the OTP
}
}
}

Step 2: Validate the transaction outcome

Once the redemption process through Daviplata is completed, you will be redirected to the redirect_url you specified when creating the transaction (if defined) or to our interface. At this point, you can check the final status of the transaction. If you specified a redirect_url when creating the transaction, it is recommended to perform continuous long polling until the transaction reaches a final state:

{
"data": {
"id": "12518-1707854036-89959",
"created_at": "2024-02-13T19:53:56.879Z", //Creation date
"finalized_at": "2024-02-13T19:55:58.000Z", //Completion date
"amount_in_cents": 150000, //Amount in cents ($1,500 Colombian pesos)
"reference": "zieemgxkai", //Reference created by the merchant
"currency": "COP", //Currency
"payment_method_type": "DAVIPLATA", //Payment method
"payment_method": {
"type": "DAVIPLATA", //Payment method
"extra": {
"url": "https://test.com", //Wompi interface URL for entering OTP code
"steps": [
"ConfirmIntention",
"ConfirmIntention",
"PurchaseIntention",
"Create"
],
"is_three_ds": false,
"afe_decision": "FRAUD_CHECK",
"url_services": {
//Services for implementing OTP resend and confirmation
"token": "token", //JSON Token
"code_otp_send": "https://test.com", //URL for resending the OTP code
"code_otp_validate": "https://test.com" //URL for validating the OTP code
},
"external_identifier": "452341", //Approval number
"daviplata_transaction_id": "452341" //Approval number
},
"user_legal_id": "53234234", //Customer's document number
"user_legal_id_type": "CC", //Customer's document type,
"payment_description": "Payment to Wompi Store, ref: JD38USJW2XPLQA" // Name of the item being paid. Maximum 30 characters
},
"payment_link_id": null,
"redirect_url": null, //Redirect URL upon completion of the transaction (if specified)
"status": "APPROVED", //Transaction status
"status_message": null,
"merchant": {
//Merchant information
"id": 999,
"name": "test",
"legal_name": "Pepito Perez",
"contact_name": "Pepito Perez",
"phone_number": "+573222222222",
"logo_url": null,
"legal_id_type": "CC",
"email": "test@gmail.com",
"legal_id": "32452341",
"public_key": "public_key" //Merchant's public key
},
"taxes": []
},
"meta": {}
}