POSTModify Order API
Use Case
OrderModify can be used by merchants to update certain details such as Order Amount, Goods Info, etc for a particular order ID. For example, a user adds a certain product in the cart for Rs. XXX amount. At this instance, if the user increases the item quantity in the cart, the total order amount gets updated. At this stage, the merchant needs to call the OrderModify API of AI Router which will update the Order Amount and the goods info on the same Order ID which was created during InitiateTransaction.
Key highlights:
- Merchants can call the Order Modify API only when the user has added the products to the cart and before the payment hit - No modification of the order is possible post-payment initiation.
- The total number of attempts for Order Modify API call is restricted to 5 times per order only.
Request Attributes
Head
Attribute | Description |
---|---|
channelId Enum optional | DeviceName from which request is sent. Possible Values: APP, WEB, WAP |
requestTimeStamp string optional | EPOCH timestamp of the time at which request is being sent. |
tokenType string mandatory | Token Type Eg. TXN_TOKEN |
token string mandatory | Transaction Token |
signature string optional | Paytm validates the request and ensures that parameters are not tempered by verifying the signature in the request. |
Body
Attribute | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
txnAmount Money optional | 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"} | ||||||||||||||||||||||||||||||||||||||||||||
TxnAmount +
| |||||||||||||||||||||||||||||||||||||||||||||
goodsInfo Array of GoodsInfo optional | This contain the goods info for an order | ||||||||||||||||||||||||||||||||||||||||||||
GoodsInfo +
| |||||||||||||||||||||||||||||||||||||||||||||
shippingInfo Array of ShippingInfo optional | This contain the shipping info for an order. | ||||||||||||||||||||||||||||||||||||||||||||
ShippingInfo +
| |||||||||||||||||||||||||||||||||||||||||||||
extendInfo Map optional | Merchant can pass any order specific information that is required to be passed here. |
Response Attributes
Head
Attribute | Description |
---|---|
responseTimestamp string | EPOCH timestamp of the time at which response is being sent. |
signature string | Paytm validates the request and ensures that parameters are not tempered by verifying the signature in the request. |
Body
Attribute | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
resultInfo string | This parameter gives the information about the result of the API response | ||||||||
resultInfo +
|
Response Codes & Messages
resultCode | resultStatus | resultMsg |
---|---|---|
0000 | S | Success |
1006 | F | token sent in request has expired or is invalid |
501 | F | System Error |
2013 | F | Different mid sent in create order request and modify order request. |
2014 | F | Different orderId sent in create order request and modify order request. |
1011 | F | Parameter illegal |
2222 | F | Invalid request body |
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 tokenType, etc |
1012 | F | param missing |
1111 | F | Order modification not allowed. Transaction already in process |
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 currency, etc |
2007 | F | Txn amount is invalid |
410 | F | order status is closed |
201 | F | order is paid |
curl --location --request POST 'https://stage-router.paytm.in/aoa-acquiring-biz/v2/modifyOrder?mid=YOUR_MID_HERE&orderId=Ravi1363' \
--header 'Content-Type: application/json' \
--data-raw '{"head": {"requestTimestamp": "2022-10-18T10:43:20+05:30","channelId": "WEB","token": "cb3db4af-3548-4eb7-bc03-0cd76173d447","tokenType": "TXN_TOKEN","signature": "CH"},"body": {"txnAmount": {"value": "3","currency": "INR"},"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": ""}}}