Professional Documents
Culture Documents
ABG POCKET
API Document
On
POCKET Payment Gateway
Page 1 of 8
POCKET Payment Gateway API Version 2.0.1
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.
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
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
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
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
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
Page 7 of 8
POCKET Payment Gateway API Version 2.0.1
Max Field
SL Field Name Field Type Field Description Mandatory/Optional
Length
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