Create MOTO Order with Payments
Parameters from Create Order API and Payments API can be used in this API.
Please refer to the specification document of individual APIs. Parameters from Create Order API need to be included in the format order.<parameter_name>
For example, order.metadata.JUSPAY:gateway_reference_id
If you are a PCI-compliant merchant, you can combine the Create Order API request with the Payments API request in a single API request.
The sample request and response are shown below.
Consists of two parts.
Username: API Key obtained from Juspay dashboard
Password: Empty string
Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
Merchant ID provided by Juspay
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.
This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.
Example:- customer_1122
Unique Identifier for the order. Should be Alphanumeric with character length less than 21.
Example:- order-id-9876580
The amount that the customer has to pay. Will accept stringified double or integer values with up to two decimal places.
Example:- For example, "100.15" and "100" are valid input but "100.1532" is not valid.
It is the ID with which merchant refers to a customer object. This id is used to access the stored payment methods, allow EMI transactions and setup subscriptions.
In case of guest login it should be an empty string.
Example:- customer-id-007
Email address of the customer. If the backend gateway requires it, then you must send this value.
Example:- test@gmail.com
Mobile number or fixed line number of the customer. If the backend gateway requires it, then you must send this value.
Example:- 9999999912
ISO string of the currency. Use INR for the Indian Rupee. Among other accepted values are EUR, USD, GBP. Default value: INR
A fully qualified URL which the customer will be redirected after payment completion. It is also required to provide the control back to SDK after the completion of transaction. This URL shouldn't contain any query parameters or Ip address. This URL takes higher precedence over the common return URL configured in your account settings.
Example:- https://shop.merchant.com
ID of the merchant_account that you hold with us.
Depending on type of payment to be processed.
Example:- CARD
One of VISA/MASTERCARD/MAESTRO/AMEX/RUPAY. This is usually inferred from the card number itself and we will take care of this if you are unable to provide this from your end.
A valid card token is obtained using /card/list API. If you send this parameter, then card_number, name_on_card, card_exp_year, card_exp_month fields are not required.
A valid credit/debit card number
Either card_number or card_token is requried.
Card holder name. Should contain alphabetical characters only.
Represent the expiry year of the card as YY (two digits only) Required if you are passing card_number instead of card_token
Represent the expiry month of the card as MM (two digits only) Required if you are passing card_number instead of card_token
CVV of the card. Usually three digits. Optional for all VISA saved cards, SODEXO saved cards, and saved cards of select issuing banks of MASTERCARD
This is a boolean variable and accepts true/false. We recommend that you set this to true and use the redirection flow. If set to true, then the user is redirected to the return_url configured for the order. If set to false, then the user will be stopped at the response page from the gateway. Your client should be able to read the page/title to infer that the user has completed the transaction.
If it is set to json, then the response will be HTTP 200 with a JSON formatted text. Otherwise, the response is HTTP 302 with the Location attribute having the destination URL.
Pass this parameter with value MOTO to indicate a direct debit is expected.
Example:- MOTO
Example:- Bad Request
Example:- invalid_request_error
Example:- Can't find a suitable gateway to process the transaction

