In this section you find the reference for the MEO Wallet resources and actions you can use to manipulate them. The resource structure generally follow the /collection, /collection/itemid pattern.
There are four resources you can manipulate: Checkouts, API Payments, Operations and Authorizations. Checkouts represent the handover of the payment process from your web site to MEO Wallet, while API Payment requests are meant to reduce the number of steps needed to complete a payment online with no Checkout involved.
Operations represent financial transaction on wallets.
Authorizations allow you to allocate a given amount to be captured later. Currently, only credit card transactions can be used with this concept.
There are two ways you can make API Payment Requests:
MB reference via the API: This is an extension only available to partner merchants. The API KEY must have specific permissions. Please request your merchant partner permission here.
If your checkout has the MB payment method available and you need a very limited duration (less than a day) for your payment, you can pass a special flag named instant in the “payment” object.
The expires field is mandatory and has to be a date in the future.
You can pass a request_id to track this request. Check the Idempotency page.
Create authorization
Creates a new authorization checkout.
This request is similar to the described above.
The main difference is the usage of a structure called “authorization” instead of “payment”. This object inherits all properties from the “payment” object.
Note: The optional field “expires” defines the date until the authorization is valid to be accepted.
All subsequent requests (captures and releases) have the “expires” modified to the authorization date plus 1 month.
Redirect your customer to the redirect_url to accept the authorization. Then, you can capture the amount using the authorization id (inside the structure «authorization» of the checkout response).
A callback will be sent in case of failure or success with a reference to the created checkout (checkout_id) and type of operation. In this case is “AUTH”.
You can pass a request_id to track this request. Check the Idempotency page.
Click here for an example
Returns after a successful payment:
Note: If your checkout is of the type “authorization”, a structure named “authorization” will be returned instead.
Delete checkout
Destroys an ongoing checkout. This will only succeed if the customer hasn’t chosen any payment method yet. If you want to refund an existing payment see operations/refund.
Request a refund of an operation. The refundable property tells you if an operation is refundable or not. Trying to refund a non refundable operation yelds an error.
You can pass a request_id to track this request. Check the Idempotency page.
/api/v2/payment
Create payment
Creates a new MB WAY payment.
Check valid mobile phones using this regular expression: ^9[1236]{1}[0-9]{7}$. If you try to send a valid number, but not registered at MB WAY service, you will get a 10002 error code. Check full list of errors here.
You can pass a request_id to track this request. Check the Idempotency page.
/api/v2/wallets/methods
Lists the payment methods active for this wallet.
Request
GET /api/v2/wallets/methods
URL params
none
Data params
none
Returns
methods array in JSON object
Click here for an example
Returns
/api/v2/anon/images/button
Gives you a payment button ready to include in an img tag. Can be configured with payment methods retrieved with wallets/methods and various styling options.
Request
GET /api/v2/wallets/methods
URL params
methods, style, culture, type
Data params
none
Returns
image
Style
When to use
REGULAR
Default web page styles
WHITE
White button with transparency for dark backgrounds
LIGHT
Filled button with light transparency
DARK
Filled button with transparency for dark backgrounds
Culture
Result
PT
Button labels in portuguese
EN
Button labels in english
Type
Label
BUY
Buy / Comprar
CONFIRM
Confirm / Confirmar
CONTINUE
Continue / Continuar
PAYMENT
Payment / Pagamento
PURCHASE
Purchase / Pagar
Example
https://services.wallet.pt/api/v2/anon/images/button?methods=CC,MB&style=light&culture=pt&type=purchase
/api/v2/anon/images/banner
Gives you a “secure payment banner” suitable for inclusion on your website footer. Provided in the form of an easy inclusion Javascript tag which generates a DIV container.