Create Order with Payments

This API creates an order and initiates the transaction consecutively. Both order creation parameters and payment details must be passed in this API. Parameters need to included in format order.<parameter_name>. For example, order.metadata.JUSPAY:gateway_reference_id.

Scroll inside to view more
Supported Card Brands
payment_method
Sodexo
SODEXO
Mastercard
MASTER
Visa
VISA
Rupay
RUPAY
American Express
AMEX
Discover
DISCOVER
Diners
DINERS
Maestro
MAESTRO
JCB
JCB
BAJAJ Cards
BAJAJ
KNEt Cards
KNET
MADA Cards
MADA
QPay Cards
QPAY
QWIKCILVER Gift Cards
QWIKCILVER
China UnionPay
UNIONPAY
API Endpoints
Sandbox Link
POST
https://sandbox.juspay.in/txns
Production Link
POST
https://api.juspay.in/txns
Authorization Header
Headers
Body
200 : Success
400 : Invalid Input data

Error Codes:

Scroll inside to view more
Scenario
Error Codes
Sample Error Message
Not passing the currency value
400
{"error_message":"Bad Request.","status":"Bad Request","error_code":"INVALID_REQUEST","error_info":{"user_message":"Invalid input data","fields":[{"field_name":"currency","reason":"Missing field or Invalid Value"}],"developer_message":"Invalid input data","code":"INVALID_INPUT","category":"USER_ERROR"}}
Not passing the amount value
400
{"error_message":"Bad Request.","status":"Bad Request","error_code":"INVALID_REQUEST","error_info":{"user_message":"Invalid input data","fields":[{"field_name":"amount","reason":"Missing field or Invalid Value"}],"developer_message":"Invalid input data","code":"INVALID_INPUT","category":"USER_ERROR"}
Passing the amount in negative Integer
400
{"error_message":"Bad Request.","status":"Bad Request","error_code":"INVALID_REQUEST","error_info":{"user_message":"Invalid input data","fields":[{"field_name":"amount","reason":"Invalid amount"}],"developer_message":"Invalid input data","code":"INVALID_INPUT","category":"USER_ERROR"}}
Passing the amount in Positive Integer
400
{"error_message":"BadRequest.","status":"Bad Request","error_code":"INVALID_REQUEST","error_info":{"user_message":"Invalid input data","fields":[{"field_name":"amount","reason":"Missing field or Invalid Value"}],"developer_message":"Invalid input data","code":"INVALID_INPUT","category":"USER_ERROR"}}
Not passing the customer_email
400
{"status":"error","error_code":"invalid_request","error_info":{"user_message":"Invalid customer Email","fields":[{"field_name":"customerEmail","reason":"Invalid value."}],"developer_message":"customerEmail shouldn't have any special chars","code":"INVALID_INPUT","category":"USER_ERROR"}}
Not passing the orderId
400
{"error_message":"order_id is missing","status":"Bad Request","error_code":"order_id is missing","error_info":{"user_message":"Please pass order_id in request","fields":[{"field_name":"order_id","reason":"Missing field."}],"developer_message":"order_id is missing in request","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}}
Not passing API key
403
{"error":true,"error_message":"Forbidden.No valid API key or client auth token is present in Authorization header or client_auth_token query parameter","user_message":"Access Denied.Unable to proceed.","userMessage":"Access Denied.Unable to proceed.","error_info":{"code":"UNAUTHORIZED","category":"USER_ERROR","user_message":"AccessDenied","developer_message":"No valid API key or client auth token is present in Authorization header or client_auth_token query parameter"}}
Invalid API key
401
{"status":"error","error_code":"access_denied","error_info":{"user_message":"Unauthorized.","developer_message":"Invalid API Key.Please pass a valid and active apikey.","code":"UNAUTHORIZED","category":"USER_ERROR"}}
Whitelisting of IP in dashboard
403
{"error":true,"error_message":"Internal Server error.","user_message":"Bad Origin.","error_info":{"code":"BAD_ORIGIN","category":"USER_ERROR","user_message":"Bad Origin.","developer_message":"IP Verification Failed"}}
Passing amount as 0(without Juspay internal enablement)
400
{"error_message":"Bad Request.","status":"ERROR","error_code":"INVALID_REQUEST","error_info":{"user_message":"Invalid input data","fields":[{"field_name":"amount","reason":"Invalid amount"}],"developer_message":"Invalid input data","code":"INVALID_INPUT","category":"USER_ERROR"}}'
Passing a non configured currency
400
{"error_message":"Can't find a suitable gateway to process the transaction","status":"Bad Request","error_code":"invalid_request_error","error_info":{"user_message":"Gateway not found to process the transaction request.","developer_message":"No functional gateways after filtering for currency THB","code":"GATEWAY_NOT_FOUND","category":"CONFIG_ERROR"}}
Not passing payment method
400
{"error_message":"Payment method type cannot be null","status":"invalid_request_error","error_code":"missing_payment_method_type","error_info":{"user_message":"Please pass payment method type in the request.","fields":[{"field_name":"payment_method_type","reason":"Missing field."}],"developer_message":"Missing payment method type in the request. Payment method type is a mandatory parametere.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}}
Not passing payment method type
400
{"error_message":"Payment method cannot be null","status":"invalid_request_error","error_code":"missing_payment_method","error_info":{"user_message":"Cannot process your request. Please contact support team for assistance.","fields":[{"field_name":"payment_method","reason":"Missing field."}],"developer_message":"Missing payment method. Payment method is required for provided payment method type.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}}
For New card - Transaction without passing card number
400
{"error_message":"Card number is required.","status":"invalid_request_error","error_code":"missing_card_number","error_info":{"user_message":"Please enter a valid card number.","fields":[{"field_name":"card_number","reason":"Missing field."}],"developer_message":"Missing card number.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}}
Not passing merchant_id field
400
{"error_message":"Bad request.","status":"ERROR","error_code":"Bad request.","error_info":{"user_message":"Bad request.","fields":[{"field_name":"merchant_id","reason":"Field required but not passed."}],"developer_message":"Failed while parsing your request.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}}
Transaction without passing card_security_code field
400
{"error_message":"Can't find a suitable gateway to process the transaction","status":"Bad Request","error_code":"invalid_request_error","error_info":{"user_message":"Gateway not found to process the transaction request.","developer_message":"No functional gateways supporting this transaction.","code":"GATEWAY_NOT_FOUND","category":"CONFIG_ERROR"}}
Not passing card expiry year
400
{"error_message":"Bad request.","status":"ERROR","error_code":"Bad request.","error_info":{"user_message":"Bad request.","fields":[{"field_name":"merchant_id","reason":"Field required but not passed."}],"developer_message":"Failed while parsing your request.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}}
Invalid card number
400
{"error_message":"Card number is invalid.","status":"invalid_request_error","error_code":"invalid_card_number","error_info":{"user_message":"Cannot process your request. Please contact support team for assistance.","fields":[{"field_name":"card_number","reason":"Invalid value."}],"developer_message":"Invalid card number. Card number should contain only digits and should pass luhn check.","code":"INVALID_INPUT","category":"USER_ERROR"}}
Invalid card expiry month
400
{"error_message":"Invalid expiry month.","status":"invalid_request_error","error_code":"invalid_expiry_month","error_info":{"user_message":"Please enter valid card expiry month.","fields":[{"field_name":"card_exp_month","reason":"Invalid value."}],"developer_message":"Invalid card expiry month. Expiry month cannot be greater than 12 and less than 1","code":"INVALID_INPUT","category":"USER_ERROR"}}
Invalid card expiry year
400
{"error_message":"Card already expired.","status":"invalid_request_error","error_code":"card_expired","error_info":{"user_message":"Card expired.","developer_message":"Card expired. Card expiry year/month cannot be less than current year/month.","code":"INVALID_INPUT","category":"USER_ERROR"}}
For pre-auth and capture, Transaction without passing pre_auth_enabled field
400
{"error_message":"Bad request.","status":"ERROR","error_code":"Bad request.","error_info":{"user_message":"Bad request.","fields":[{"field_name":"merchant_id","reason":"Field required but not passed."}],"developer_message":"Failed while parsing your request.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}}
Last updated 9 months ago