Download OpenAPI specification:Download
The easypay API is a collection of web services that allow you to receive payments from customers, be notified of those payments, refund them if necessary, among others.
The API endpoints are available through the following domains:
https://api.test.easypay.pt/
https://api.prod.easypay.pt/
To create credentials for your account you can follow this guide.
Server-to-server requests to easypay APIs must be authenticated via Account ID and API Key. To do so, include the following HTTP headers in your API requests:
AccountId: <YOUR_ACCOUNT_ID>
ApiKey: <YOUR_API_KEY>
When these headers are missing or incorrect, a 403
HTTP status code is returned.
For your convenience, during tests you can use the following ID/Key pair:
AccountId: 2b0f63e2-9fb5-4e52-aca0-b4bf0339bbe6
ApiKey: eae4aa59-8e5b-4ec2-887d-b02768481a92
These will only work for testing purposes and won't work in production.
Easypay uses HTTP response status codes to indicate the success or failure of your API requests. If your request fails, Easypay returns an error using the appropriate status code.
In general, there are three status code ranges you can expect:
2xx
success status codes confirm that your request worked as expected4xx
error status codes indicate an error because of the information provided (for example, a required parameter was omitted).5xx
error status codes are rare and indicate an error with Easypay’s servers.Some 4xx
errors that could be handled programmatically (for example, a card is declined) include an error code (a short string with a brief explanation) as a value for code
.
Below is a list of possible error codes that can be returned, along with additional information about how to resolve them. For your convenience, these types of errors also include the doc_url
attribute with a direct link to the specific error code it corresponds to.
This error can have multiple potential causes. Here are some examples:
This error can only have one cause, you provided an invalid/unsupported content type header.
This error happens when you provide a bad formated JSON payload.
This error indicates the information provided was incorrect of insufficient (for example, a required parameter was omitted).
This error indicates that an unexpected error ocurred on our servers.
Easypay API incorporates idempotency that enables the safe re-submission of requests, eliminating the risk of unintentionally duplicating operations.
This helps to circumvent unintentional replication due to failures and retries.
For instance, in an event of a timeout error, you can securely resend the same API payment call several times, assured that the payment detail will be debited only once.
To execute an idempotent request, simply include an additional Idempotency-Key
header within the request parameters.
curl -L -X POST 'https://api.test.easypay.pt/2.0/checkout' \
-H 'AccountId: 2b0f63e2-9fb5-4e52-aca0-b4bf0339bbe6' \
-H 'ApiKey: eae4aa59-8e5b-4ec2-887d-b02768481a92' \
-H 'Idempotency-Key: 435e08a0-e5a9-4216-acb5-44d6b96de612' \
-H 'Content-Type: application/json' \
--data-raw '{ "type": [ "single" ] ... }'
You can check if a request is a replay by checking if the Idempotency-Replay
Header is present in the response and if it has the value "true"
.
Although the technique of creating unique keys is your choice, remember random string with sufficient entropy to prevent overlaps is advisable.
Easypay recommends the use of UUID V4 or ULID as Idempotency Key.
The maximum length for idempotency key is 50 characters.
Two requests with the same Idempotency-Key but different AccountId headers will be treated as different requests.
Easypay manages idempotency by storing the initial status code and response body for the initial request with a specific idempotency key.
The Idempotency layer compares the request body of the incoming request with that of the original request.
If they differ, the system triggers an error to prevent inadvertent misuse.
Repeated requests bearing the same key yield identical outcomes. The only exception pertains to transient errors, which we have identified as the following:
The previously mentioned error codes are safe to retry.
To help the client applications decide whether to retry calls, the API's responses include an X-Easypay-Should-Retry
header with value "true"
or "false"
.
Note that this header does not take into account the number of tries already made, so clients should keep track and only send a limited number of equal requests (e.g. 3).
If and when the header is not present, clients can use the following strategy to determine what to do:
POST
request.Idempotency Keys are automatically purged from the system once they've been in existence for 24 hours, and a fresh request is initiated if a key is reused after its original has been deleted.
Only results from API endpoints that have started execution are stored.
If your request fails authentication, it will not be governed by idempotency rules.
Idempotency keys are acceptable in all POST/PATCH requests.
It is unnecessary and should be avoided to supply idempotency keys in GET and DELETE requests, as these types of requests are inherently idempotent by nature.
Payment methods are defined according to two different categories:
Each method of payment is categorized as either pull or push, depending on how funds are transferred from the customer’s payment method.
In a method with a pull behaviour, the customer needs only to accept the payment request from the merchant. Credit card payments and MB WAY are examples of the described behaviour. On the credit card, the customer accepts the payment by providing his credit card details, while on MB WAY they accept by interacting with the push notification on the smartphone.
In a method with a push behaviour, the customer takes the initiative of sending the funds to the merchant. Virtual IBAN or Multibanco are examples of such behaviour. On the Virtual IBAN, the customer should go to their bank account and create a SEPA transfer to the provided IBAN. On Multibanco, the customer should go to an ATM and create a payment to the entity and reference provided.
A Credit / Debit card is a payment card issued to users (cardholders) to enable the cardholder to pay a merchant for a good or service. This is a synchronous pull payment method. This means that the payment happens immediately. Credit / Debit cards also support authorizations where you can hold an amount for later capture.
Apple Pay is a mobile payment and digital wallet service by Apple Inc. that allows users to make payments in iOS apps, and on the web using Safari. It is supported on the iPhone, Apple Watch, iPad, and Mac. Apple Pay is a synchronous pull payment method. This means that the payment happens immediately when the customer authorizes it using their Apple device. The merchant requests the payment, and the customer approves it on their device, which sends the payment to the merchant. Apple Pay does not require the customer to create any additional accounts or fill out an extensive form for each purchase. It utilizes the cards already on file in a user’s Apple Wallet. Apple Pay uses a method called tokenization to secure card information. Tokenization replaces the card number with a unique alphanumeric identifier, referred to as a token. The token is used for communication between the merchant, the bank, and Apple Pay, ensuring the actual card number is never shared with the merchant or transmitted with the payment.
Please note that Apple Pay is not available in all regions and is subject to the terms and conditions of the card issuer.
Google Pay is a mobile payment method that enables customers to pay using credit or debit cards stored in their Google Account. It is a synchronous pull payment method, meaning payments are processed immediately upon customer authorization. Google Pay primarily uses a tokenized solution for enhanced security, which most issuers accept as compliant with Strong Customer Authentication (SCA), eliminating the need for 3D-Secure (3DS) in many cases.
Fallback for Non-Tokenized Transactions: If a transaction isn’t tokenized or the issuer requires additional authentication, the system will automatically trigger the 3DS flow to ensure payment success.
Compatibility and Requirements: Google Pay is fully compatible with existing features like recurring payments and can be integrated seamlessly into websites and apps. It requires serving the payment page over HTTPS with a TLS domain-validated certificate for secure transactions.
Usage: This payment method supports transactions for physical goods, donations, subscriptions, and more. The integration process involves enabling Google Pay in your payment methods settings, with minimal code implementation required when using certain payment platforms.
Regions and Limitations: Google Pay's availability depends on the user's region. All merchants must adhere to the Google Pay APIs Acceptable Use Policy and accept the terms defined in the Google Pay API Terms of Service.
MB WAY is a Portuguese local method. To use MB WAY, the customer must have a Portuguese Banking account as well as a smartphone Bank/MB WAY app installed. This is a synchronous pull payment method. The Merchant will issue a payment request that will trigger a push notification on the customer application. MB WAY also supports authorizations where you can hold an amount for later capture.
Multibanco is a Portuguese local method. This is an asynchronous push payment method. The Merchant creates a payment request that will generate the Multibanco order details. The details include:
This payment method has some edge cases that you should be aware of, such as the ones below:
Direct Debit is an asynchronous pull payment method in which a merchant withdraws funds from the customer's bank account. To do so, the customer must accept a SEPA Direct Debit (SDD) Mandate, which can be valid for multiple payments (therefore supporting single, frequent and subscription payments). To create the SDD Mandate, the merchant must supply the customer's name and IBAN.
Depending on the customer's bank, confirmations of Direct Debit payments may take up to 14 days. Direct Debit is not recommended for single payments due to the risk of fraudulent customers issuing chargebacks.
Virtual IBAN is an asynchronous push payment method that follows the same principles of SEPA Bank Transfers: the merchant provides the customer with an IBAN and transfer amount that they should introduce in an ATM or homebanking system to specify the bank account to which funds are to be transferred.
In comparison with regular SEPA Transfers, Virtual IBAN has the benefit of protecting your bank account details by providing you with a virtual bank account number that supports single, frequent and subscription payments.
Although transfers to a single-use Virtual IBAN after the first payment are initially accepted by the customer's bank (and thus funds are temporarily withdrawn), they are automatically refunded by the IBAN issuer bank.
Universo Flex is a Portuguese local synchronous pull payment method similar to Credit Card, allowing the merchant to accept payments in 3 to 24 installments without having to be a credit intermediary.
Santander Consumer Finance is a Portuguese local asynchronous pull payment method where the customer applies for a loan to acquire the good or service in installments. The merchant does not need to be a credit intermediary.
Single payments are one-time transactions that will let your customers pay an amount of money to you. Examples may include a purchase of a good or service, or a donation. Every payment method supported by easypay allows single payments.
You can accept single payments entirely through our Checkout solution or by calling our Payments API.
Frequent payments are repeatable transactions of varying sums without the client having to enter their payment details again. The original details can be obtained (tokenized) through our Checkout solution, but each payment will have to be charged via the Payments API.
It is possible to limit the transferred sums by choosing minimum or maximum values, either to the total sum of the transactions or each individual transaction.
Supported methods for frequent payments are: Credit Card, MB WAY, Multibanco, Direct Debit, and Virtual IBAN.
Subscriptions are periodic payments of the same amount of money, configured through Checkout or our Payments API.
Subscriptions support a number of different frequencies, ranging from daily to once every three years. Their last payment can be determined by the end date of the subscription, as well as the total number of payments captured. They also support a configurable number of retries for each capture in case of failure, as well as falling back to another (single) payment method if the recurring one is not successful.
Supported methods for subscriptions are: Credit Card and Direct Debit.
Certain payment methods like credit card and MB WAY go through two distinct phases: authorisation and capture. Our integrations allow you to move through them separately (issuing a card authorisation first and later capturing the funds) or in a single step referred to in our APIs as sale
(authorisation followed by capture).
Authorisation is the first step of the process and involves guaranteeing that the buyer has sufficient funds or credit available to make the payment. If so, the funds are put on hold: the customer cannot use them to pay for other goods or services, but they're not yet transferred to the merchant's account. If the merchant fails to capture the funds in the following days, the hold is lifted.
Authorisations are useful to make sure customers have the means to purchase your product/service before actually charging them. You can issue the authorisation at the moment an order is placed and only actually transfer the funds when you ship the items or provide the service. Another interesting use case of authorisations is multi-captures.
A capture is the actual transfer of funds from the buyer to the merchant.
In many of our integrations, specifying sale
as the type of operation will automatically perform an authorisation and a capture, immediatelly transferring the funds from the customer to the merchant in a single step (if successful).
It is also possible to issue an authorisation for a value that will later be split among different captures. One example is a store supporting split payments for orders of multiple vendors. The full amount of the order is authorised but the different captures can be issued at different times, after each vendor confirms or ships the goods.
Single payments are one-time transactions that will let your customers pay an amount of money to you.
Examples may include a purchase of a good or service, or a donation.
Every payment method supported by easypay allows single payments.
When calling the API 2.0 in single, our system returns an entity and reference in the response JSON. When the payment is made by the customer, our system sends a Generic Notification with the Single ID. Upon receipt, your system should call the Single Details endpoint with the Single ID reported as successful in order to confirm it.
Upon successfully calling API 2.0 on a Single with type sale, our system will communicate to the end customer's MBWAY App. After the event of the customer accepting/declining the payment, our system sends a Generic Notification with the Single ID and a status (success or failed). Upon receipt of success, your system should call Single Details endpoint with the Single ID reported as successful in order to confirm it.
Only for Test Environment, we have these possible cases on phone:
911234567 - Authorized for all operationsBy successfully calling the API 2.0 in a Single with type sale, our system returns a URL in the response JSON for the client to be forwarded to our credit card gateway. The end customer must enter the card data. Our system validates the card in the VISA / MASTERCARD and sends a Generic Notification with the Single ID and a status (success or failed). Upon receipt of a success, your system should call the Single Details endpoint with the Single ID reported as successful in order to confirm it.
For Visa forward and Visa details configurations follow this link
Only for Test Environment, we have these possible credit card numbers:
0000000000000000 - Authorized for all operationsBy successfully calling the API 2.0 in a Single with type sale, our system returns a URL in the response JSON for the client to be forwarded to our credit card gateway. The end customer must enter the card data. Our system validates the card in the VISA / MASTERCARD and sends a Generic Notification with the Single ID and a status (success or failed). Upon receipt of a success, your system should call the Single Details endpoint with the Single ID reported as successful in order to confirm it.
Only for Test Environment, all valid iban will return success but this one: PT50000201231234567890154
When calling the API 2.0 in single, our system returns an IBAN in the response JSON. When the payment is made by the customer, our system sends a Generic Notification with the Single ID. Upon receipt, your system should call the Single Details endpoint with the Single ID reported as successful in order to confirm it.
By successfully calling the API 2.0 in a Single, our system returns a URL in the response JSON for the client to be forwarded to. The end customer must fullfill the journey in the Santander Consumer page. After the journey is completed with success, our system sends a Generic Notification with the Single ID. Upon receipt, your system should call the Single Details endpoint with the Single ID reported as successful in order to confirm it.
By successfully calling the API 2.0 in a Single with type sale, our system returns a URL in the response JSON for the client to be forwarded to. The end customer must fullfill the journey in the Universo Flex page. After the journey is completed with success or failure, our system sends a Generic Notification with the Single ID. Upon receipt, your system should call the Single Details endpoint with the Single ID reported as successful in order to confirm it.
For Visa forward and Visa details configurations follow this link
Full report with all the single payments from your Account
Success
Forbidden
Not found response
Pre condition failed
Unprocessable Entity
{- "meta": {
- "page": {
- "current": 0,
- "total": 0
}, - "records": {
- "total": 0,
- "per_page": 0
}, - "links": {
- "first": "string",
- "prev": "string",
- "next": "string",
- "last": "string"
}
}, - "data": [
- {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "type": "sale",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "descriptive": "Payment of Invoice Nº 1982652",
- "expiration_time": "2024-06-30 21:38:31",
- "customer": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "name": "Jonh Doe",
- "email": "user@example.com",
- "phone": "962496235",
- "phone_indicative": "351",
- "fiscal_number": "PT277712580",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "language": "PT"
}, - "method": {
- "type": "string",
- "status": "string",
- "sdd_mandate": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "iban": "PT50000747199140461443823",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "name": "string",
- "email": "string",
- "phone": "string",
- "account_holder": "string",
- "country_code": "string",
- "max_num_debits": "string",
- "billing_entity": "PT16103627"
}, - "card_type": "VISA",
- "last_four": "1234",
- "expiration_date": "string",
- "alias": "string",
- "entity": "11683",
- "reference": "665876931",
- "iban": "PT50000747199140461443823"
}, - "currency": "EUR",
- "value": 15.32,
- "created_at": "2024-06-30 21:38:31",
- "payment_status": "paid"
}
]
}
Creates a Single Payment
Configuration object to generate a single payment
Single created with success response
Bad Request
Forbidden
Pre condition failed
Unprocessable Entity
{- "customer": {
- "name": "Customer Example",
- "email": "customer@example.com",
- "phone": "911234567",
- "phone_indicative": "+351",
- "key": "customer Key Example"
}, - "key": "merchant identification key Example",
- "value": 15.5,
- "method": "mb",
- "capture": {
- "descriptive": "transaction descriptive Example",
- "transaction_key": "transaction key Example"
}
}
{- "status": "ok",
- "message": [
- "Your request was successfully created"
], - "id": "ed7f8dac-0ea2-4846-8433-f5f8b0e70ed7",
- "method": {
- "type": "dd",
- "status": "pending",
- "entity": "21098",
- "reference": "503564027",
- "sdd_mandate": {
- "id": "50356402710",
- "billing_entity": "PT16103627",
- "iban": "PT50002700000001234567833",
- "key": "sdd mandate key",
- "name": "Name Example",
- "email": "customer@example.com",
- "phone": "912997715",
- "account_holder": "Account Name Example",
- "country_code": "PT",
- "max_num_debits": "1",
- "reference_adc": "50356402710"
}
}, - "customer": {
- "id": "2544ce48-ccec-465e-9722-d42ccf0aa640"
}, - "capture": {
- "id": "c6101a8b-b8c6-44a7-b128-bef8888e14d7"
}
}
Retrive a single payment details
Success
Forbidden
Not found response
Unprocessable Entity
{- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "created_at": "string",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "capture": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "status": "delayed",
- "descriptive": "Payment of Invoice Nº 1982652",
- "transaction_key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "capture_date": "2019-08-24",
- "account": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb"
}, - "splits": [
- {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "split_key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "split_descriptive": "Payment of Invoice Nº 1982652",
- "account": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb"
}, - "value": 15.32,
- "clearing_date": "2019-08-24",
- "clearing_period": "7D",
- "margin_account": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb"
}, - "margin_value": 0,
- "status": "waiting",
- "reverts": [
- {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "value": 15.32,
- "margin_value": 0
}
]
}
]
}, - "descriptive": "Payment of Invoice Nº 1982652",
- "value": 15.32,
- "expiration_time": "string",
- "currency": "EUR",
- "customer": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "name": "Jonh Doe",
- "email": "user@example.com",
- "phone": "962496235",
- "phone_indicative": "351",
- "fiscal_number": "PT277712580",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "language": "PT"
}, - "method": {
- "type": "string",
- "status": "string",
- "sdd_mandate": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "iban": "PT50000747199140461443823",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "name": "string",
- "email": "string",
- "phone": "string",
- "account_holder": "string",
- "country_code": "string",
- "max_num_debits": "string",
- "billing_entity": "PT16103627"
}, - "card_type": "VISA",
- "last_four": "1234",
- "expiration_date": "string",
- "alias": "string",
- "entity": "11683",
- "reference": "665876931",
- "iban": "PT50000747199140461443823"
}, - "paid_at": "string"
}
This endpoint allows for the deletion of a single payment identified by its unique ID. The DELETE operation performs the following actions based on the payment method:
This operation ensures that all associated authorizations and references are properly handled and terminated according to the specified payment method.
No content
Bad Request
Forbidden
Not found response
Unprocessable Entity
{- "status": "error",
- "message": [
- "The field value is required"
]
}
Apply partial modifications to a single payment resource.
Success
Bad Request
Forbidden
Not found response
Unprocessable Entity
{- "expiration_time": "string",
- "currency": "EUR",
- "customer": {
- "name": "Jonh Doe",
- "email": "user@example.com",
- "phone": "962496235",
- "phone_indicative": "351",
- "fiscal_number": "PT277712580",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "language": "PT"
}, - "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "sdd_mandate": {
- "iban": "PT50000747199140461443823",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "name": "string",
- "email": "string",
- "phone": "string",
- "account_holder": "string",
- "country_code": "string",
- "max_num_debits": "string",
- "billing_entity": "PT16103627"
}
}
{- "status": "ok",
- "message": [
- "Your request was successfully created"
], - "id": "d4851c0a-66e2-4b34-9587-1e453ddcc650",
- "method": {
- "type": "CC",
- "status": "pending",
}, - "customer": {
- "id": "156de567-b17d-4591-a154-442c873b76c7"
}
}
Payments used on frequent services with amounts and periodicity changes
After one Frequent MB request our system will return an entity and a reference in the JSON response. The customer can always pay between the min and max values several times before the expiration date or when the method Deletes Frequent is called with success. If the parameter unlimited_payments is active transactions will be unlimited, entity and reference is reseted on our provider 3 times a day, otherwise the total value of payments can’t exceed the max defined. For each payment made with this entity and reference, our system sends a Generic Notification with the Frequent ID.
After successfully calling the API 2.0 on a Frequent MBW you can capture funds through the Frequent ID on a Capture call, our system will communicate to the end customer's MBWAY App. If the final customer accepts / rejects payment, the system sends a Generic Notification with the Capture ID and a status (success or failed). Upon successful receipt, the system should call the Frequent Details endpoint with the Frequent ID reported as successful in order to confirm it.
Only for Test Environment, we have these possible cases on phone:
911234567 - Authorized for all operationsWhen calling the API 2.0 successfully on a Frequent CC, the system returns a URL in JSON for the client to be forwarded to our credit card gateway. The end customer must enter the card data. The system validates the card in the VISA / MASTERCARD and notifies Generic Notification with the Frequent ID and a status (success or failed). Upon successful receipt, the system should call the Frequent Details endpoint with the Frequent ID reported as successful. From a successful communication, you can capture funds using the Frequent ID in a Capture call. The system will capture the funds from the card and sends a Generic Notification with the Capture ID and a status (success or failed). Upon successful receipt, the system should call the Frequent Details endpoint with the Frequent ID reported as successful.
For Visa forward and Visa details configurations follow this link.
When calling API 2.0 successfully on a Frequent DD, the system returns in JSON including the SEPA Direct Debit Mandate ID and an additional entity/reference for additional payments. From now on funds can be captured through the Frequent ID using the Capture endpoint, these funds can take up to 48 business hours to obtain a SEPA direct debit response. When responding, the system notifies with Generic Notification with the Capture ID and a status (success or failed). Upon successful receipt, the system should call the Frequent Details endpoint with the Frequent ID reported as successful.
Full report with all the frequent payments from your Account Id
Success
Forbidden
Too Many Requests
Internal Error
{- "meta": {
- "page": {
- "current": 1,
- "total": 2335
}, - "records": {
- "total": 4669,
- "per_page": 2
}, - "links": {
- "first": "?page=1",
- "prev": "",
- "next": "?page=2",
- "last": "?page=2335"
}
}, - "data": [
- {
- "id": "ab2f2eb6-3655-4951-98ae-36367d5f3727",
- "key": "Default Key",
- "expiration_time": "2022-12-12T16:05:00Z",
- "value": 10,
- "customer": {
- "id": "06300032-5cbd-4393-b73d-9f4c9875270a",
- "name": "***",
- "email": "ema***@example.com",
- "phone": "***",
- "fiscal_number": "***",
- "key": "Customer key",
- "language": "PT"
}, - "method": {
- "type": "cc",
- "status": "waiting",
}, - "currency": "EUR",
- "max_value": 20.55,
- "min_value": 2.32,
- "unlimited_payments": false,
- "created_at": "2022-11-23 12:03:29"
}, - {
- "id": "f15cee45-d5a5-469d-8cb2-79a6dcba977f",
- "key": "Default Key",
- "expiration_time": "2022-12-12T16:05:00Z",
- "value": 10,
- "customer": {
- "id": "48307582-91bc-4e15-a9f6-84633fbdd2c7",
- "name": "***",
- "email": "ema***@example.com",
- "phone": "***",
- "fiscal_number": "***",
- "key": "Customer key",
- "language": "PT"
}, - "method": {
- "type": "dd",
- "status": "active",
- "sdd_mandate": {
- "id": "50124502381",
- "billing_entity": "PT16103627",
- "iban": "PT500027**XX7833",
- "key": "Sdd Mandate key",
- "name": "Fre*** DD***",
- "email": "cus***@example.com",
- "phone": "911***567",
- "account_holder": "Acc*** Exa***",
- "country_code": "PT",
- "max_num_debits": "0"
}
}, - "currency": "EUR",
- "max_value": 20.55,
- "min_value": 2.32,
- "unlimited_payments": false,
- "created_at": "2022-11-23 11:56:35"
}
]
}
Frequent payments are repeatable transactions of varying sums without the client having to enter their payment details again.
It is possible to limit the transferred sums by choosing minimum or maximum values, either to the total sum of the transactions or each individual transaction.
Supported methods for frequent payments are: Credit Card, MB WAY, Multibanco, Direct Debit and Virtual IBAN
Success
Bad Request
Forbidden
Pre condition failed
Too Many Requests
Internal Error
{- "expiration_time": "2038-12-12 16:05",
- "currency": "EUR",
- "customer": {
- "name": "Customer Example",
- "email": "customer@example.com",
- "phone": "911234567",
- "phone_indicative": "351",
- "fiscal_number": "PT123456789",
- "key": "Key Example",
- "language": "PT"
}, - "key": "Key Example",
- "max_value": 25.5,
- "min_value": 10,
- "unlimited_payments": true,
- "method": "dd",
- "sdd_mandate": {
- "id": "12345678901",
- "iban": "PT50002700000001234567833",
- "key": "Key Example",
- "name": "Name Example",
- "email": "customer@example.com",
- "phone": "911234567",
- "account_holder": "Acount Name Example",
- "country_code": "PT",
- "max_num_debits": "12"
}
}
{- "status": "ok",
- "message": [
- "Your request was successfully created"
], - "id": "cd90455e-4ab3-42cf-a91c-cfc6e3afa65a",
- "method": {
- "type": "cc",
- "status": "waiting",
}, - "customer": {
- "id": "68d07e52-3e04-493f-aaeb-bffe7ddb81ee"
}
}
Retrieve a Frequent Payment details
Success
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "id": "ac1913a3-fd78-4822-8394-0a14f4169247",
- "key": "Default Key",
- "expiration_time": "2022-12-12T16:05:00Z",
- "customer": {
- "id": "fdc4bc82-8e45-4597-b46d-51d3285cf935",
- "name": "Robert Stuart",
- "email": "email@example.com",
- "phone": "911234567",
- "key": "Customer key",
- "language": "PT"
}, - "method": {
- "type": "cc",
- "status": "active",
- "last_four": "0000",
- "card_type": "VISA",
- "expiration_date": "04/25"
}, - "currency": "EUR",
- "max_value": 20,
- "min_value": 2,
- "unlimited_payments": false,
- "created_at": "2022-11-23 13:16:58"
}
3 times a day (10am, 3pm and 10pm) our system will attempt to close your deleted MB payments.
All CC and MBW authorisations will be deleted, releasing the funds.
All MBW operations waiting for user interaction will be cancelled.
Before 6pm all Sepa Direct Debits waiting for file processing will be cancelled.
No content
Bad Request
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "status": "error",
- "message": [
- "Custom error message"
]
}
Frequent Payment object to edit existing one
Success
Bad Request
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "status": "active",
- "expiration_time": "2017-12-12 16:05",
- "currency": "EUR",
- "customer": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "name": "Jonh Doe",
- "email": "user@example.com",
- "phone": "962496235",
- "phone_indicative": "351",
- "fiscal_number": "PT277712580",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "language": "PT"
}, - "key": "Key Example",
- "max_value": 25.5,
- "min_value": 10,
- "unlimited_payments": true,
- "sdd_mandate": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "iban": "PT50000747199140461443823",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "name": "string",
- "email": "string",
- "phone": "string",
- "account_holder": "string",
- "country_code": "string",
- "max_num_debits": "string",
- "billing_entity": "PT16103627"
}
}
{- "method": {
- "type": "dd",
- "sdd_mandate": {
- "id": "12345678901",
- "iban": "PT50002700000001234567833",
- "key": "Key Example",
- "name": "Name Example",
- "email": "customer@example.com",
- "phone": "911234567",
- "account_holder": "Acount Name Example",
- "country_code": "PT",
- "max_num_debits": "12",
- "reference_adc": "987654321123"
}
}, - "status": "ok",
- "message": [
- "Your request was successfully created"
]
}
Full report with all the subscriptions payments from your Account Id
Success
Forbidden
Too Many Requests
Internal Error
{- "meta": {
- "page": {
- "current": 1,
- "total": 827
}, - "records": {
- "total": 1654,
- "per_page": 2
}, - "links": {
- "first": "?page=1",
- "prev": "",
- "next": "?page=2",
- "last": "?page=827"
}
}, - "data": [
- {
- "id": "7a3b9c3b-8bc8-4aa9-b67b-43b7a8e0377f",
- "key": "Default Key",
- "expiration_time": "2022-12-04T12:00:00Z",
- "start_time": "2022-12-04T12:00:00Z",
- "frequency": "1Y",
- "retries": 2,
- "max_captures": 2,
- "failover": false,
- "capture_now": false,
- "customer": {
- "id": "93a0b7e4-d0ae-4da2-bdcf-c9a735e44a9a",
- "name": "***",
- "email": "cus***@example.com",
- "phone": "***",
- "fiscal_number": "***",
- "key": "Customer Key",
- "language": "PT"
}, - "method": {
- "type": "DD",
- "status": "active",
- "sdd_mandate": {
- "id": "50124440050",
- "billing_entity": "PT16103627",
- "iban": "PT500027**XX7833",
- "key": "Sdd Mandate key",
- "name": "Fre*** DD***",
- "email": "cus***@example.com",
- "phone": "911***567",
- "account_holder": "Acc*** Exa***",
- "country_code": "PT",
- "max_num_debits": "0"
}
}, - "currency": "EUR",
- "value": 17.5,
- "created_at": "2022-11-22 15:29:54"
}, - {
- "id": "2e41fc8e-76ee-4533-a296-809c7bfbc811",
- "key": "",
- "expiration_time": "",
- "start_time": "2022-12-04T12:00:00Z",
- "frequency": "1Y",
- "retries": 0,
- "max_captures": 2,
- "failover": false,
- "capture_now": false,
- "customer": {
- "id": "33058cb5-ca1e-4314-b4ae-c6a86b218157",
- "language": ""
}, - "method": {
- "type": "CC",
- "status": "deleted",
}, - "currency": "EUR",
- "value": 17.5,
- "created_at": "2022-11-22 15:19:51"
}
]
}
Subscriptions are periodic payments of the same amount of money, configured through Checkout or our Payments API.
Subscriptions support a number of different frequencies, ranging from daily to once every three years. Their last payment can be determined by the end date of the subscription, as well as the total number of payments captured.
They also support a configurable number of retries for each capture in case of failure, as well as falling back to another (single) payment method if the recurring one is not successful.
Supported methods for subscriptions are: Credit Card and Direct Debit.
Payment configuration object to generate a payment
Success
Bad Request
Forbidden
Too Many Requests
Internal Error
{- "expiration_time": "2022-12-04 12:00",
- "max_captures": 2,
- "start_time": "2022-12-04 12:00",
- "value": 17.55,
- "frequency": "1D",
- "method": "cc"
}
{- "status": "ok",
- "message": [
- "Your request was successfully created"
], - "id": "b3dd33b8-ace7-4239-89ef-c9bdf4fdb14b",
- "method": {
- "type": "CC",
- "status": "waiting",
}, - "customer": {
- "id": "f80e90fb-9cc5-40c2-832f-0497a2092f82"
}
}
Success
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "id": "7a3b9c3b-8bc8-4aa9-b67b-43b7a8e0377f",
- "key": "Default Key",
- "expiration_time": "2022-12-04T12:00:00Z",
- "start_time": "2022-12-04T12:00:00Z",
- "frequency": "1Y",
- "retries": 2,
- "max_captures": 2,
- "failover": false,
- "capture_now": false,
- "customer": {
- "id": "93a0b7e4-d0ae-4da2-bdcf-c9a735e44a9a",
- "email": "customer@example.com",
- "key": "Customer Key",
- "language": "PT"
}, - "method": {
- "type": "DD",
- "status": "active",
- "sdd_mandate": {
- "id": "50124440050",
- "billing_entity": "PT16103627",
- "iban": "PT50002700XXXXXXXXXXX7833",
- "key": "Sdd Mandate key",
- "name": "Frequent Payment DD",
- "email": "customer@example.com",
- "phone": "911234567",
- "account_holder": "Account Name Example",
- "country_code": "PT",
- "max_num_debits": "0"
}
}, - "currency": "EUR",
- "value": 17.5,
- "created_at": "2022-11-22 15:29:54"
}
No content
Bad Request
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "status": "error",
- "message": [
- "Custom error message"
]
}
Retrieves the subscription payment details.
Subscription Payment object to edit existing one
Success
Bad Request
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "status": "active",
- "capture": {
- "transaction_key": "string",
- "account": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}, - "descriptive": "string"
}, - "expiration_time": "2017-12-12 16:05",
- "currency": "EUR",
- "customer": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "email": "string",
- "phone": "string",
- "phone_indicative": "+351",
- "fiscal_number": "PT123456789",
- "key": "Example Key",
- "language": "PT"
}, - "key": "Example Key",
- "value": 12.55,
- "frequency": "1W",
- "max_captures": 0,
- "start_time": "2017-12-12 16:05",
- "failover": false,
- "retries": 0,
- "sdd_mandate": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "iban": "PT50000747199140461443823",
- "key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "name": "string",
- "email": "string",
- "phone": "string",
- "account_holder": "string",
- "country_code": "string",
- "max_num_debits": "string",
- "billing_entity": "PT16103627"
}
}
{- "status": "ok",
- "message": [
- "Your request was successfully created"
], - "id": "63f3f5a0-1543-4ed7-9b44-7f0f802ff476",
- "method": {
- "type": "dd",
- "status": "inactive"
}, - "customer": {
- "id": "d927731a-8684-4aa9-bc50-f691d666c117"
}
}
These operations can be used on all our payment types: single, frequent and subscription
Example response
Bad Request
Forbidden
Not found response
Pre condition failed
Unprocessable Entity
{- "metadata": {
- "next_cursor": "lL_j7ilk7rc",
- "count": 10
}, - "data": [
- {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "status": "delayed",
- "descriptive": "Payment of Invoice Nº 1982652",
- "transaction_key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "capture_date": "2019-08-24",
- "account": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb"
}, - "splits": [
- {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "split_key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "split_descriptive": "Payment of Invoice Nº 1982652",
- "account": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb"
}, - "value": 15.32,
- "clearing_date": "2019-08-24",
- "clearing_period": "7D",
- "margin_account": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb"
}, - "margin_value": 0,
- "status": "waiting",
- "reverts": [
- {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "value": 15.32,
- "margin_value": 0
}
]
}
], - "payment_id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "payment_type": "single",
- "value": 15.32,
- "force_3ds": true,
- "created_at": "2006-01-02 15:04",
- "updated_at": "2006-01-02 15:04"
}
]
}
Example response
Bad Request
Forbidden
Not found response
Unprocessable Entity
{- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "status": "delayed",
- "descriptive": "Payment of Invoice Nº 1982652",
- "transaction_key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "capture_date": "2019-08-24",
- "account": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb"
}, - "splits": [
- {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "split_key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "split_descriptive": "Payment of Invoice Nº 1982652",
- "account": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb"
}, - "value": 15.32,
- "clearing_date": "2019-08-24",
- "clearing_period": "7D",
- "margin_account": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb"
}, - "margin_value": 0,
- "status": "waiting",
- "reverts": [
- {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "value": 15.32,
- "margin_value": 0
}
]
}
], - "payment_id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "payment_type": "single",
- "value": 15.32,
- "force_3ds": true,
- "created_at": "2006-01-02 15:04",
- "updated_at": "2006-01-02 15:04",
- "refunds": [
- {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "status": "success",
- "transaction_key": "01J1PKR2RPHJNJQGFWGDYXY0KM",
- "value": 15.32,
- "iban": "string",
- "email": "string",
- "phone": "string",
- "account_holder": "string"
}
]
}
Payment configuration object to generate a payment
Success
Bad Request
Forbidden
Precondition Failed
Unprocessable Entity
Precondition Required
Too Many Requests
Internal Error
{- "transaction_key": "key example",
- "capture_date": "2022-11-11",
- "account": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}, - "splits": [
- {
- "split_key": "example key",
- "split_descriptive": "string",
- "value": 0.01,
- "account": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}, - "margin_value": 0.01,
- "margin_account": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
}
], - "mbway_sdk": {
- "purchase_token": "626E6AA2224D017917D839D4D39296B49441A1D10DA7E8DB6E7E1A4356DDE75429531BEB32190C6D736FA12C7A116CA5F3FCAEE72570406F51371A0CB6E14B6B",
- "initial_timestamp": "2018-01-01 23:59:59",
- "merchant_operation_id": "TESTACCOUNT5436",
- "payload": "{'purchase_token':'EDEB342D3588DDDEEE3E070476E72A6B222E3456C1C825D3E89A734005CE81F69986045424984F55B3233CBFD090A8A564071BBB493F34C4849C964','initial_timestamp':'2018-09-20T10:46:08+01:00','merchant_operation_id':'TESTACCOUNT5436','payload':{'amount':1000,'currencyCode':'9782'}}"
}, - "force_3ds": false,
- "descriptive": "string",
- "value": 20.55
}
{- "status": "ok",
- "message": [
- "Your request was successfully created"
], - "id": "522b83f3-cd98-48ee-8e40-9a94d6b79eb1"
}
Payment configuration object to generate a payment
Success
Bad Request
Forbidden
Precondition Failed
Precondition Required
Too Many Requests
Internal Error
{- "clearing_date": "2006-01-02"
}
{- "status": "ok",
- "message": [
- "Your request was successfully created"
]
}
Success
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "status": "success",
- "id": "9ef96025-47e3-4007-b1a4-b6915099668b",
- "transaction_key": "example_key",
- "descriptive": "Descriptive Example",
- "authorisation": {
- "id": "848cb022-bc78-44e0-9b97-5d7b810a637a",
- "status": "success",
- "message": "Sucesso: Operação concluída com sucesso.",
- "key": "Robertos Key",
- "customer": {
- "id": "aaaa3891-a0f1-4589-a417-56ca595815e0",
- "name": "Alucard",
- "email": "roberto@example.com",
- "phone": "911234567",
- "language": "PT"
}, - "method": {
- "type": "MBW",
- "status": "active"
}, - "currency": "EUR",
- "value": 200
}
}
Void details
Success
Bad Request
Forbidden
Precondition Failed
Too Many Requests
Internal Error
{- "descriptive": "descriptive_example",
- "transaction_key": "key_example"
}
{- "status": "ok",
- "message": [
- "Your request was successfully created"
], - "id": "9ef96025-47e3-4007-b1a4-b6915099668b"
}
Cursor based endpoint to retrieve all account refunds.
The ListRefunds endpoint retrieves a paginated list of refund transactions processed within the system.
{- "data": [
- {
- "id": "03ec73bc-4b70-49ab-9f3a-1f0c0119d7bf",
- "status": "success",
- "transaction_key": "internal key identifying this refund",
- "value": 10,
- "account_holder": "Account Name Example",
- "email": "customer@example.com",
- "phone": "911234567",
- "iban": "PT50002700000001234567833",
- "created_at": "2024-09-19 09:05:42",
- "updated_at": "2024-09-19 09:06:42",
- "capture": {
- "id": "f2387117-0d06-4929-b78a-3c9b8d37cd44",
- "payment_id": "f2387117-0d06-4929-b78a-3c9b8d37cd44",
- "payment_type": "frequent"
}
}, - {
- "id": "aa3f2a0f-4013-4b7e-aad1-a4c443a2affc",
- "status": "success",
- "transaction_key": "internal key identifying this refund",
- "value": 10,
- "account_holder": "Account Name Example",
- "email": "customer@example.com",
- "phone": "911234567",
- "iban": "PT50002700000001234567833",
- "created_at": "2024-09-19 08:59:42",
- "updated_at": "2024-09-19 09:00:02",
- "capture": {
- "id": "92abad40-fc76-4054-9020-a991a0ee5588",
- "payment_id": "92abad40-fc76-4054-9020-a991a0ee5588",
- "payment_type": "frequent"
}
}
], - "metadata": {
- "next_cursor": "Yxk8mepPg2eMyJNj",
- "count": 2
}
}
Success
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "id": "4db3d9ab-f4c0-41a6-a80e-6cbbdd1508f4",
- "status": "success",
- "transaction_key": "internal key identifying this refund",
- "value": 50,
- "account_holder": "Account Name Example",
- "email": "customer@example.com",
- "phone": "911234567",
- "iban": "PT50002700000001234567833",
- "capture": {
- "transaction_key": "string",
- "capture_date": "string",
- "account": {
- "id": "22ea3cc9-424b-489a-91b7-8955f643dc93"
}, - "status": "success",
- "splits": [
- {
- "split_key": "string",
- "split_descriptive": "Descriptive Example",
- "value": 1,
- "account": {
- "id": "22ea3cc9-424b-489a-91b7-8955f643dc93"
}, - "margin_value": 0.1,
- "margin_account": {
- "id": "22ea3cc9-424b-489a-91b7-8955f643dc93"
}
}
], - "payment_type": "single",
- "payment_id": "bfd3518d-fe73-4fb8-b8e6-0ce38cd3ced8",
- "id": "4c67e74b-a256-4e0a-965d-97bf5d01bd50",
- "descriptive": "Descriptive Example",
- "value": 17.5
}
}
Refund details
Success
Bad Request
Forbidden
Precondition Failed
Unprocessable Entity
Too Many Requests
Internal Error
{- "transaction_key": "string",
- "value": 17.5
}
{- "status": "ok",
- "message": [
- "Your request was successfully created"
], - "id": "5e2fee01-71e8-47e1-896a-3e2153222afd"
}
This endpoint retrieves a list of chargebacks associated with your account. A Chargeback is a mandatory transaction reversal initiated by the consumer's card issuer or bank, usually due to a dispute over a transaction. When a chargeback occurs, the costumer effectively reverses the transaction, resulting in a debit of the disputed amount from the merchant's account. This endpoint allows you to view details of chargebacks, including the reason for the dispute, transaction amount, and status, providing insights into consumer disputes and their impact on your financials.
Success
Forbidden
Pre condition failed
Unprocessable Entity
{- "data": [
- {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "created_at": "2006-01-02 15:04",
- "message": "MD06 - Refund Request by End Customer",
- "code": "MD06",
- "amount": 15.32,
- "capture": {
- "id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "payment_id": "c6056234-a3f9-42de-b944-3ed793fcb6bb",
- "payment_type": "single"
}
}
], - "metadata": {
- "next_cursor": "lL_j7ilk7rc",
- "count": 10
}
}
Easypay use notifications (webhooks) for event notifications.
Notifications are POST API calls (JSON encoded) that let your application know an event has happened.
This is a server-to-server service that sends near real-time notifications, informing about a payment status change.
Notifications are particularly useful for asynchronous events like:
With notifications your system can automate custom actions in response to the transitions that happen in a payment flow.
Easypay supports 3 notification types:
As an example, if you subscribe to Generic and Authorisation notifications, we will inform you about the payment status transition to authorized in two different formats and you will receive two notifications for the same event.
What varies in these two notifications, for the same event, is the contract of the notification message.
All transitions that happen in a payment flow are notified via generic notification.
The notification flow follows the following diagram:
The generic notification message contains the following fields:
{
"id": "5eca7446-14e9-47bb-aabb-5ee237159b8b",
"key": "dcf9ab3fd95ca3d5607853f36d46f161c8715858",
"type": "capture",
"status": "success",
"messages": ["Your request was successfully captured"],
"date": "2022-08-10 14:56:54"
}
Name | Type | Description |
---|---|---|
type | string | the type of payment status change. |
status | string | the status of the given payment status change. |
messages | string | messages associated with this payment status change. |
date | string | the expiration associated with this single or frequent payment. Follows the format |
In a generic notification, the fields id
and key
will change according to the payment type and operation.
The following table describes the possible combinations:
Payment Type | Name | Type | Description |
---|---|---|---|
Single Authorisation | id key |
string string |
the id of the single payment.the field key given to create single request payload. |
Single Capture | id key |
string string |
the id of the single payment.the field transaction_key given to capturing single payload. |
Single Sale | id key |
string string |
the id of the single payment. the field transaction_key , inside of object capture , given to create single request payload. |
Frequent Create | id key |
string string |
the id of the frequent payment.the field key given to create frequent request payload. |
Frequent Authorization | id key |
string string |
the id of the frequent payment.the field transaction_key given to authorisation frequent request payload. |
Frequent Capture | id key |
string string |
the id of the capture operation. the field transaction_key given to capture frequent request payload. |
Refund Single/Frequent Capture | id key |
string string |
the id of the refund.the field transaction_key given to refund capture request payload. |
Void Single/Frequent Authorisation | id key |
string string |
the id of the void.the field transaction_key given to void authorisation request payload. |
Subcription Create | id key |
string string |
the id of the subscription.the field key given to create subscription request payload. |
Subcription Capture | id key |
string string |
the id of the subscription.the field transaction_key inside of object capture , given to create subscription request payload. |
Chargeback Single | id key |
string string |
the id of the single.the field transaction_key given to create frequent request payload. |
Chargeback Frequent | id key |
string string |
the id of the capture operation.the field transaction_key given to capture frequent request payload. |
Outpayment | id key |
string string |
the id of the outpayment operation.the field key given to create outpayment request payload. |
The delivered authorisation notification message contains the following fields:
{
"id": "1bbc14c3-8ca8-492c-887d-1ca86400e4fa",
"value": 1,
"currency": "EUR",
"key": "the merchant key",
"expiration_time": "2022-01-01 10:20",
"customer": {
"id": "22ea3cc9-424b-489a-91b7-8955f643dc93",
"name": "Customer Example",
"email": "customer@example.com",
"phone": "911234567",
"phone_indicative": "+351",
"fiscal_number": "PT123456789",
"key": "Key Example",
"language": "PT"
},
"method": "mb",
"account": {
"id": "4c67e74b-a256-4e0a-965d-97bf5d01bd50"
},
"authorisation": {
"id": "4c67e74b-a256-4e0a-965d-97bf5d01bd50"
}
}
Name | Type | Description |
---|---|---|
id | string | the uuid of a single or frequent payment |
value | double | the amount requested on single/frequent creation. Rounded to 2 decimals. |
key | string | the merchant identification key provided on a single or frequent payment request |
expiration_time | string | the expiration associated with this single or frequent payment. Follows the format |
customer | object | the customer associated at single or frequent payment request |
method | string | the choosen payment method associated with single or frequent payment |
account | object | the account from which this notification was originated |
authorization | object | the authorization details. |
The transaction notification message contains the following fields:
{
"id": "87615356-0a88-42bd-8abb-aab3e90128de",
"value": "40",
"currency": "EUR",
"key": "the merchant key",
"expiration_time": "2023-08-07 20:00",
"method": "MBW",
"customer": {
"id": "2eb64a7f-90a7-4dc6-959b-1d9aba44910c",
"phone": "910410419"
},
"account": {
"id": "0b8de6e7-89c8-4d76-93e8-019bc058f27d"
},
"transaction": {
"id": "eb23923b-3529-4b71-b54e-1e707a8d55c4",
"key": "transaction_key_of_this_capture",
"type": "capture",
"date": "2022-08-10T12:45:50Z",
"values": {
"requested": "40",
"paid": "40",
"fixed_fee": "0",
"variable_fee": "0",
"tax": "0",
"transfer": "0"
}
}
}
Name | Type | Description |
---|---|---|
id | string | the uuid of a single or frequent payment |
value | double | the amount requested on single/frequent creation. Rounded to 2 decimals. |
currency | string | the currency of requested amount requested on single/frequent creation. |
key | string | the merchant identification key provided on a single or frequent payment request. |
expiration_time | string | the expiration associated with this single or frequent payment. Follows the format |
method | string | the choosen payment method associated with single or frequent payment. |
customer | object | the customer associated at single or frequent payment request. |
account | object | the account from which this notification was originated. |
transaction | object | the details of this transaction. |
On Easypay backoffice, navigate to Web Services > Configuration API 2.0
.
Select the payment account you want to receive notifications.
Select Notifications
.
To receive generic notifications, place your system url on Generic - URL
.
To receive authorisation notifications, place your system url on Authorisation - URL
.
To receive capture notifications, place your system url on Payment - URL
.
On Easypay backoffice, navigate to Web Services > Notifications API 2.0
.
There, you can select the payment account whose notifications you are interested in.
We will send you this json in our notifications
Notification Payload
Return a 200 status to indicate that the data was received successfully
{- "id": "1bbc14c3-8ca8-492c-887d-1ca86400e4fa",
- "key": "Example Key",
- "type": "capture",
- "status": "success",
- "messages": [
- "Your request was successfully created"
], - "date": "2022-01-01 10:20:30"
}
We will send you this json in our notification
Notification Payload
object | |
object |
Return a 200 status to indicate that the data was received successfully
{- "account": {
- "id": "4c67e74b-a256-4e0a-965d-97bf5d01bd50"
}, - "authorisation": {
- "id": "4c67e74b-a256-4e0a-965d-97bf5d01bd50"
}
}
We will send you this json in our notification
Notification Payload
object |
Return a 200 status to indicate that the data was received successfully
{- "account": {
- "id": "4c67e74b-a256-4e0a-965d-97bf5d01bd50"
}
}
The /reports/ledger endpoint provides access to detailed reports of ledger entries within the Easypay reconciliation system. This endpoint retrieves comprehensive financial data for each transaction recorded in the ledger, including captures, refunds, fees, and other financial operations, and it was designed to help users generate precise and relevant financial reports, aiding in effective account reconciliation and financial management.
By using this endpoint, clients can obtain an itemized list of all ledger entries, including relevant financial details such as transaction amounts, fees, taxes, and net transferred amounts. The data returned by this endpoint is ideal for accounting, auditing, and financial analysis purposes, as it ensures transparency and accuracy in financial reporting.
Forbidden
Precondition Failed
Internal Error
{- "metadata": {
- "next_cursor": "lL_j7ilk7rc",
- "count": 10
}, - "data": [
- {
- "id": "dc0f1e47-4510-4058-8119-31b8f80b5a02",
- "created_at": "2019-08-24T14:15:22Z",
- "transaction_timestamp": "2019-08-24T14:15:22Z",
- "transaction_type": "CP",
- "amount_details": {
- "requested_amount": {
- "amount": "13.5",
- "currency": "EUR"
}, - "payed_amount": {
- "amount": "13.5",
- "currency": "EUR"
}, - "fixed_fee": {
- "amount": "0.07",
- "currency": "EUR"
}, - "variable_fee": {
- "amount": "0.1",
- "currency": "EUR"
}, - "tax_amount": {
- "amount": "0.04",
- "currency": "EUR"
}, - "transfered_amount": {
- "amount": "13.29",
- "currency": "EUR"
}
}, - "transfer_batch_date": "2019-08-24",
- "transfer_batch": "string",
- "descriptive": "some descriptive",
- "details": {
- "operation_id": "79921588-12fb-44c8-87c2-207362a8e467",
- "operation_key": "transaction key associated with operation",
- "method": "MBW",
- "payment_id": "1717d252-7a25-43e9-a272-f1ae07a0f2d7",
- "payment_type": "single",
- "payment_key": "Merchant identification key associated with payment"
}
}
]
}
List your transactions
Success
Forbidden
Precondition Failed
Internal Error
curl -XGET -H "AccountId: 5fe2e102-dfee-4880-bd87-1d9a6ec6fdd2" -H "ApiKey: b0ea270d-9f50-4bbc-af58-44fed3df4b2b" \ -G --data-urlencode "start_date=2019-01-07 15:10" --data-urlencode "end_date=2019-02-05 15:14" --data-urlencode "page=1" --data-urlencode "records_per_page=10" \ https://api.prod.easypay.pt/2.0/report/transactions
{- "meta": {
- "page": {
- "current": 1,
- "total": 47
}, - "records": {
- "total": 231,
- "per_page": 5
}, - "links": {
- "first": "?page=1",
- "prev": "",
- "next": "?page=2",
- "last": "?page=47"
}
}, - "data": [
- {
- "id": "b41921f1-a255-41bc-9e92-9a28d266d378",
- "key": "Merchant identification key",
- "date": "2022-11-16T16:45:19Z",
- "values": {
- "requested": 44,
- "paid": 44,
- "fixed_fee": 0.25,
- "variable_fee": 0.66,
- "tax": 1.5,
- "transfer": 42.88
}, - "transfer_date": "2022-11-21T00:00:00Z",
- "transfer_batch": "",
- "method": "DD",
- "document_number": "MARCEL0208220452011220221116164519",
- "payment_type": "single",
- "payment_id": "2a9112fe-6510-4366-b55e-24a3ae188d67",
- "payment_account": {
- "id": "76f190b9-2b8a-4bd0-9490-411241a9dc81"
}, - "payment_key": "Merchant identification key",
- "payment_transaction_key": "Merchant identification key",
- "descriptive": "Descriptive Josefa"
}, - {
- "id": "b3fad7da-69bf-4320-b3ad-ccfaecaf8d16",
- "key": "Robertos Key",
- "date": "2022-11-16T11:46:58Z",
- "values": {
- "requested": 100,
- "paid": 100,
- "fixed_fee": 0,
- "variable_fee": 0,
- "tax": 0,
- "transfer": 100
}, - "transfer_date": "2022-11-18T00:00:00Z",
- "transfer_batch": "",
- "method": "MBW",
- "document_number": "MARCEL0208220451979520221116114658",
- "payment_type": "single",
- "payment_id": "0cccc05d-1964-4648-a32b-fe7107746881",
- "payment_account": {
- "id": "76f190b9-2b8a-4bd0-9490-411241a9dc81"
}, - "payment_key": "Robertos Key",
- "payment_transaction_key": "",
- "descriptive": "Description of Roberto"
}, - {
- "id": "65196366-3afe-45b6-be79-0f1025c9e2d5",
- "key": "Merchant identification key",
- "date": "2022-11-15T10:06:19Z",
- "values": {
- "requested": 44,
- "paid": 44,
- "fixed_fee": 0.25,
- "variable_fee": 0.66,
- "tax": 1.5,
- "transfer": 42.88
}, - "transfer_date": "2022-11-17T00:00:00Z",
- "transfer_batch": "",
- "method": "DD",
- "document_number": "MARCEL0208220451822420221115100619",
- "payment_type": "single",
- "payment_id": "8798e233-43c8-4a73-8e24-e440a083b157",
- "payment_account": {
- "id": "76f190b9-2b8a-4bd0-9490-411241a9dc81"
}, - "payment_key": "Merchant identification key",
- "payment_transaction_key": "Merchant identification key",
- "descriptive": "Descriptive Josefa"
}, - {
- "id": "a03c6452-ae7a-4495-993d-b6608d999edb",
- "key": "Merchant identification key",
- "date": "2022-11-15T10:06:19Z",
- "values": {
- "requested": 44,
- "paid": 44,
- "fixed_fee": 0.25,
- "variable_fee": 0.66,
- "tax": 1.5,
- "transfer": 42.88
}, - "transfer_date": "2022-11-17T00:00:00Z",
- "transfer_batch": "",
- "method": "DD",
- "document_number": "MARCEL0208220451822320221115100619",
- "payment_type": "single",
- "payment_id": "b81d392b-b0d0-47ae-b76a-94ded2de404b",
- "payment_account": {
- "id": "76f190b9-2b8a-4bd0-9490-411241a9dc81"
}, - "payment_key": "Merchant identification key",
- "payment_transaction_key": "Merchant identification key",
- "descriptive": "Descriptive Josefa"
}, - {
- "id": "5b145b82-8ff1-4caf-bb5e-f72dccfff376",
- "key": "Merchant identification key",
- "date": "2022-11-15T10:06:19Z",
- "values": {
- "requested": 44,
- "paid": 44,
- "fixed_fee": 0.25,
- "variable_fee": 0.66,
- "tax": 1.5,
- "transfer": 42.88
}, - "transfer_date": "2022-11-17T00:00:00Z",
- "transfer_batch": "",
- "method": "DD",
- "document_number": "MARCEL0208220451822220221115100619",
- "payment_type": "single",
- "payment_id": "e605e589-ccf8-4739-8fdb-8502a609bda4",
- "payment_account": {
- "id": "76f190b9-2b8a-4bd0-9490-411241a9dc81"
}, - "payment_key": "Merchant identification key",
- "payment_transaction_key": "Merchant identification key",
- "descriptive": "Descriptive Josefa"
}
]
}
These operations will allow our clients to transfer their funds from Easypay Accounts to a Sepa Bank Account.
Full report with all the out payments from your Account Id
Success
Forbidden
Too Many Requests
Internal Error
{- "meta": {
- "page": {
- "current": 1,
- "total": 0
}, - "records": {
- "total": 0,
- "per_page": 1
}, - "links": {
- "first": "?page=1",
- "prev": "",
- "next": "?page=2",
- "last": "?page=0"
}
}, - "data": [
- {
- "id": "20efcd82-be96-4aa0-89a1-c6365633a72e",
- "status": "success",
- "type": "normal",
- "method": "transfer",
- "customer": {
- "id": "09dbe8e2-5703-401e-9adc-6317f67a4fd9"
}, - "account": {
- "id": "76f190b9-2b8a-4bd0-9490-411241a9dc81"
}, - "out_account": {
- "id": "bcd387ca-1835-4c95-9003-2da45f39e396"
}, - "key": "",
- "value": 50,
- "schedule_at": "2022-09-15 20:28:58",
- "transactions": [
- {
- "id": "20efcd82-be96-4aa0-89a1-c6365633a72e",
- "key": "",
- "date": "2022-09-15T21:28:58Z",
- "values": {
- "requested": -50,
- "paid": -50,
- "fixed_fee": 1,
- "variable_fee": 0,
- "tax": 0.23,
- "transfer": -51.23
}, - "transfer_date": "2022-09-15T00:00:00Z",
- "transfer_batch": "",
- "method": "transfer",
- "document_number": "MARCEL0208220435165820220915212858",
- "descriptive": ""
}
], - "created_at": "2022-09-15 20:28:58",
- "timestamp": ""
}, - {
- "id": "12f21a3c-52a6-4274-ad1e-5e774093f7dd",
- "status": "success",
- "type": "normal",
- "method": "transfer",
- "customer": {
- "id": "b586685e-4e56-472b-b469-9b365c62d223"
}, - "account": {
- "id": "76f190b9-2b8a-4bd0-9490-411241a9dc81"
}, - "out_account": {
- "id": "898d3a41-8013-4262-a432-0bd09e301dff"
}, - "key": "",
- "value": 50,
- "schedule_at": "2022-09-16 08:03:25",
- "transactions": [
- {
- "id": "12f21a3c-52a6-4274-ad1e-5e774093f7dd",
- "key": "",
- "date": "2022-09-16T09:03:27Z",
- "values": {
- "requested": -50,
- "paid": -50,
- "fixed_fee": 1,
- "variable_fee": 0,
- "tax": 0.23,
- "transfer": -51.23
}, - "transfer_date": "2022-09-16T00:00:00Z",
- "transfer_batch": "",
- "method": "transfer",
- "document_number": "MARCEL0208220435236620220916090327",
- "descriptive": ""
}
], - "created_at": "2022-09-16 08:03:27",
- "timestamp": ""
}
]
}
Get your strong authentication RSA private key from Easypay Backoffice on menu:Web Services->Configuration API 2.0->Keys.
Success
Bad Request
Forbidden
Too Many Requests
Internal Error
{- "customer": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "Customer Example",
- "email": "user@example.com",
- "phone": "911234567",
- "phone_indicative": "+351",
- "fiscal_number": "PT123456789",
- "key": "Example Key",
- "language": "PT"
}, - "key": "Example Key",
- "value": 0.5,
- "type": "normal",
- "schedule_at": "2019-08-24T14:15:22Z",
- "descriptive": "Descriptive Example",
- "account": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}, - "out_account": {
- "account_holder": "Acount Name Example",
- "iban": "PT50002700000001234567833",
- "email": "customer@example.com",
- "phone": "351911234567",
- "key": "Key Example",
- "country_code": "PT"
}, - "method": "transfer",
- "timestamp": "1696642539"
}
{- "status": "ok",
- "message": [
- "Your request was successfully created"
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "method": {
- "type": "transfer",
- "status": "pending"
}, - "customer": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}, - "out_account": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
}
Success
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "id": "760d105e-950d-4b41-8017-cad840ca3baa",
- "status": "success",
- "type": "normal",
- "method": "transfer",
- "descriptive": "descriptive",
- "customer": {
- "id": "7e47c256-4bea-41a8-b578-727d60004c7a"
}, - "account": {
- "id": "76f190b9-2b8a-4bd0-9490-411241a9dc81"
}, - "out_account": {
- "id": "343a8a78-8deb-4d4a-aa41-0a9140c95346"
}, - "key": "Example Key",
- "value": 1,
- "schedule_at": "2022-11-25 10:30:11",
- "transactions": [
- {
- "id": "760d105e-950d-4b41-8017-cad840ca3baa",
- "key": "Example Key",
- "date": "2022-11-25T10:30:14Z",
- "values": {
- "requested": -1,
- "paid": -1,
- "fixed_fee": 1,
- "variable_fee": 0,
- "tax": 0.23,
- "transfer": -2.23
}, - "transfer_date": "2022-11-25T00:00:00Z",
- "transfer_batch": "",
- "method": "transfer",
- "document_number": "MARCEL0208220453362220221125103014",
- "descriptive": ""
}
], - "created_at": "2022-11-25 10:30:14"
}
If the payment is not processed, it will be cancelled. Get your strong authentication RSA private key from Easypay Backoffice on menu: Web Services->Configuration API 2.0->Keys.
No content
Bad Request
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "status": "error",
- "message": [
- "Custom error message"
]
}
Success
Forbidden
Too Many Requests
Internal Error
{- "account": "b2080452-bad1-4455-8ae7-9f5ea552a274",
- "client_id": "EASYP030002",
- "payment_methods": [
- "mb"
]
}
Payment configuration object to generate a payment
Success
Bad Request
Forbidden
Too Many Requests
Internal Error
{- "account": "b2080452-bad1-4455-8ae7-9f5ea552a274",
- "client_id": "EASYP030002",
- "payment_methods": [
- "mb"
]
}
Checkout is easypay's integrated solution for collecting payments in any website.
It requires no extensive programming knowledge by including a pre-built payment form directly in your website. Checkout is responsible for:
Currently, the supported payment methods are:
To know how to choose from the available methods and integrate them with Checkout, read the integration guide.
Both single and frequent payments, as well as subscriptions are accepted by Checkout.
All Checkout interactions begin by making a server-to-server request to create a Checkout session. The request will return a Checkout manifest, which is then used to configure and display a Checkout form created exclusively for that payment interaction.
You can then display a Checkout form in your page by invoking our Checkout SDK. The SDK can be included from a CDN, via HTML <script>
tag, or you can use it as an NPM dependency in your project and import it in JavaScript/TypeScript.
This two-step approach makes Checkout the easiest way to integrate easypay payments in your custom website.
You can explore a live integration of Checkout to see what exactly is included in the solution, as well as trying out each payment flow.
The source code for the application, as well as instructions for running it locally, is available at the public repository.
Before using Checkout, you will need an easypay payment account.
An example app that demonstrates the steps described in this guide is available at https://github.com/Easypay/checkout-demo .
To create a Checkout session, you are required to send a server-to-server POST
request to the /checkout
endpoint. The created session will have an expiration time of 30 minutes at most, after which the users won't be able to pay that specific Checkout anymore.
Like all API requests, this request is authenticated as described in Authentication, which means you must include the AccountId
and ApiKey
headers.
An example payload is:
{
"type": ["single"],
"payment": {
"methods": ["cc", "mb", "mbw", "dd", "vi", "uf", "sc"],
"type": "sale",
"capture": {
"descriptive": "Purchase in MyStore"
},
"currency": "EUR",
"expiration_time": null
},
"order": {
"items": [
{
"description": "T-shirt",
"quantity": 1,
"key": "t-shirt",
"value": 12.5
},
{
"description": "Gloves",
"quantity": 1,
"key": "gloves",
"value": 7
}
],
"key": "order-123",
"value": 19.5
}
}
You can check all the possible parameters in the Checkout reference.
The service will return something like:
{
"id": "57cc19e9-f393-4cfa-9516-8807763b5096",
"session": "8zoaBOC0Mj5Mg_YAbdRCqYGI66Zc2DttAWeyVcedzhuT3r2IE8aS7l7H-sQOyppgawIv-wO48H_oKDHMzvMf1TeIJwo3Xu7HO7Tmj7y1iblt8t9JlEzyNdf5HurTvCeszC8PdRS4mbaPBCMCQ7g4xkG0qUuOEhiee5OB49MJJQ-Mo9vEnC_R4hzRBi-HSIMviTNDcCm5NiMnn__nWZxpfAmh6pYUg_eznqTGNbheYLu7ku_mBn7HvAdJQcgsmk6eeD-Z9S8SsK-ONHpbJQz1LNZsUkIIiWpNxPMrzD5Je0r2veawzAaIQmCeN8hYncHDfl5YZ7PP28MFVtEjMGOxsOsqxL4wmDOLPO5s6aWMq7Dxns-OGgf0r7dmaka4Y2mXovLVtNxsGgsNbBav8K86f5DceCDmPKBzYh-X5i1nx07LuqYKoJmA8NfyVP5tb-R3Y9dtwbPzcHc_AyQVKlsM0HtW3JXAdqoIBfsDgUqwASeuqQHEyIITKlcRvDIzWFaxTgXmmJauj6et7mo1GEM4L1gDkA1IXOd3n4HU2GvfPw==",
"config": null
}
This return object is referred to as a Checkout manifest, and will be needed in the steps below.
Include the easypay Checkout SDK in your page:
<script src="https://cdn.easypay.pt/checkout/2.6.2/"></script>
Prepare an empty element in your page where you'd like the Checkout form to be and give it the easypay-checkout
id:
<div id="easypay-checkout"></div>
Make sure to trigger the server-to-server call described above and get the contents of the manifest:
const manifest = await yourFunctionToGetTheManifest()
Then, use the globally available easypayCheckout
variable to initialize the SDK and display the form:
easypayCheckout.startCheckout(manifest)
And the Checkout should be running smoothly.
Instead of directly including the JavaScript library from the CDN, you can import it as an NPM module:
npm install --save @easypaypt/checkout-sdk
And use it like any other importable dependency:
import { startCheckout } from '@easypaypt/checkout-sdk'
startCheckout(manifest)
All the other steps are the same as for the CDN.
If you'd like to have the Checkout form displayed in an element with another id, for instance:
<div id="checkout-form"></div>
You can pass the id in the options parameter of the Checkout initialization:
startCheckout(manifest, {id: 'checkout-form',
})
When starting a Checkout form, you can store the return value to later manage it (particularly by removing it from the page at a later date).
const checkoutInstance = startCheckout(manifest)
When you no longer wish to display the Checkout contents, call the unmount()
method on the return object:
checkoutInstance.unmount()
Even before the Checkout process is completed (by the user pressing the End button or closing the popup), the Checkout SDK is able to notify you of a successful payment interaction.
This doesn't necessarily mean that the funds were transferred, but that no more user interaction with the Checkout is needed.
For instance, for a Credit Card payment, this means that the user successfully authorized the operation, and for Multibanco payments this means the user has requested the entity and reference values to pay later.
function mySuccessHandler(checkoutSuccessInfo) {// There was a successful payment interaction// You can react to details in checkoutSuccessInfo
}
const checkoutInstance = startCheckout(manifest, {onSuccess: mySuccessHandler,
})
Your callback function can receive a parameter with additional details about the outcome of the payment process. The full reference of the details is available on the reference page.
It will often be useful to know when users finish the Checkout process, so you can hide the Checkout contents and display a thank you message. The SDK includes a callback parameter that you can pass to get notified when the Checkout process is closed. In inline mode, this always means that the user finished a payment interaction, but in popup mode the user can choose to close the Checkout popup without finishing a payment interaction.
let successfulPaymentInteraction = false
function mySuccessHandler(checkoutSuccessInfo) {successfulPaymentInteraction = true
}
function myCloseHandler() {if (successfulPaymentInteraction) {
checkoutInstance.unmount()
document.write('Your order was received. Thank you.')
}
}
const checkoutInstance = startCheckout(manifest, {onSuccess: mySuccessHandler, onClose: myCloseHandler,
})
Processing a frequent payment means you have to save tokenized payment details to later use them to actually transfer funds.
To create a frequent payment Checkout session, your initial POST
request to /checkout
will have to include the type
property set to ['frequent']
.
After the user selects a payment method and fills in their details (if any), the SDK will call the success handler with the result information. It is at this point that you should send the payment.id
field to your server.
function saveTokenizedPayment(checkoutSuccessInfo) {sendTokenToServer(checkoutSuccessInfo.payment.id)
}
const checkoutInstance = startCheckout(manifest, {onSuccess: saveTokenizedPayment,
})
From then on, you can use the payment ID to send server-to-server requests capturing funds.
Each capture is created by sending a POST
request to the /capture/<payment id>
endpoint. The request must be authenticated with the AccountId and ApiKey headers as usual.
The payload has to include at least the descriptive
and value
for the capture. Learn more in the service reference.
{
"descriptive": "Purchase in MyStore",
"value": 20
}
On success, the service will return something similar to:
{
"status": "ok",
"message": ["Your request was successfully created"],
"id": "c68d8d1a-4c95-4a87-b9b5-031057b3a68e"
}
You can use the resulting capture id
to get information about the specific capture by issuing an authenticated GET
request to /capture/<capture id>
. Learn more in the service reference.
It will reply with the capture details:
{
"account": {
"id": "1a398de4-d318-48fc-a9fd-230f863dc0e1"
},
"capture_date": "2022-08-02",
"descriptive": "Purchase in MyStore",
"force_3ds":false,
"id": "c68d8d1a-4c95-4a87-b9b5-031057b3a68e",
"payment_id": "76ab3c32-7883-459f-a0ef-5fe0541e0ec7",
"payment_type": "frequent",
"status": "success",
"transaction_key": "",
"value": 20
}
Note: for frequent Multibanco Reference payments, no capture request is necessary. It's the customer's responsibility to make new payments to the same reference.
If you wish to be notified each time a payment is successful, follow our Notifications documentation.
For periodical payments with a set frequency, you can accept subscription payments in Checkout.
To do so, you will need to specify a payment type
of ["subscription"]
.
You will also need to define:
payment.start_time
, that determines when the subscription payments start. The start time must be in the future.payment.frequency
that sets the periodicity of the payments (weekly, monthly, etc). Available values are:"1D"
(daily)"1W"
(weekly)"2W"
(biweekly)"1M"
(monthly)"2M"
(bimonthly)"3M"
(trimonthly)"4M"
(quadmonthly)"6M"
(semiannually)"1Y"
(annually)"2Y"
(biannually)"3Y"
(triannually)payment.expiration_time
or a payment.max_captures
, so that the subscription has an end eventually.Check the reference for additional details and all the available properties.
An example request payload would therefore be:
{
"type": ["subscription"],
"payment": {
"methods": ["cc", "dd"],
"type": "sale",
"capture": {
"descriptive": "Purchase in MyStore"
},
"start_time": "2023-01-01 00:00",
"frequency": "1M",
"expiration_time": "2030-12-31 23:59"
},
"order": {
"items": [
{
"description": "My streaming service",
"quantity": 1,
"key": "streaming-service",
"value": 12.5
}
],
"key": "order-123",
"value": 12.5
}
}
After typing their details, the customer would then see a confirmation dialog for the subscription:
Pressing the proceed button allows to continue on with the payment method selection and the remaining interaction is the same as for single and frequent payments.
The Checkout process is resilient to most forms of errors and allows the customer to retry multiple times with different payment methods until the payment is completed. However, there are cases where the Checkout form is unable to recover on its own, such as an expired Checkout session, an attempt to pay a Checkout that was already paid or a Checkout that was canceled.
You can be notified of such cases by passing the callback parameter onError
:
function myErrorHandler(error) {checkoutInstance.unmount()switch (error.code) {
case 'checkout-expired':// In this case a new Checkout session must be createdconst manifest = await yourFunctionToGetTheManifest()checkoutInstance = startCheckout(manifest, {
onError: myErrorHandler
})
break
case 'already-paid':
document.write('Your order was already paid. Thank you.')
break
case 'checkout-canceled':
document.write('Your checkout was canceled.')
break
default:
document.write('Unable to process payment, please try again.')
}
}
const checkoutInstance = startCheckout(manifest, {onError: myErrorHandler
})
The list of possible errors is further documented in the reference
If you want to integrate Checkout and display it in a popup this is what you need to do:
<button id="checkout">Open Popup</button>
function initEasypayCheckoutSDK(manifest) {checkoutInstance = easypayCheckout.startCheckout(manifest, {
id: 'checkout',
display: 'popup',
})
}
Result:
Checkout supports a robust styling API that allows integrators to change its appearance in order to better blend it in their website.
The list of customizations include:
With a combination of some of these options, it's possible to change the Checkout entirely, fitting it in your website with ease.
Example:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {logoUrl: 'www.example.com/mylogo.png', accentColor: 'orange', buttonBackgroundColor: '#111', buttonBoxShadow: false, buttonBorderRadius: 5, inputBorderRadius: 5, inputBorderColor: '#000', inputBackgroundColor: '#ffe7c4', backgroundColor: '#eee', fontFamily: 'https://fonts.gstatic.com/s/raleway/v28/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrEVIT9d0c8.woff2',
})
Outcome:
To see every individual option in detail, check the reference.
startCheckout(manifest, [options])
manifest
: The return object from the checkout service.options
: An optional object containing any of the following properties:Option | Type | Required | Default | Description |
---|---|---|---|---|
id |
string |
no | 'easypay-checkout' |
The id of the HTML element where the Checkout form should be included. |
onSuccess |
function |
no | () => {} |
Callback function to be called when the Checkout is finished successfully. |
onError |
function |
no | () => {} |
Callback function to be called on (unrecoverable) errors. |
onPaymentError |
function |
no | () => {} |
Callback function to be called on (recoverable) payment errors. |
onClose |
function |
no | undefined |
Callback function to be called when the Checkout interaction is closed. |
testing |
boolean |
no | false |
Whether to use the testing API (true ) or the production one (false ). |
display (1) |
string |
no | 'inline' |
The display style of the element that hosts the Checkout. |
hideDetails |
boolean |
no | false |
Whether to hide the details form or not. An expandable summary will be shown with the details, instead. |
language (2) |
string |
no | undefined |
The language in which to display the Checkout. |
logoUrl |
string |
no | undefined |
The merchant logo url to display in the Checkout. |
backgroundColor |
string |
no | '#ffffff' |
The color used as the background of the Checkout page. |
accentColor |
string |
no | '#0d71f9' |
The color used in highlights, as well as default buttons and input borders. |
errorColor |
string |
no | '#ff151f' |
The color used for errors. |
inputBackgroundColor |
string |
no | 'transparent' |
The color used for the input backgrounds. |
inputBorderColor |
string |
no | accentColor | The color for input borders. |
inputBorderRadius |
number |
no | 50 |
The border radius for inputs, in px . |
inputFloatingLabel |
boolean |
no | true |
Whether inputs should use floating labels. |
buttonBackgroundColor |
string |
no | accentColor | The color used for the button backgrounds. |
buttonBorderRadius |
number |
no | 50 |
The border radius for buttons, in px . |
buttonBoxShadow |
boolean |
no | true |
Whether the buttons should have box-shadow. |
fontFamily |
string |
no | 'Overpass' |
The font used for the text. |
baseFontSize |
number |
no | 10 |
The value in px for the font size of the root element (1rem ). |
display
available values: inline
(default) or popup
.
(2) language
available values: en
or pt_PT
. If left undefined
, a default language will be selected according to the customer's browser language.CheckoutInstance
object, containing the following method:unmount()
: Removes all Checkout form content and event listener.onSuccess(checkoutInfo)
Receives an object with the following properties:
Property | Type | Description |
---|---|---|
id |
string |
The id of the Checkout session. |
type |
string |
The payment type for this Checkout ('single' , 'frequent' or 'subscription' ). |
payment |
Object |
Detailed information about the payment. |
Properties of the payment
Object:
Note: Some properties only appear with certain payment methods.
Property | Method | Type | Description |
---|---|---|---|
id |
All | string |
The payment's id. |
method (1) |
All | string |
The payment method chosen by the customer. |
status (2) |
All | Object |
The status of the payment. |
value |
All | number |
The order value, rounded to two decimal places. Not used in frequent payments. |
cardType |
Credit Card | string |
The credit card type ('VISA' or 'MasterCard' ). |
lastFour |
Credit Card | string |
The last four digits of the credit card. |
cardCountryCode |
Credit Card | string |
The country code of the credit card. |
expirationDate (3) |
Credit Card / Multibanco | string |
The expiration date of the card (Credit Card) or the payment (Multibanco). |
entity |
Multibanco | string |
The Multibanco entity. |
reference |
Multibanco | string |
The Multibanco reference. |
sddMandate (4) |
Direct Debit | Object |
SEPA Direct Debit mandate. |
iban |
Virtual IBAN | string |
The created IBAN. |
(1) Possible method values are the same as in the Checkout creation.
(2) Possible payment status values:
'authorised'
'deleted'
'enrolled'
'error'
'failed'
'paid'
'pending'
'success'
'tokenized'
(To be used later in frequent
payments.)'voided'
(3) Format of the expiration varies between Credit Card ('MM/YY'
format) and Multibanco ('Y-m-d H:i'
).
(4) Properties of the sddMandate
Object:
Property | Type | Description |
---|---|---|
accountHolder |
string |
Name of the account holder. |
billingEntity |
string |
The billing entity for the payments. |
countryCode |
string |
Country code of the bank account. |
email |
string |
The customer's e-mail address. |
iban |
string |
The IBAN. |
id |
string |
The mandate's id. |
maxNumDebits |
string |
The maximum number of debits allowed for this Direct Debit. |
name |
string |
The customer's name. May be different from the account holder's name. |
phone |
string |
The customer's phone number. |
referenceAdc |
string |
The authorization reference. |
onError(error)
Receives an object with the following property:
Property | Type | Description |
---|---|---|
code |
string |
The type of error that occurred. See the table below for possible values. |
The error code
has the following possible values and recommended solutions:
Value | Cause | Recommended solution |
---|---|---|
checkout-expired |
The Checkout session has expired. | Create a new Checkout session with the server-to-server call and use the newly returned Manifest to instantiate a new Checkout form. |
already-paid |
The Checkout was already paid. | Refresh the order information and confirm that it was paid. Give feedback to the user accordingly. |
checkout-canceled |
The Checkout was canceled. | Create a new Checkout session with the server-to-server call and use the newly returned Manifest to instantiate a new Checkout form. |
generic-error |
An unspecified error occurred. | Since the root cause is unclear, you can try creating a new session or signal an error to the user. |
onPaymentError(error)
Signals the occurrence of a recoverable error during a payment attempt. These errors are informative and for logging/analysis purposes, as the user is allowed (and encouraged) to try the payment again with the same or other payment method.
Receives an object with the following properties:
Property | Type | Description |
---|---|---|
code |
string |
The type of error that occurred. See the table below for possible values. |
paymentMethod |
string |
The payment method for which the error happened. |
checkout |
object |
On payment-failure errors, the Checkout object containing the payment information that had already been created. Has the same properties as the onSuccess checkoutInfo object. |
The error code
has the following possible values and recommended solutions:
Value | Cause | Recommended solution |
---|---|---|
generic-error |
There was an error before the payment process had started. | Allow the user to try again. If problem persists, report it to easypay. |
payment-failure |
There was an error after the payment process had started. | Allow the user to try again. If problem persists, use the attached checkout object to get details about the payment intent. |
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
logoUrl: 'www.example.com/mylogo.png'
})
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
backgroundColor: '#222222'
})
The text colors are automatically adjusted to shades of black or white depending on the background color, in order to achieve the best contrast possible.
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
accentColor: '#ffa861'
})
The text colors (over the accent, such as in buttons) are automatically adjusted to black or white, in order to achieve the best contrast possible.
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
errorColor: '#d18800'
})
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
inputBackgroundColor: '#001f3d'
})
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
inputBorderColor: '#000000'
})
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
inputBorderRadius: 0
})
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
inputFloatingLabel: false
})
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
buttonBackgroundColor: '#000000'
})
The button text color is automatically adjusted to black or white, in order to achieve the best contrast possible.
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
buttonBorderRadius: 0
})
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
buttonBoxShadow: false
})
Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
fontFamily: 'cursive'
})
The fontFamily
property can have three types of values:
'sans-serif'
, 'serif'
, 'cursive'
)'arial'
, 'verdana'
)'https://fonts.gstatic.com/s/overpass/v12/qFda35WCmI96Ajtm83upeyoaX6QPnlo6_PPbM5qKl8Kuo8AzesE.woff2'
, must include the protocol http
/https
)Outcome:
const checkoutInstance = easypayCheckout.startCheckout(manifest, {
baseFontSize: 8
})
Changes the value in px
for the font size of the root element (1rem
). The default value is 10
, so any value below will reduce the font size, while a value above will increase it.
Besides changing the size of the text (while keeping the proportions), this setting changes most of the layout dimensions, effectively increasing or decreasing the scale.
Outcome:
Success
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "status": "failed",
- "message": [
- "string"
], - "checkout": {
- "id": "string",
- "status": "pending"
}, - "payment": {
- "id": "string",
- "status": "waiting",
- "methods": [
- "mb"
], - "expiration_time": "string",
- "currency": "string",
- "key": "string",
- "max_value": 0,
- "min_value": 0,
- "frequency": "string",
- "max_captures": 0,
- "start_time": "string",
- "failover": true,
- "capture_now": true,
- "retries": 0
}, - "value": 0
}
This cancels the Checkout and deletes the payment associated with it if possible.
No content
Bad Request
Unauthorized
Forbidden
Resource Not Found
Too Many Requests
Internal Error
{- "status": "error",
- "message": [
- "Custom error message"
]
}
Creates a Checkout Session.
Checkout request details
Success
Bad Request
Forbidden
Too Many Requests
Internal Error
{- "type": [
- "subscription"
], - "payment": {
- "methods": [
- "dd"
], - "type": "sale",
- "sdd_mandate": {
- "iban": "PT50002700000001234567833",
- "name": "Name Example",
- "email": "customer@example.com",
- "phone": "912997715",
- "account_holder": "Acount Name Example",
- "key": "Sdd Mandate key"
}, - "capture": {
- "descriptive": "Purchase in MyStore"
}, - "expiration_time": "2022-10-12 16:05",
- "currency": "EUR",
- "key": "Example Key",
- "frequency": "1Y",
- "max_captures": 10,
- "start_time": "2022-10-12 16:05",
- "failover": true,
- "capture_now": true,
- "retries": 2
}, - "order": {
- "items": [
- {
- "description": "T-shirt",
- "quantity": 1,
- "key": "t-shirt",
- "value": 12.5
}, - {
- "description": "Gloves",
- "quantity": 1,
- "key": "gloves",
- "value": 7
}
], - "key": "order-123",
- "value": 19.5
}, - "customer": {
- "name": "Customer Example",
- "email": "customer@example.com",
- "phone": "911234567",
- "phone_indicative": "+351",
- "fiscal_number": "PT123456789",
- "key": "Key Example",
- "language": "PT"
}
}
{- "id": "10d3a41a-c9c4-486e-8da7-9490e5f097b7",
- "session": "XkhRqoQtbBakUnjEJA4lYSCtboITWSb-ijxRMWKj7C9ormZ_4JubSB3qjy4XuORJFSrR0OsQ0ypE2Ws9Zl0N2REmR0CMNewH8ghyR1NBnPzDJ1AAuj9LvAhdv9SS-MXRh20_jmVz0MTcaD6E9WfHMiGSyej8eLMaE2hbSHn8DAO7kUSy8nzIIIUbR3pbpEpwxeO6fgHB3hdLGWrGUjeRq-Dq1Q_RF_ZWDPOGPwehXb3YRTatcjBG_2yoyGWWBaABOlkOx_uLaZIdrHMRXaDwLFDoN-eiu3BH1KKrut6pcE_Gc6laTf2AINBQIuSzKHLT4MFpTkrxdfPiD67w8aENm2HuzFc08I46KxdQG-2dSN522jZWDC2z4r4HFZ8LWVlDPuLbpui-WoWOJrJAnW3nPhyaKfUeu4KuU3BKYtJrtOoqs5ingkKWen0jm6AuFeZDeYRlRtj19S6d3P4q7Om3PVwil7c0K0brq31SmLHZdvsG_gHOPSZ6qrQy_95NZO0x934tBIUK91C1Bnm1Z9wA2Pp2hIeprOXMuZXkuanODro=",
- "config": null
}
Created
{- "type": "SINGLE",
- "expiration_time": "2023-12-29T23:59:59.999Z",
- "payment": {
- "single": {
- "requested_amount": "21.55"
}, - "methods": [
- "CC",
- "MBW",
- "MB",
- "DD",
- "VI",
- "UF"
], - "capture": {
- "descriptive": "string",
- "key": "string"
}
}, - "customer": {
- "name": "pedro barros",
- "email": "barros@gmail.com",
- "phone": "+351911234567",
- "language": "PT"
}, - "communication_channels": [
- "SMS",
- "EMAIL"
]
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "expiration_time": "2019-08-24T14:15:22Z",
- "type": "SINGLE",
- "customer": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "Jonh Doe",
- "email": "example@easypay.pt",
- "phone": "+351911234567",
- "language": "PT"
}, - "communication_channels": [
- "SMS"
], - "payment": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "expiration_time": "2019-08-24T14:15:22Z",
- "methods": [
- "MBW"
], - "capture": {
- "descriptive": "string",
- "key": "string"
}, - "single": {
- "requested_amount": "string"
}, - "frequent": {
- "minimum_amount": "string",
- "maximum_amount": "string",
- "unlimited_payments": true
}, - "subscription": {
- "frequency": "string",
- "maximum_captures": "string",
- "start_time": "string",
- "capture_now": true,
- "retries": 0,
- "failover": true
}
}, - "status": "ACTIVE"
}
OK
{- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "expiration_time": "2019-08-24T14:15:22Z",
- "type": "SINGLE",
- "customer": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "Jonh Doe",
- "email": "example@easypay.pt",
- "phone": "+351911234567",
- "language": "PT"
}, - "communication_channels": [
- "SMS"
], - "payment": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "expiration_time": "2019-08-24T14:15:22Z",
- "methods": [
- "MBW"
], - "capture": {
- "descriptive": "string",
- "key": "string"
}, - "single": {
- "requested_amount": "string"
}, - "frequent": {
- "minimum_amount": "string",
- "maximum_amount": "string",
- "unlimited_payments": true
}, - "subscription": {
- "frequency": "string",
- "maximum_captures": "string",
- "start_time": "string",
- "capture_now": true,
- "retries": 0,
- "failover": true
}
}, - "status": "ACTIVE"
}
], - "metadata": {
- "next_cursor": "lL_j7ilk7rc",
- "count": 10
}
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "expiration_time": "2019-08-24T14:15:22Z",
- "type": "SINGLE",
- "customer": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "Jonh Doe",
- "email": "example@easypay.pt",
- "phone": "+351911234567",
- "language": "PT"
}, - "communication_channels": [
- "SMS"
], - "payment": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "expiration_time": "2019-08-24T14:15:22Z",
- "methods": [
- "MBW"
], - "capture": {
- "descriptive": "string",
- "key": "string"
}, - "single": {
- "requested_amount": "string"
}, - "frequent": {
- "minimum_amount": "string",
- "maximum_amount": "string",
- "unlimited_payments": true
}, - "subscription": {
- "frequency": "string",
- "maximum_captures": "string",
- "start_time": "string",
- "capture_now": true,
- "retries": 0,
- "failover": true
}
}, - "status": "ACTIVE"
}