---
page_source: https://juspay.io/sea/docs/hyper-checkout-sea/web/resources/order--transaction
page_title: Order & Transaction
---


# **Order & Transaction** 



Every payment done via Juspay systems has 2 components:1. **Order**  - Represented by OrderId2. **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.


## 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 CounterExample 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

> **Note**
> 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 Characters2. Alphanumeric3. Non-Sequential4. Should not contain any Special Characters

## FAQs:

### Why order id should be less than 21 Characters?

When Juspay receives a Payment Request from the Merchant, Juspay in turn initiates a  transaction request with the Payment Aggregator after converting the Order ID to a Transaction ID.

**Transaction ID**  = MerchantID - Order ID - Transaction Attempt CounterExample of a **Transaction ID**  for a Merchant with Merchant ID ‘TestMerchant’: **TestMerchant-OrderIDLessThan21-1** 

The length of the Unique Transaction ID should be less than 32 characters, since some Payment Aggregators do not accept Transaction IDs more than 32 characters, which might become a blocker for the Merchants to onboard more aggregators in the future.

### Why order id should be AlphaNumeric & Non-Sequential?

AlphaNumeric & Non-Sequential Order IDs are tougher to guess, more secure & offer higher levels of confidentiality & protection.

