You are on page 1of 8

POCKET Payment Gateway API Version 2.0.

ABG POCKET

API Document
On
POCKET Payment Gateway

Document number: ABGTL-001 Version Rev: 2.0.0


Prepared by: Md. Mejbahur Rahaman Reviewed by: Mizanur Rahman

Page 1 of 8
POCKET Payment Gateway API Version 2.0.1

Document Version Control

Version Date Comments Author

1.0.0 17-May-2023 Initial Document. Md. Mejbahur Rahaman


Change Payment request method payload and
2.0.0 20-Jun-2023 response. Remove x-api-token from header of Md. Mejbahur Rahaman
checkoutsessionId and Status check method
Change Method name to GET for Status check and
2.0.1 05-July-2023 Md. Mejbahur Rahaman
CheckoutSessionId method

Page 2 of 8
POCKET Payment Gateway API Version 2.0.1

Index

Table of Contents
1. Overview ..................................................................................................................................... 4
2. Integration .................................................................................................................................. 4
2.1 API Connectivity .................................................................................................................. 4
2.2 Staging Environment ........................................................................................................... 4
2.1 Production Environment ..................................................................................................... 4
3. Encryption ................................................................................................................................... 4
4. API Method ................................................................................................................................. 4
4.1 Validate Payment Request .................................................................................................. 4
4.2 Checkout With checkoutSessionID ..................................................................................... 7
4.3 Payment Status check ......................................................................................................... 7

Page 3 of 8
POCKET Payment Gateway API Version 2.0.1

1. Overview
The purpose of this document is to provide a high-level specification for interfacing and integrating ABG POCKET
Payment Gateway (PGW) with financial institutions. This API enables financial institutions to securely and
seamlessly transfer money between Merchant and the Pocket wallet.

2. Integration
2.1 API Connectivity
API communication through HTTPS protocol preferable.

2.2 Staging Environment


Pocket Base URL and Credential for Authentication will be shared through a secured channel specifically for the UAT
(User Acceptance Testing) environment.

2.1 Production Environment


Pocket Base URL and Credential for Authentication will be shared through a secured channel specifically for the
Production environment.

3. Encryption
Merchant will have to encrypt JSON payload message by AES encryption Algorithm before sending payment
validation request in our system.
Encryption Properties:
• Algorithm for Encryption: AES
• Key size in bits: 256
• Secret key: Will be shared through Secured channel
• Cipher Mode of Encryption: ECB

4. API Method
4.1 Validate Payment Request
This method is used to validate payment request. At first merchant will encrypt payment payload using AES
algorithm, then post encrypted data through this API.

Page 4 of 8
POCKET Payment Gateway API Version 2.0.1

Name Validate Payment Request

API Endpoint {POCKET_BASE_URL}/api/v1/merchant/external-payment/validate-request

Method POST

Content-Type: application/json
Request Header
x-api-token: [will be shared by Pocket Team]
{
"merchantCode":"SSL",
"username":"*******",
"password":"*******",
"amount":100,
Payload "billOrInvoiceNo":"SSL159357001",
"approvedUrl":"https://www.google.com/",
"cancelUrl":"https://www.google.com/",
"declineUrl":"https://www.google.com/",
"description":"item descriptions"
}
Secret key Secret key will be shared through Secured channel for payload encryption
{
"data":"PSnFWIJZykhIoIM2SD9gi4NxMmSVRmmHr9rXB9pmRWbEdZBm0RgqfTBG
IVSyD/dYPnUMqUt6HOfN1zGAQtVVB0mYryY1lytP+lrxpBZ6SvdlVk2a6nxgK3U+
woYi4O3HfpTN1uu4DY81XByplNq/OJSyM2AQ7C6XFG4I/AX/tR2Znm1Q5NqTWQJC
Request Body wLP0k4ZJlBxvEpuCGi6+wkm2rhAsL3LQpkO1FgQ6qXEWr4TCUp0msA9r68MTal1V
vmKZFHtgxJfRQTXWRnhfyb7QxpU34YuELC+WgS5JGpdMIxPTI9wjbeqooQBu6sjV
pqsfiIZHYAXIfLg2+9YY2STQ6D6oBMCNV9N5uYVy9P1BjFZmHx1avQGk+OKMTOCt
mB3AmVNK"
}
Response Content
application/json
Type
{
"responseCode":"S100000",
"responseMessage":"Operation is successful.",
"data":{
"checkoutSessionID":"2a26554a-0f66-11ee-8d21-339511ba504a",
Response Body
"transactionTrackingNumber":"DW1120692008724381696",
"checkoutUrl":"http://test-api.abgpocket.com/api/v1/merchant/external-
payment/checkout/2a26554a-0f66-11ee-8d21-339511ba504a"
}
}

Page 5 of 8
POCKET Payment Gateway API Version 2.0.1

Payload Details:

Max
Field
SL Field Name Field Field Description Mandatory/Optional
Type
Length
1 merchantCode 50 String Shared by Pocket Team Mandatory

2 username 50 String Shared by Pocket Team Mandatory

3 password 250 String Shared by Pocket Team Mandatory


Unique invoice or bill no for each
4 billOrInvoiceNo 50 String Mandatory
request
5 amount 16.2 Decimal Transaction Amount Mandatory

6 approvedUrl 255 String Merchant payment Approved Url Mandatory

7 cancelUrl 255 String Merchant payment Cancel Url Mandatory

8 declineUrl 255 String Merchant payment Declined Url Mandatory

9 description 255 String Payment Description Optional

Request Body Details:

Max
Field
SL Field Name Field Field Description Mandatory/Optional
Type
Length
1 data String Payload encrypted data Mandatory
Add x-api-token with value to header. x-
2 x-api-token 50 String Mandatory
api-token will be shared by Pocket Team

Response Body Details:

Max Field
SL Field Name Field Type Field Description Mandatory/Optional
Length
Return status code for the
operation. SXXXXXX ( S100000,
1 responseCode 20 String S100001) etc. indicate success Mandatory
and EXXXXXX ( E100001,
E100002) etc. indicate failure
2 responseMessage 250 String Return operation message Mandatory
data.
3 50 String Unique SessionId for each request Mandatory
checkoutSessionID

Page 6 of 8
POCKET Payment Gateway API Version 2.0.1

4.2 Checkout With checkoutSessionID


This method is used to Checkout Payment using checkoutSessionID field value.

Name Checkout With checkoutSessionID


{POCKET_BASE_URL}/api/v1/merchant/external-
API Endpoint
payment/checkout/{checkoutSessionID}
Method GET
{POCKET_BASE_URL}/api/v1/merchant/external-payment/checkout/137fa38d-
Request Body
f53f-11ed-985e-e50be11c9685
Response Content Type application/json

Response Body After that the user will be redirected to Payment Gateway page with bill info.
Request Body Details:

Max Field
SL Field Name Field Type Field Description Mandatory/Optional
Length

1 checkoutSessionID 50 String Payment Checkout SessionID Mandatory

4.3 Payment Status check


This method is used to check Payment Status.

Name Payment Status Check


{POCKET_BASE_URL}/api/v1/merchant/external-
API Endpoint
payment/status/{checkoutSessionID}
Method GET
{POCKET_BASE_URL}/api/v1/merchant/external-payment/status/
Request Body
137fa38d-f53f-11ed-985e-e50be11c9685
Response Content Type application/json
{
"responseCode":"S100000",
"responseMessage":"Operation is successful.",
"data":{
Response Body "billNo":"SSL159357001",
"trxTrackingNumber":"DW1120692008724381696",
"status":"SUCCESSFUL"
}
}

Page 7 of 8
POCKET Payment Gateway API Version 2.0.1

Request Body Details:

Max Field
SL Field Name Field Type Field Description Mandatory/Optional
Length

1 checkoutSessionID 50 String Payment Checkout SessionID Mandatory

Response Body Details:

Max
Field
SL Field Name Field Field Description Mandatory/Optional
Type
Length
Unique invoice or bill no for each
1 billNo 50 String Mandatory
request
Pocket generated Unique number
2 trxTrackingNumber 50 String
for every Payment.
3 status 50 String Transaction Status message Mandatory

Page 8 of 8

You might also like