Skip to main content
On this page

Overview#

With the direct API, you create the PSE payment from your backend and redirect the buyer to the bank portal from your own checkout. DEUNA verifies the result with Movii and updates the payment status.

With DEUNA, Movii (PSE Avanza) is available as a bank transfer (bank_transfer) payment method with the movii_pse processor.

Requirements#

Configure the Movii webhook#

DEUNA confirms payments with the notifications Movii sends. Movii configures these notifications, not DEUNA.

  1. Ask your DEUNA account team for the DEUNA notification URL for each environment: sandbox and production.
  2. Ask Movii to register that URL as a webhook on your Movii account in each environment.
  3. Confirm with Movii that the webhook is active before you start processing payments.

Purchase V2#

V2 purchases create the order and start the payment in a single endpoint. The flow is:

  1. You call POST v2/merchants/order/purchase with the order information, the selected bank, and the payer data.
  2. DEUNA validates the fields and sends the payment to Movii.
  3. DEUNA returns the bank URL in the next_action node.
  4. You redirect the buyer to the bank to complete the payment.
  5. DEUNA verifies the status with Movii and updates the payment status.

Integrate Movii (PSE Avanza) by API#

1. Make a purchase with Movii (PSE Avanza)

Send a request to the Purchase V2 endpoint. DEUNA validates the following fields before sending the payment to Movii.

FieldDescriptionRestriction
payment_source.method_typePayment method typebank_transfer
payment_source.processorProcessormovii_pse
payment_source.method_type_specific_fields.pse.financial_institutionCode of the bank selected by the buyerMaximum 5 characters
order.billing_address.identity_document_typeDocument typeCC, RC, TI, CE, PP, or NIT
order.billing_address.identity_documentDocument numberMaximum 15 characters
order.billing_address.first_name and order.billing_address.last_namePayer nameMaximum 64 characters in total
order.billing_address.phonePhone number10 digits, without +57
order.billing_address.address1 and order.billing_address.address2AddressMaximum 64 characters in total
order.billing_address.emailEmailMaximum 120 characters
order.currencyCurrencyCOP only
order.total_amountOrder amountUp to 14 digits, in cents
order.total_tax_amountTax amountUp to 14 digits, in cents
order.descriptionOrder descriptionMaximum 80 characters, including the order_id
order.callback_urls.on_successURL to return the buyer to after paymentMaximum 512 characters

Request example

JSON
{
  "order_type": "DEUNA_NOW",
  "payer_info": {
    "email": "shopper@example.com"
  },
  "payment_source": {
    "method_type": "bank_transfer",
    "processor": "movii_pse",
    "method_type_specific_fields": {
      "pse": {
        "financial_institution": "1022",
        "financial_institution_name": "BANCO UNION COLOMBIANO"
      }
    }
  },
  "order": {
    "order_id": "7e264a9e-b7c9-434c-ac17-d2de8e10a692",
    "currency": "COP",
    "description": "Test purchase",
    "market_type": "ecommerce",
    "callback_urls": {
      "on_success": "https://your-store.com/checkout/result"
    },
    "items": [
      {
        "id": "00ab2d23-f44a-4782-aa7c-bb4fadeddfe3",
        "name": "Item #1",
        "description": "Description Item #1",
        "total_amount": {
          "original_amount": 1190000,
          "amount": 1190000,
          "total_discount": 0,
          "currency": "COP",
          "currency_symbol": "$"
        },
        "unit_price": {
          "amount": 1000000,
          "currency": "COP",
          "currency_symbol": "$"
        },
        "tax_amount": {
          "amount": 190000,
          "currency": "COP",
          "currency_symbol": "$"
        },
        "quantity": 1,
        "taxable": true
      }
    ],
    "sub_total": 1000000,
    "tax_amount": 190000,
    "total_tax_amount": 190000,
    "total_amount": 1190000,
    "store_code": "all",
    "billing_address": {
      "first_name": "Andres",
      "last_name": "Perez",
      "email": "shopper@example.com",
      "address1": "Carrera 7 # 71-21",
      "address2": "Torre B, Oficina 502",
      "zipcode": "110231",
      "city": "Bogotá",
      "state_name": "Bogotá D.C.",
      "country_code": "CO",
      "identity_document": "1234567890",
      "identity_document_type": "CC",
      "phone": "3001234567"
    }
  }
}

2. Redirect the buyer to the bank

Once the purchase starts, the API responds with the payment in pending status and the bank URL in the next_action node.

FieldDescription
next_action.actionauthorization_bank_transfer
next_action.authorization_bank_transfer.redirect_urlURL of the bank's PSE portal where you redirect the buyer

Response example

JSON
{
  "next_action": {
    "action": "authorization_bank_transfer",
    "authorization_bank_transfer": {
      "redirect_url": "https://pse-portal-url/..."
    }
  }
}
  • Redirect the buyer to redirect_url, or open it in a new window.
  • Show a waiting view in your checkout while the buyer pays.
  • Let the buyer go back and choose another payment method.

3. Verify the payment

Read the status in order.payment.data.status from your webhooks or by querying the order.

payment.data.statusFinalMeaningAction
pendingNoThe buyer has not finished at the bank.Do not fulfil the order.
processedYesThe PSE transaction was completed. The order is succeeded.Complete the order.
deniedYesThe PSE transaction was not completed.Do not mark the order as paid. Show the rejected-payment page.

DEUNA always verifies the transaction status with Movii before changing the order to a final status.

Testing#

Test in the DEUNA sandbox (https://api.sandbox.deuna.io) with a Colombian merchant enabled for Movii (PSE Avanza).

  1. Ask Movii for test credentials for your merchant. Connect them in Admin, and ask Movii to configure the test webhook with the DEUNA sandbox notification URL. See Configure the Movii webhook.
  2. Create a purchase in COP. Use a different document number for each test payment.
  3. Redirect the buyer to redirect_url. The PSE sample frontend opens, using the simulator described in PSE testing data.
  4. Set the final state of the transaction in the simulator, run it, and return to the merchant.
  5. Verify that order.payment.data.status has the expected value.

Test these scenarios before going live:

ScenarioWhat to verify
The buyer completes the paymentorder.payment.data.status is processed, and the order is succeeded.
The bank rejects the paymentorder.payment.data.status is denied. It is not marked as paid, and your site shows the rejected-payment page.
The payment stays pendingorder.payment.data.status is pending. Your site does not fulfil the order until DEUNA reports a final status.
The buyer closes the bank windowYour site does not fulfil the order. Wait for the final status from DEUNA.

Limitations#

  • Available only in Colombia and in COP.
  • Only Purchase is supported. Authorization, Capture, and Cancel (Void) are not supported.
  • Refunds are not supported. Movii does not publish a refund endpoint.
  • Recurring payments are not supported.