Order & Transaction
Every payment done via Juspay systems has 2 components:
1. Order - Represented by OrderId
2. Transaction - Represented by TransactionId
Order
An order is a representation of your shopping cart. It is something for which you want to collect payment for. The order contains important information like amount, customer details, shipping address, billing address, etc. Only after an order is created payment can be started. For detailed instructions on Order Status Handling, refer here
Transaction
For every payment attempt against an order, Juspay creates a transaction. Payment Attempt is when user selects a payment method and confirms to go ahead with the payment
Each transaction is represented by a transactionId.
Transaction ID = MerchantID - Order ID - Transaction Attempt Counter
Example of a Transaction ID for a Merchant with Merchant ID ‘TestMerchant’:
TestMerchant-OrderIDLessThan21-1
Against 1 order there can be maximum 25 transactions
Payment Retry
By default, Juspay allows multiple transactions to be created against an Order. When you get users to retry the payment in event of an unsuccessful transaction, if the retry is done against an existing orderId, Juspay creates a new transactionId against the same orderId by increasing the Transaction Attempt Counter.
Refer below table for example
|
MerchantId
|
OrderID
|
Payment Attempt
|
Resultant Transaction Id
|
|---|---|---|---|
TestMerchant
| order1
| 1st Attempt
| TestMerchant-order1-1
|
TestMerchant
| order1
| 2nd Attempt
| TestMerchant-order1-2
|
TestMerchant
| order1
| 3rd Attempt
| TestMerchant-order1-3
|
An order is marked CHARGED(equivalent to Paid) when any one transaction is successful
Juspay also supports limiting the number of transactions against an order to only 1. Reach out to Juspay to get this setting enabled, if required.
Once this setting is enabled, it is merchant’s responsibility to correctly handle Payment Retry.
Merchant should ensure that a unique orderId is provided for every payment attempt. In case multiple transactions are attempted against an order, details of only the most recent transaction will be persisted in Juspay system
Order ID Best Practices
Each order created by Merchant in Juspay’s System is identified via a Unique Order ID, which should be:
1. Less than 21 Characters
2. Alphanumeric
3. Non-Sequential
4. Should not contain any Special Characters
Why order id should be less than 21 Characters?
Why order id should be AlphaNumeric & Non-Sequential?
- Have questions?
- Need help? Contact support
- LLM? Read llms.txt

