With Pay Money Standard and Express, you can easily and safely receive online payments from your customer.
The Express Merchant REST API allows developers to integrate payment functionality into their applications. With this API, users can initiate transactions, process payments, and handle cancellations seamlessly. This documentation provides details on endpoints, request/response formats, and authentication mechanisms.
https://app.ebirpay.com/api/v2
Endpoint: https://app.ebirpay.com/api/v2/login
Method: POST
Description: Login API is used to authenticate users. User must provide email and password. If credentials are correct, a token is returned. If credentials are incorrect, an error message is returned.
Request Body:
email: user@gmail.com
password: 123456
curl --location 'https://app.ebirpay.com/api/v2/login' \
--form 'email="user@gmail.com"' \
--form 'password="123456"'
{
"response": {
"status": {
"code": 200,
"message": "OK"
},
"records": {
"user_id": 2,
"first_name": "Nina",
"last_name": "Adkins",
"full_name": "Nina Adkins",
"email": "user@gmail.com",
"formattedPhone": "+12015551425",
"picture": "https://app.ebirpay.com/public/dist/images/default-avatar.png",
"defaultCountry": "us",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9",
"userStatus": "Active"
}
}
}
{
"error": {
"status": 401,
"message": "Unauthorized",
"details": "Invalid email or password."
}
}
N.B: You have to use this genereted TOKEN on all other steps as Authorization-token in the header section.
Endpoint: https://app.ebirpay.com/api/v2/access-token
Method: POST
Description: This endpoint is used to generate an access token. You must provide client_id and client_secret to generate an access token.
Request Body:
{" client_id":" yMKqAvC2dILUyhwdIbryh4rsl784kF"," client_secret":" ZubitDCg2QyxuoSu0l6pJkNB5lOrcl1Ivy0qZlhlu8QhWHDYOelkVSNC8B0ybunOb3i832W3FC2SUuXw04Rj8kRHduMx7pdD4a48"}
curl --location 'https://app.ebirpay.com/api/v2/access-token' \
--form 'client_id="ObPVWjipvNRhkRXfSYPlfDfisWqvsL"' \
--form 'client_secret="vuTTyWR6hgNUPJEiCQCDCvi7osvweuCrKT7Di8VEoOxvkDBRdWn7QrX1JoOAsmyHoWWcZgw7RKNEhegD53Qi4Gby4YHgxO2GKggZ"'
{
"access_token": "WVud9BVdSnnx84ttvYflOAKiiP",
"expires_in": 86400,
"token_type": "Bearer"
}
{
"error": {
"status": 401,
"message": "Unauthorized",
"details": "Incorrect client ID or client secret"
}
}
Endpoint: https://app.ebirpay.com/api/v2/merchant/transaction-info
Method: POST
Description: Retrieves transaction information and generates a payment token. You must provide client_id and client_secret to generate an access token.
{
"payer": "David Luca",
"amount": "10",
"currency": "USD",
"email": "david.luca@gmail.com",
"successUrl": "https://app.ebirpay.com/dashboard?status=success",
"cancelUrl": "https://suki.money?status=cancel"
}
curl --location 'https://app.ebirpay.com/api/v2/merchant/transaction-info' \
--header 'Authorization: Bearer ' \
--data-raw '{
"payer": "David Luca",
"amount": "10",
"currency": "USD",
"email": "david.luca@gmail.com",
"successUrl": "https://webhook.site/2d384b3a-cfeb-463d-bd5a-a46685fbdc0d?status=success",
"cancelUrl": "https://webhook.site/2d384b3a-cfeb-463d-bd5a?status=cancel"
}'
{
"status": "success",
"grandId": 83903985,
"token": "43erCpK4ksFP6NE1S34M",
"data": {
"approvedUrl": "https://app.ebirpay.com/api/v2/merchant/payment?grant_id=83903985&token=43erCpK4ksFP6NE1S34M"
}
}
{
"error": {
"status": 401,
"message": "Unauthorized",
"details": "Incorrect client ID or client secret"
}
}
If the currency provided in the request is not supported by the merchant, the following error response will be returned:
{
"success": {
"status": "error",
"message": "Currency GBP is not supported by this merchant!",
"data": []
}
}
If the amount provided in the request is zero or less than zero, the following error response will be returned:
{
"success": {
"status": "error",
"message": "Amount cannot be 0 or less than 0.",
"data": []
}
}
Endpoint: https://app.ebirpay.com/api/v2/merchant/payment
Method: POST
Description: In this endpoint payment will success, Checks all kinds of input validation and redirected to payment page (if user not logged in then user have to login) if all validation passed. User have to decide to cancel or accept the payment. User grant_id & token as body parameter which is generated in previous step.
{
"grant_id": ,
"token":
}
curl --location 'https://app.ebirpay.com/api/v2/merchant/payment' \
--header 'Authorization-token: ' \
--form 'grant_id="33255410"' \
--form 'token="2N9GVTTSKeTCluCfkyI1"'
{
"success": {
"status": 200,
"message": "Success",
"successPath": "https://app.ebirpay.com/dashboard?status=success?eyJzdGF0dXMiOjIwMCwidHJhbnNhY3Rpb25faWQiOiIyOUZCRjk2QUY5Njc4IiwibWVyY2hhbnQiOiJKYWtlZW0gQ2xldmVsYW5kIiwiY3VycmVuY3kiOiJVU0QiLCJmZWUiOjAuMTUsImFtb3VudCI6OS44NSwidG90YWwiOjEwfQ=="
}
}
If the merchant tries to make a payment to himself, the following error response will be returned:
{
"success": {
"status": 801,
"message": "Merchant cannot make payment to himself!"
}
}
If there is a mismatch between the Grant Id or Token, the following error response will be returned:
{
"success": {
"status": 401,
"message": "Grant Id or Token does not Match!"
}
}
If the user doesn't have sufficient balance to make the payment, the following error response will be returned:
{
"success": {
"status": 401,
"message": "User doesn't have sufficient balance!"
}
}
Endpoint: https://app.ebirpay.com/api/v2/merchant/payment/cancel
Method: POST
Description: Cancels a payment transaction.
{
"grant_id": ,
"token":
}
curl --location 'https://app.ebirpay.com/api/v2/merchant/payment/cancel' \
--header 'Authorization-token: ' \
--form 'grant_id="83903985"' \
--form 'token="43erCpK4ksFP6NE1S34M"'
{
"success": {
"status": 200,
"message": "Payment cancelled successfully",
"cancelUrl": "https://app.ebirpay.com/dashboard"
}
}