search

POSTSave Template API

Use Case

  • Use this API to create or update a template
  • Using this API you can create and add different form fields to the template
  • You can set field constraints and add help text for the input fields
  • The supported field types are numeric, alphanumeric, dropdown, calendar and amount

Request Attributes

Content Type : JSON

Head

AttributeDescription
timestamp
string(15)
optional

EPOCH timestamp of the time at which request is being sent.
Example: 1588402269

clientId
string(3)
optional

Paytm use the merchant key on the basis of clientId parameter value. It requires only if the merchant has more than one key.

Example: C11

version
string
optional

Version of the API.

Example: v2

channelId
string(3)
optional

The parameter value identifies the Channel for which API call is initiated.

Possible values:
WEB
For websites, the value to be passed should be "WEB"
,
WAP
For Mobile websites/App, the value to be passed should be "WAP"
tokenType
string
mandatory

This parameter identifies whether the API works on checksum authentication. The value to be sent in tokenType is 'AES' for this API.

signature
string(108)
mandatory

Paytm validates the request and ensures that parameters are not tempered by verifying the signature in the request. For creating the checksum (signature) refer to the steps given in Checksum Logic.
Note: Create the signature using the body parameter of the request.

Body

AttributeDescription
mid
string(20)
mandatory

Paytm provides MID as a unique identifier to each merchant. For your staging MID, click here. You get the production MID post the account activation.

Example: INTEGR7769XXXXXX9383

templateId
string
optional

Template ID unique to a form template

Use: Edit Form Details and Fields

templateName
string
mandatory

Template name

templateInfo
string
mandatory

Information about the template

fields
object
mandatory

List of multiple fields

Fields
+
AttributeDescription
name
string
optional

Field name

type
string
optional

Type of field
(Text, Date, Numeric, Dropdown)
For Amount: Amount, QuantityAmount

displayText
string
optional

Field display text

helpText
string
optional

Help text for field

constraints
object
optional

Constraints for a field which will be apply in input

Constraints
+
AttributeDescription
maxLength
string
optional

Character maximum length in this field - Text & Numeric Only

minLength
string
optional

Character minimum length in this field - Text & Numeric Only

maxValue
string
optional

Maximum value of this field - Date & Numeric Only

minValue
string
optional

Minimum value of this field - Date & Numeric Only

allowedValues
string
optional

Multiple values of this field - Dropdown Only
 

Example: ["Male","Female"]

beforeTransaction
boolean
optional

Conditional field (it will use before transaction or not) - Date Only

value
string
optional

Amount value
For Fixed and Quantity Amount

minQuantity
string
optional

Minimum Quantity - For Quantity Amount

maxQuantity
string
optional

Maximum Quantity - For Quantity Amount

orientation
string(H, V)
optional

To be displayed vertical or horizontal with respect to previous field
H: Horizontal
V: Vertical

size
string
optional

Size percentage in which field box will be displayed

isEditable
boolean
optional

Field which can be edited by merchant

display
boolean
optional

Field which will be displayed in suggested Fields

mandatory
boolean
optional

Field which will be mandatory while payment

Response Attributes

Content Type : JSON

Head

AttributeDescription
timestamp
string(15)

EPOCH timestamp of the time at which response is being sent.
Example: 1588402269

clientId
string(3)

Paytm use the merchant key on the basis of clientId parameter value. It requires only if the merchant has more than one key.

Example: C11

version
string(2)

Version of the API passed in the request.
Example: v1

channelId
string(3)

The parameter value identifies the Channel for which API call is initiated.

Possible values:
WEB
For websites, the value to be passed should be "WEB"
,
WAP
For Mobile websites/App, the value to be passed should be "WAP"
tokenType
string

This parameter identifies whether the API works on checksum authentication. The value to be sent in tokenType is 'AES' for this API.

signature
string(108)

Paytm validates the request and ensures that parameters are not tempered by verifying the signature in the request. For creating the checksum (signature) refer to the steps given in Checksum Logic.
Note: Create the signature using the body parameter of the request.

Body

AttributeDescription
resultInfo
object

This parameter gives the information about the result of the API response

ResultInfo
+
AttributeDescription
resultCode
string

This is the resultCode corresponding to a particular message and is returned to the merchant. It's maximum length is 64. The different result codes corresponding to this API are mentioned below.

resultStatus
string

This parameter indicates the status of API call.

 

Possible Values: SUCCESS, FAILED

resultMessage
string(256)

This parameter is the result message which contains information about the result.The different result messages corresponding to this API are mentioned below.
 

Response Codes & Messages

resultCoderesultStatusresultMessage
LF_001SUCCESSSuccess
LF_002FAILEDInvalid Request
501FAILEDInternal Server Error
502FAILEDUnknown Error Occurred
5004FAILEDempty merchant Id.
5028FAILEDChecksum provided is invalid.
5029FAILEDrequest body cannot be empty
5030FAILEDrequest head cannot be empty
⇾
Staging
Production
https://securestage.paytmpayments.com/link/form/saveUpdateTemplatecopy icon
REQUEST
RESPONSE
CURL
JAVA
NODE
PHP
PYTHON
DOTNET
curl - X POST 'https://securestage.paytmpayments.com/link/form/saveUpdateTemplate'\
    --header 'Content-Type: application/json'\
    --data '{"body":{"mid":"{mid}","templateName":"Test","templateInfo":"Test Template","fields":[{"name":"Name","type":"Text","displayText":"Enter text","helpText":"Name","orientation":"H","isEditable":1,"display":{"field-display":true},"mandatory":1, "size":"40","constraints":{"maxLength":"100","minLength":"2"}}]},"head":{"tokenType":"AES","signature":"{signature}"}}'
copy icon