Order API Flow (Request and Response)

Payment Processing Flow ??

Steps:

  • Create an order with the mandatory fields from OrderRequest.

  • Once the Order is created , orderkeyid and PaymentProcessUrl will be provided as a response as part of the order creation - which redirects the user/customer to the Process payment page.

  • Customer chooses the payment type and provides the details.

  • Payment is processed and redirects to the url provided in the RedirectUrl parameter of the OrderRequest.

  • Payment details can be obtained by making a call to the Detail API

  • Order can be updated in 10days with customer information and shipping details after payment completion.

Required headers:

Header Name Header Value
Authorization
required
basic PayGAuthentication
PayGAuthentication = base64encoded(MerchantAuthenticationKey:MerchantAuthenticationToken:M:MID)
OR generate Authorization Header value in PayG Dashboard.
Content-Type
required
application/json

Order Request: ??

Merchantkeyid
required
integer Please get this merchantkeyid from PayG Dashboard
MID
required
integer Id which is obtained on MerchantRegistration
UniqueRequestId
required
string(10) Unique Id generated for that particular Request and it should not be repeated, alphanumeric only.
OrderAmount
required
decimal(18,2) Transaction Amount - This amount will be shown to user for payment.
ProductData
required
string - Json Object Product/Service detail related to the order, please review ProductData for more detail and example
CustomerData
required
CustomerData object Customer detail - billing, shipping, Please refer CustomerData for more detail.
IntegrationData
required
IntegrationData Object Required few details like username, source, integration type etc, Please refer IntegrationData for more detail.
IntegrationData
required
IntegrationData Object Required few details like username, source, integration type etc, Please refer IntegrationData for more detail.
OrderType string- Specificed Data only Default - PAYMENT, FUTUREBILLING
OrderId string(20) OrderNo/Id from merchant system , alphanumber only.
OrderAmountData List of AmountDetail Please see contents below AmountDetail
NextStepFlowData string - Json Object what will be next step for user information after payment is completed, please review NextStepFlowData for more detail and example
TransactionData TransactionData Object Specific payment type - used for upi intent, seamless- please review TransactionData for more detail and example
UserDefinedData UserDefinedData Object List user defined custom objects. Please refer UserDefinedData for detail and example
RequestDateTime datetime MMDDYYYY
RedirectUrl url Redirect url given by the merchant after transaction
Note: ProductData, Nextstepflowdata should be in JsonObject converted to string.

AmountDetail: ??

Note: If OrderAmountData is provided then the total OrderAmountData should be equal to OrderAmount
AmountTypeDesc string(20) description of the order amount
Amount decimal(18,2) Order Amount

ProductData Object: ??

Note: Product/service detail of the order, this detail will be displayed on payment page (by default, and can be configured, please check settings in merchant portal) and the transaction reciept.
example "ProductData":"{'PaymentReason':'OnlineOrder for OrderNo- 1234', 'ItemId':'T-shirt', 'Size':'medium', 'AppName':'yourAppName'}"
Suggestion: please refer below table contents as suggestion and you can add as per your requirement. however it should be valid json object
PaymentReason string(50) Reason for this payment
ServiceType string(50) Type of the service
ProductName string(50) Name of the product

TransactionData: ??

Seamless for UPI, Netbanking and Wallets:
UPI : PaymentType:"UPI", VPA is required
Upi Intent: PaymentType as "UPIINTENT", IPAddress is required and IntegrationData
PaymentType Specified Data Payment Mode - NetBanking, UPI, UPIINTENT, Wallet
IndustrySpecificationCode string(20)
PartialPaymentOption specified value - True/false to accept partial payment from user, if true then user will able to moedify amount before payment and order will be marked as partial paid after approval of transaction.

Payment Type - UPI:

Note: If TransactionData PaymentType is UPI, please refer below
Vpa
required
string(50) UPI ID/ virtual address of payer - example ramchandra@upi
AccountNumber# string Bank Account Number
Ifsc# string Bank Ifsc Code
AadhaarNo# string Account holder AadhaarNo

Payment Type - Netbanking:

Note: If TransactionData PaymentType is Netbanking, please refer below
BankName
required
string - Specificed Data BankCode for Netbanking, example - PG0001 for Allahabad Bank- Retail
Please refer for Bank Code list

Payment Type - Wallet:

Note: If TransactionData PaymentType is Wallet, please refer below
WalletType
required
string - Specificed Data Wallet Type , example - PayTm, PhonePe
Please refer for Wallet Type list
username# string User mobile no or login id

CustomerData: ??

MobileNo
required
Number(10) Contact number of the customer
CustomerId string(10 ) Id of the customer
CustomerNotes string(200 ) Any considerations mentioned by customer
FirstName string(20) First Name of the customer
LastName string(20) Last Name of the customer
EmailReceiptEmail bool True / False
BillingAddress string(100) Address on which the bill is generated
BillingCity string(20) Billing city of the customer
BillingStatety string(20) Billing state of the customer
BillingCountry string(20) Billing country of the customer
BillingZipCode string(20) Zip code of the billing address
ShippingFirstName string(20) First name of the customer in shipping address
ShippingLastName string(20) Last name of the customer in shipping address
ShippingAddress string(100) Address on which the bill is generated
ShippingCity string(20) shipping city of the customer
ShippingState string(20) shipping state of the customer
ShippingCountry string(20) shipping country of the customer
ShippingZipCode string(20) Zip code of the shipping address
ShippingMobileNo number(10) Mobile no. of the customer in shipping address

UserDefinedData(Object) : ??

Note: Supports upto 20 user defined object. By default pass blank value in each key.
example: "UserDefinedData": { "UserDefined1": ""}
UserDefined1 string(50)
UserDefined2 string(50)
UserDefined3 string(50)
UserDefined4 string(50)
UserDefined5 string(50)
UserDefined6 string(50)
UserDefined7 string(50)
UserDefined8 string(50)
UserDefined9 string(50)
UserDefined10 string(50)
UserDefined11 string(50)
UserDefined12 string(50)
UserDefined13 string(50)
UserDefined14 string(50)
UserDefined15 string(50)
UserDefined16 string(50)
UserDefined17 string(50)
UserDefined18 string(50)
UserDefined19 string(50)
UserDefined20 string(50)

IntegrationData(Object): ??

Source
required
string(20) Application Name and Version.
Source name should be "MobileSDK" if the integration type is 11.
IntegrationType
required
string(10) // 0 or null default, 1 Seamless - CardNumber should be encrypted and merchant should be enabled for seamless,
11 - Mobile integration
UserName string(20) Username of the customer
HashData string(250) Hash for request data
PlatformId string(10) Integrated Distributor ID - Platform
IPAddress string(250) IP address of the Merchant's server.
If PaymentType is UPIINTENT, IPAddress is required

OrderResponse: ??

OrderKeyId
string(30) Id generated based on the create order request from PayG and should be stored in your system for status, verification or any communication with PayG.
MerchantKeyId
integer Id which is obtained on MerchantRegistration
UniqueRequestId
string(20) Echo from request
OrderAmount
decimal(18,2) Transaction Amount
OrderStatus
string(10) Status of the order. Please refer for Order Status Codes
OrderStatusText
string(50) Order Status Text ex: created, completed-approved transaction,cancelled payment by user. Please refer Order Status Code for any programming decision
PaymentTransactionId
string(50) Id generated for that transaction
PaymentResponseCode
int Payment Status of the order. Please refer for Payment Response Codes
PaymentApprovalCode
string(20) Unique number identifying the Approved transaction
PaymentResponseText
string(50) eg: created, completed-approved transaction,cancelled payment by user
PaymentMethod
string Specified Values Transaction processed as
PaymentAccount
string(50) Payment processed account detail. Data depending on PaymentMethod. if processed as
UPI - then VPA /UPI ID,
Credit/DebitCard - then Card number first 6 and last 4 of card ,
Netbanking - then BankName,
Wallet - then Wallet Name like PayTM, PhonePe etc
PaymentProcessUrl*
url PayG payment url for customer to pay, you need to redirect to this url for payment processing.
OrderType string(20) Echo from request
OrderId string(20) Echo from request
OrderNotes string(100) Risk and Security Notes - if you see detail in this, make sure to address with business team as soon as possible
PaymentDateTime datetime Time & Date of the payment
UpdatedDateTime datetime Updated time & date of the payment
OrderPaymentCustomerData object of CustomerData if user have changed their customer data on payG payment page while transaction processing, updated data will be provided in this.

OrderStatusRequest: ??

Note: Order status can be checked once order is created.
OrderKeyId
required
string(30) OrderKeyId generated based on the create order request
MerchantKeyId
required
integer MerchantKeyId obtained on Merchant registration
PaymentTransactionId
required
string(50) PaymentTransactionId generated for specific transaction provided by PayG system
PaymentType
required
string(20) Identifies the type of the payment., eg:Credit/debit/upi,etc

Validation Error Response: ??

Note: Due to any invalid input values or invalid configuration, response will be provided as validation errors
ResponseCode int
Code string Defined ErrorCode
Message string Error Description
FieldName string Name of invalid field if error due to data issue
DeveloperMessage string Message for developers to understand issue, mostly configuration issue detail will be available in this field
MoreInfoUrl string Url to learn more about this issue
RequestUniqueId string Echo from request
Sample
  
 Authorization: basic YTVhZWNlNTg3NWEwNDA0NGJmZjQ5MWRlNzM0MWVmNGE6ZTJkYTI2MTYxYjRiNDhmYzk1YjU5ZGFmMjE5MWZiMzM6TTo3Nzcx 
 Content-Type: application/json
   
                         
                         
    {
    "MID":"Your MID - Provided by PayG",
    "UniqueRequestId":"f3f5b5c13h",
    "UserDefinedData":{
        "UserDefined1":""
    },
    "ProductData":"{
        'PaymentReason':'OnlineOrder for OrderNo- 1234', 
        'ItemId':'T-shirt', 
        'Size':'medium', 
        'AppName':'yourAppName'
    }",
    "RequestDateTime":"06232021",
    "RedirectUrl":"https://payg.in",
    "TransactionData":{
        "AcceptedPaymentTypes":"",
        "PaymentType":"",
        "SurchargeType":"",
        "SurchargeValue":"",
        "RefTransactionId":"",
        "IndustrySpecificationCode":"",
        "PartialPaymentOption":""
    },
    "OrderAmount":"100",
    "OrderType":"",
    "OrderAmountData":{
        "AmountTypeDesc":"3",
        "Amount":"2"
    },
    "CustomerData":{
        "CustomerId":"152433",
        "CustomerNotes":"Mens clothing",
        "FirstName":"ravi",
        "LastName":"sharma",
        "MobileNo":"7337327109",
        "Email":"test@gmail.com",
        "EmailReceipt":"true",
        "BillingAddress":"44 bhagvan nagar",
        "BillingCity":"orissa",
        "BillingState":"orissa",
        "BillingCountry":"India",
        "BillingZipCode":"30202020",
        "ShippingFirstName":"ravi",
        "ShippingLastName":"sharma",
        "ShippingAddress":"44 bhagvan nagar",
        "ShippingCity":"orissa",
        "ShippingState":"orissa",
        "ShippingCountry":"India",
        "ShippingZipCode":"30202020",
        "ShippingMobileNo":"7337327109"
    },
    "IntegrationData":{
        "UserName":"ravi",
        "Source":"3213",
        "IntegrationType":"",
        "HashData":"",
        "PlatformId":"1"
    }
    }
  
 }
   
  
       
        {
            "OrderKeyId":"210923M8340Uf3f5b5c13h",
            "MerchantKeyId":8340,
            "UniqueRequestId":"f3f5b5c13h",
            "OrderType":"PAYMENT",
            "OrderAmount":100.0,
            "OrderId":null,
            "OrderStatus":null,
            "OrderPaymentStatus":0,
            "OrderPaymentStatusText":null,
            "PaymentStatus":0,
            "PaymentTransactionId":null,
            "PaymentResponseCode":0,
            "PaymentApprovalCode":null,
            "PaymentTransactionRefNo":null,
            "PaymentResponseText":null,
            "PaymentMethod":null,
            "PaymentAccount":null,
            "OrderNotes":null,
            "PaymentDateTime":null,
            "UpdatedDateTime":null,
            "PaymentProcessUrl":"https://uat.payg.in/payment/payment?orderid=210923M8340Uf3f5b5c13h",
            "OrderPaymentCustomerData":{
                "FirstName":"ravi",
                "LastName":null,
                "Address":null,
                "City":null,
                "State":null,
                "ZipCode":null,
                "Country":null,
                "MobileNo":"7337327109",
                "Email":"test@gmail.com",
                "UserId":null,
                "IpAddress":null
            },
            "UpiLink":null,
            "OrderPaymentTransactionDetail":null,
            "UserDefinedData":{
                "UserDefined1":"",
                "UserDefined2":null,
                "UserDefined3":null,
                "UserDefined4":null,
                "UserDefined5":null,
                "UserDefined6":null,
                "UserDefined7":null,
                "UserDefined8":null,
                "UserDefined9":null,
                "UserDefined10":null,
                "UserDefined11":null,
                "UserDefined12":null,
                "UserDefined13":null,
                "UserDefined14":null,
                "UserDefined15":null,
                "UserDefined16":null,
                "UserDefined17":null,
                "UserDefined18":null,
                "UserDefined19":null,
                "UserDefined20":null
            }
        }