With Pay Money Standard and Express, you can easily and safely receive online payments from your customer.

eBirpay Payment Gateway Merchant Payment Rest API Documentation

Description

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.

Base URL
                        https://app.ebirpay.com/api/v2
                    
Login Endpoint

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:

  • Content Type: form-data
    • email (string): Email address of the user.
    • password (string): Password for the user account.

Request Body:

                    
                        email: user@gmail.com
                        password: 123456
                      
                

Example Request:

                  
                    curl --location 'https://app.ebirpay.com/api/v2/login' \
                    --form 'email="user@gmail.com"' \
                    --form 'password="123456"'
                  
                

Example Response:

                      
                        {
                            "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"
                              }
                            }
                          }
                      
                    

Example Error Response:

                      
                        {
                          "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.

Access Token Endpoint

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:

  • Content Type: form-data
    • client_id (string): Client ID provided by the merchant.
    • client_secret (string): Client secret provided by the merchant.

                    
                        {" client_id":" yMKqAvC2dILUyhwdIbryh4rsl784kF"," client_secret":" ZubitDCg2QyxuoSu0l6pJkNB5lOrcl1Ivy0qZlhlu8QhWHDYOelkVSNC8B0ybunOb3i832W3FC2SUuXw04Rj8kRHduMx7pdD4a48"}
                    
                

Example Request:

                  
                    curl --location 'https://app.ebirpay.com/api/v2/access-token' \
                    --form 'client_id="ObPVWjipvNRhkRXfSYPlfDfisWqvsL"' \
                    --form 'client_secret="vuTTyWR6hgNUPJEiCQCDCvi7osvweuCrKT7Di8VEoOxvkDBRdWn7QrX1JoOAsmyHoWWcZgw7RKNEhegD53Qi4Gby4YHgxO2GKggZ"'
                  
                

Example Response:

                      
                        {
                            "access_token": "WVud9BVdSnnx84ttvYflOAKiiP",
                            "expires_in": 86400,
                            "token_type": "Bearer"
                        }
                      
                    

Example Error Response:

                      
                        {
                          "error": {
                            "status": 401,
                            "message": "Unauthorized",
                            "details": "Incorrect client ID or client secret"
                          }
                        }
                      
                    
Transaction Info Endpoint

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.

Request Body:

                  
                    {
                        "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"
                    }
                  
                

Example Request:

                  
                    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"
                    }'
                  
                

Example Response:

                      
                        {
                            "status": "success",
                            "grandId": 83903985,
                            "token": "43erCpK4ksFP6NE1S34M",
                            "data": {
                              "approvedUrl": "https://app.ebirpay.com/api/v2/merchant/payment?grant_id=83903985&token=43erCpK4ksFP6NE1S34M"
                            }
                        }
                      
                    

Example Error Response:

                      
                        {
                          "error": {
                            "status": 401,
                            "message": "Unauthorized",
                            "details": "Incorrect client ID or client secret"
                          }
                        }
                      
                    

Invalid Currency:

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": []
                          }
                        }
                      
                    

Amount Zero:

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": []
                          }
                        }
                      
                    
Process Payment Endpoint

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.

Request Body:

                  
                    {
                        "grant_id": ,
                        "token": 
                    }
                  
                

Example Request:

                  
                    curl --location 'https://app.ebirpay.com/api/v2/merchant/payment' \
                    --header 'Authorization-token: ' \
                    --form 'grant_id="33255410"' \
                    --form 'token="2N9GVTTSKeTCluCfkyI1"'
                  
                

Example Response:

                      
                        {
                            "success": {
                              "status": 200,
                              "message": "Success",
                              "successPath": "https://app.ebirpay.com/dashboard?status=success?eyJzdGF0dXMiOjIwMCwidHJhbnNhY3Rpb25faWQiOiIyOUZCRjk2QUY5Njc4IiwibWVyY2hhbnQiOiJKYWtlZW0gQ2xldmVsYW5kIiwiY3VycmVuY3kiOiJVU0QiLCJmZWUiOjAuMTUsImFtb3VudCI6OS44NSwidG90YWwiOjEwfQ=="
                            }
                        }
                      
                    

Example Error Response:

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!"
                          }
                        }
                      
                    

Grant Id or Token Mismatch:

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!"
                          }
                        }
                      
                    

Insufficient Balance:

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!"
                          }
                        }
                      
                    
Cancel Payment Endpoint

Endpoint: https://app.ebirpay.com/api/v2/merchant/payment/cancel

Method: POST

Description: Cancels a payment transaction.

Request Body:

                  
                    {
                        "grant_id": ,
                        "token": 
                    }
                  
                

Example Request:

                  
                    curl --location 'https://app.ebirpay.com/api/v2/merchant/payment/cancel' \
                    --header 'Authorization-token: ' \
                    --form 'grant_id="83903985"' \
                    --form 'token="43erCpK4ksFP6NE1S34M"'
                  
                

Example Response:

                      
                        {
                            "success": {
                                "status": 200,
                                "message": "Payment cancelled successfully",
                                "cancelUrl": "https://app.ebirpay.com/dashboard"
                            }
                        }