Bizum via Direct API
Integrate Bizum as a payment method in your application via the DEUNA direct API.
For more information, refer to the Payments API.
Overview
Bizum is a Spanish instant payment method that allows users to pay using their mobile phone number. DEUNA integrates Bizum through Redsys TPV Virtual using a redirect model: after initiating the purchase via the DEUNA API, the user is redirected to a Redsys-hosted page to complete Bizum authentication, then returned to your site.
Requirements:
- Available in Spain only
- Currency: EUR only
- The user must have an active Bizum account linked to a Spanish bank
Purchase v2
V2 purchases perform the order creation and payment initiation in a single endpoint.
The Bizum purchase process goes as follows:
- User calls
POST v2/merchants/order/purchasewith the order information. - DEUNA creates the order and initiates the Bizum transaction with Redsys.
- DEUNA returns a redirect URL in the response.
- You redirect the user to that URL to complete Bizum authentication on the Redsys page.
- After authentication, Redsys redirects the user back to your site.
- DEUNA listens to the Redsys server-to-server notification to confirm the final payment status.
Integrate Bizum by API
1. Make a Bizum purchase
Make a request to the V2 Purchase endpoint.
To make a Bizum purchase with DEUNA, the V2 payload must contain:
- The order data
- Callback URLs to redirect the user after payment
- Optionally, the user's mobile phone number to pre-fill the Bizum screen
All amounts must be expressed in cents. Example: €10.50 = 1050
Request example
{
"order_type": "DEUNA_CHECKOUT",
"payment_source": {
"method_type": "bank_transfer",
"processor": "redsys_bizum",
"method_type_specific_fields": {
"bizum_mobile_number": "+34700000000"
}
},
"callback_urls": {
"on_success": "https://example.com/success",
"on_error": "https://example.com/error"
},
"order": {
"order_id": "d81fe7bf-748b-4a7a-bc8f-7be98c8ae748",
"store_code": "all",
"currency": "EUR",
"total_amount": 1050,
"items_total_amount": 1050,
"sub_total": 1050,
"items": [
{
"id": "1",
"name": "Cinema ticket",
"description": "Standard ticket",
"total_amount": {
"amount": 1050,
"currency": "EUR",
"currency_symbol": "€"
},
"unit_price": {
"amount": 1050,
"currency": "EUR",
"currency_symbol": "€"
},
"quantity": 1
}
]
}
}2. Redirect the user
After the purchase is initiated, the API responds with a redirect URL in the next_action node.
- Take the URL
- Redirect the user to that URL.
- The user completes Bizum authentication on the Redsys page:
- Enters their mobile phone number
- Enters their Bizum PIN
- Confirms via OTP (SMS or in-app)
- After authentication, Redsys redirects the user back to your
callback_urls.on_successorcallback_urls.on_error. - Listen to DEUNA webhooks to confirm the final payment status.
For the final payment status, DEUNA listens to the server-to-server notification sent by Redsys after the user completes or abandons authentication. Do not rely on the browser redirect alone to confirm payment.
Response example
{
"order_type": "DEUNA_CHECKOUT",
"order_token": "db3fc147-2a4e-460f-a874-f6f79b1e651c",
"order": {
"order_id": "d81fe7bf-748b-4a7a-bc8f-7be98c8ae748",
"currency": "EUR",
"total_amount": 1050,
"status": "pending",
"payment": {
"data": {
"status": "pending",
"method_type": "bank_transfer",
"processor": "redsys_bizum",
"next_action": {
"action": "authorization_bank_transfer",
"authorization_bank_transfer": {
"redirect_url": "https://sis-t.redsys.es:25443/sis/realizarPago"
}
}
}
}
}
}Testing
Use the following test credentials in the Redsys sandbox environment to validate your integration.
| Bizum test user | Test case |
|---|---|
700000000 | Successful purchase |
[email protected] | Rejected purchase (Bizum authentication error) |
Payments made in the test environment have no accounting validity.
Updated 2 days ago