POSTCreate Order API
Use Case
To start a payment transaction, merchants first need to call this API, this API will return the transaction token as well as create a new order in the AI router system. This transaction token and the order id will be used in the subsequent APIs for transaction processing.
Request Attributes
Head
Attribute | Description |
---|---|
requestTimeStamp string optional | EPOCH timestamp of the time at which request is being sent. |
channelId Enum optional | The parameter value identifies the Channel for which the API call is initiated. Possible values: APP , WEB , WAP |
signature string conditional | AI router validates the request and ensures that parameters are not tempered by verifying the signature in the request.
|
Body
Attribute | Description | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
requestType Enum mandatory | This parameter is used to identify the transaction flow. Possible Values: SUBSCRIPTION, PAYMENT | ||||||||||||||||||||||||||||||||||||||||||
mid string mandatory | AI router provides MID as a unique identifier to each merchant.
Example: 216820000002516036253 | ||||||||||||||||||||||||||||||||||||||||||
orderId string mandatory | The Unique reference ID of the Order. It is alphanumeric and max length is 50 characters. Example: OREDRID_98765 | ||||||||||||||||||||||||||||||||||||||||||
txnAmount object mandatory | This parameter is of return type Money and should contain the value of transaction i.e. amount and currency type. Example: {"value" : "1.00", "currency" : "INR"} | ||||||||||||||||||||||||||||||||||||||||||
Money +
| |||||||||||||||||||||||||||||||||||||||||||
userInfo object mandatory | User information contains user details like customer ID, email, phone number etc. | ||||||||||||||||||||||||||||||||||||||||||
UserInfo +
| |||||||||||||||||||||||||||||||||||||||||||
enablePaymentMode Array of PaymentMode optional | List of the payment modes which need to be enabled. If the value provided then only listed payment modes are available for transaction Example:[{"mode" : "CREDIT_CARD", "channels" : ["VISA" ,"MASTER"],"banks":[ "ICICI" , "SBI" ]}] | ||||||||||||||||||||||||||||||||||||||||||
PaymentMode +
| |||||||||||||||||||||||||||||||||||||||||||
disablePaymentMode Array of PaymentMode optional | List of the payment modes which need to be disabled. If the value provided then all the listed payment modes are unavailable for transaction. Example: [{"mode" : "CREDIT_CARD", "channels" : ["VISA" ,"MASTER"],"banks":[ "ICICI" , "SBI" ]}] | ||||||||||||||||||||||||||||||||||||||||||
PaymentMode +
| |||||||||||||||||||||||||||||||||||||||||||
callbackUrl string optional | AI router sends the response of the transaction on the URL which comes in the callbackUrl parameter.
| ||||||||||||||||||||||||||||||||||||||||||
goodsInfo Array of GoodsInfo optional | This contain the goods info for an order | ||||||||||||||||||||||||||||||||||||||||||
GoodsInfo +
| |||||||||||||||||||||||||||||||||||||||||||
shippingInfo Array of ShippingInfo optional | This contains the shipping info for an order. | ||||||||||||||||||||||||||||||||||||||||||
ShippingInfo +
| |||||||||||||||||||||||||||||||||||||||||||
extendInfo Map optional | Merchants can pass any order specific information that is required to be passed here. | ||||||||||||||||||||||||||||||||||||||||||
ssoToken object optional | This is a unique token linked with the user's Paytm wallet and is provided in the response while linking the user's Paytm wallet. | ||||||||||||||||||||||||||||||||||||||||||
SsoToken +
| |||||||||||||||||||||||||||||||||||||||||||
integrationType Enum optional | Possible value: CUSTOM_CHECKOUT, JS_CHECKOUT , SDK, UNKNOWN | ||||||||||||||||||||||||||||||||||||||||||
gatewayInfo Map optional | Information related to gateway | ||||||||||||||||||||||||||||||||||||||||||
websiteName string mandatory | websiteName is the key to extract the static callbackUrl defined for merchants at AI router. This is provided by AI router.
| ||||||||||||||||||||||||||||||||||||||||||
peonUrl string optional | AI router sends the notification of transaction on the URL which comes in the peonUrl parameter. | ||||||||||||||||||||||||||||||||||||||||||
txnRoutingParams Map<String,Object> optional | Routing Configuration Input entered for the Enforced routing rule creation must be passed here for the Routing rule adherence.
|
Response Attributes
Head
Attribute | Description |
---|---|
responseTimestamp string | EPOCH timestamp of the time at which response is being sent. |
signature string | AI router validates the request and ensures that parameters are not tempered by verifying the signature in the request. |
Body
Attribute | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
txnToken string | This is the unique transaction token received in the response of Create Order API. It is valid for 15 minutes. | ||||||||
resultInfo object | This parameter gives the information about the result of the API response | ||||||||
resultInfo +
| |||||||||
extraParamsMap Map | Map for any extra information (in case of error). |
Response Codes & Messages
resultCode | resultStatus | resultMsg |
---|---|---|
0000 | S | Success |
501 | F | System Error |
2013 | F | Mid in the query param doesn’t match with the Mid sent in the request |
2014 | F | OrderId in the query param doesn't match with the orderId sent in the request |
1001 | F | Request parameters are not valid Note: If the value is not valid in the request parameter then the result message should be in the format of "Invalid {field name}" For example: Invalid requestType, Invalid currency, etc |
1007 | F | Missing mandatory element |
2007 | F | Txn amount is invalid |
2006 | F | Mid is invalid |
324 | F | Duplicate Order Id |
1011 | F | Parameter illegal Note: If the value is not allowed in request parameters then the result message should be in the format of "Parameter '[field name]' has invalid value '[value]'" For example: If we will send PAYMENT1(invalid value) in requestType in create order request then the result message should be "Parameter '[body->requestType]' has invalid value '[PAYMENT1]'" |
2012 | F | OrderId is invalid |
2222 | F | Invalid request body |
2005 | F | Checksum provided is invalid |
1012 | F | Param missing |
curl --location --request POST 'https://stage-router.paytm.in/aoa-acquiring-biz/v2/order?mid=YOUR_MID_HERE&orderId=Ravi1366' \
--header 'Content-Type: application/json' \
--data-raw '{"body": {"requestType": "PAYMENT","websiteName":"retail","peonUrl":"/paytm","mid": "YOUR_MID_HERE","orderId": "Ravi1366","txnAmount": {"value": "1","currency": "INR"},"userInfo": {"custId": "cus0012","mobile": "7000000003","email": "abc@gmail.com","firstName": "Ravi","lastName": "Ranjan"},"callbackUrl": "https://pgp-automation.paytm.in/mockbank/MerchantSite/bankResponse","goodsInfo": [{"merchantGoodsId": "24525635625623","merchantShippingId": "564314314574327545","snapshotUrl": "[http://snap.url.com ]","description": "description","category": "travelling/subway","quantity": "3.2","unit": "Kg","price": {"currency": "INR","value": "199"},"extendInfo": {"udf1": "","udf2": "","udf3": "","udf4": "","udf5": ""}}],"shippingInfo": [{"merchantShippingId": "564314314574327545","trackingNo": "646431431322332133","carrier": "Federal Express","chargeAmount": {"currency": "INR","value": "1"},"countryName": "JP","stateName": "GA","cityName": "Atlanta","address1": "137 W San Bernardino","address2": "4114 Sepulveda","firstName": "Jim","lastName": "Li","mobileNo": "13765443223","zipCode": "310001","email": "abc@gmail.com"}],"extendInfo": {"udf1": "abc","udf2": "def","udf3": "xyz","mercUnqRef": "","comments": ""},"integrationType":"JS_CHECKOUT"}}'