⚡ Payment API Integration Documentation

To integrate the API, you will need a client ID and client secret, which will be provided during onboarding. Please follow the steps below to integrate.

Base URL for UAT (User Acceptance Testing)

base_url = https://pinelabs.paythrough.in/uat/api/v1

Base URL for Production

base_url = https://pinelabs.paythrough.in/api/v1

Step 1: Generate Access Token

With the help of the client_id and client_secret, you can obtain an access token.

Request

Payload

{
    "client_id": "{{client_id}}",
    "client_secret": "{{client_secret}}"
 }
 
 

Success Response

Status code: 200

{
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "token_type": "bearer"
 }
 
 

Error Response

Status code: 401

{
    "detail": "Invalid Credentials."
 }

Step 2: Payments (Generate UPI Intent)

Request

Payload

{
    "access_token": "your_access_token",
    "token_type": "Bearer",
    "order_reference": "{{random_order_reference}}",
    "amount": {{required_amount}},
    "firstname": "{{first_name}}",
    "lastname": "{{last_name}}",
    "phonenumber": "{{phone_number}}",
    "email": "{{email}}"
 }
 
 

Success Response

Status code: 201

{
    "message": "Intent created successfully",
    "order_id": "",
    "merchant_order_reference": "",
    "status": "PENDING",
    "intent_url": "",
    "amount": 1.0,
    "merchant_payment_reference": "",
    "payment_id": "",
    "timestamp": "",
    "status_code": 201
 }

 

Error Response (401)

Status code: 401

{
    "detail": "Could not validate credentials"
 }

Other Error Responses

Status code: 400 - 600

{
    "code": "DUPLICATE_REQUEST",
    "message": "Duplicate Merchant Reference ID received"
 }
{
    "code": "INVALID_REQUEST",
    "message": "Amount must be an Integer value greater than or equal to 1"
 }

Step 3: Check Payment Status

Request

Success Response

Status code: 200

{
    "order_id": "",
    "merchant_order_reference": "",
    "order_type": "",
    "order_status": "",
    "order_amount": 1,
    "currency": "",
    "payment_method": "",
    "payer_vpa": ""
 }
 
 

Error Responses

Status code: 400 - 600

{
    "code": "INVALID_REQUEST",
    "message": "Order ID is invalid"
 }