A) Webservice for MBWAY Payments
The MBWAY web service is available at the following address:
The method SetPedido and SetPedidoJson allows to send an MBWAY payment Request
The only difference between the 2 methods is the format in which the result is returned. In the first one (SetPedido) it is returned in SOAP format (1.1 and 1.2); in the second (SetPedidoJson) it is returned in JSON format.
In addition to the methods mentioned above, there are also methods EstadoPedidos and EstadoPedidosJson. Both return the status of the order. The difference between the two is the format of the result as already described above.
All referred methods can be invoked by GET or POST.
Method SetPedido or SetPedidoJSON
• MbWayKey - (Mandatory) provided by IFTHENPAY when concluding the contract.
• canal - (Mandatory) In case this API will always have the constant value “03”.
• referencia – (Mandatory) Payment identifier to be defined by the customer ( ex. invoice number, order number, etc…= Maximum 15 characters.
• valor – (Mandatory) amount to be charged.
• nrtlm – (Mandatory) Customer phone number.
• email – (Optional) Customer email.
• descricao - (Mandatory) description of the payment (you can use the [REFERENCIA] tag if you want the description to be the same as the reference); Maximum 50 characters.
- IdPedido - Automatically generated id, can be saved for later reference the order status;
- Valor – Value of the request in Euros;
- CodigoMoeda – It always has the value 9782;
- Estado – Indicates the success or error of the operation: (“000” = Order successfully sent to the customer. If the value is different from “000”, it is necessary to analyze the MsgDescricao field, ex: “113” = invalid mobile number);
- DataHoraPedido – Date and Time that was requested to the SIBS;
- MsgDescricao – Message associated with the status of the operation.
After the order is placed and as soon as the customer accepts payment on the MBWAY App, he will be notified by IFTHENPAY in the same way as the ATM references, that is, by “ push notification”, if you have our app installed with this option active, by email or consult directly in the BackOffice.
If u wish to be notified by callback, you must request the activation of the callback
Note: To carry out the order test we advise you to create an account on the MB WAY app and send the orders to that number and as soon as you receive the notification do not accept the payment, otherwise the payment will be processed normally.
Method EstadoPedidos Or EstadoPedidosJSON
If you wish to consult the status of the request (s), you can invoke any of these methods.
- mbWayKey – Provided by IFTHENPAY when concluding the contract;
- canal - (Mandatory) In case this API will always have the constant value “03”.
- idspagamento – ID returned (IdPedido) at the time of the operation SetPedido/SetPedidoJson;
Table with possible states ( Code, descripition ) :
Financial transaction completed successfully
Financial transaction cancelled by the user
Financial transaction cancelled by the Merchant
The operation could not be completed
Financial operation not allowed
The format of the mobile number was not in the correct format
The mobile number used as an identifier was not found
Operation refused to the user
Financial transaction not found
Operation refused to the user
B) Callback MBWAY
To activate the payment callback, the process is exactly as described in the previous point. Only the URL format is different.
• [CHAVE_ANTI_PHISHING] – Token previous defined by you to autenticate the answer;
• [REFERENCIA] – MBWAY Reference;
• [ID_TRANSACAO] – Id Transaction (idPedido);
• [VALOR] – Amount payied;
• [DATA_HORA_PAGAMENTO] – Date/Time of payment (returns on format dd-MM-yyyy HH:mm:ss);
• [ESTADO] - Order status. (returns “PAGO” whenever payment is accepted);
As described in the previous point, your URL does not have to return any value. The success of our request is determined by the HTTP code obtained: If you return the HTTP 200 code, IFTHENPAY considers that the call was successful, if you return a different code (HTTP 400, 500 or other) then IFTHENPAY considers that the call does not it was successful and will try again later (it will try 13 times, the first 8 will be every 5 minutes and the rest every hour). If in those 13 attempts you do not get an OK answer, you will not try again.