# Order life cycle

Understanding of the order life cycle helps you to [track orders](https://developers.xsolla.com/virtual-goods/own-ui/client-side-token-generation/set-up-order-tracking/?tabs=100-trackOrderOnClient_200-api&_xm=4170963201673921623) and correctly implement post-purchase logic, e.g., item delivery.

The order moves through the following statuses:

<table>
  <thead>
  <tr>
     <td>Status</td>
     <td>Description</td>
     <td>Notes</td>
  </tr>
  </thead>
  <tbody>
    <tr>
     <td> <code>new</code> </td>
     <td>Order is created. The system is waiting for payment confirmation.</td>
     <td>Transaction status descriptions can be found in <a href="https://developers.xsolla.com/api/pay-station/reports/find-transactions#reports/find-transactions/t=request&in=query&path=status">Pay Station API documentation</a>.</td>
    </tr>
    <tr>
     <td> <code>paid</code> </td>
     <td>Order is paid (the transaction moved to the <code>done</code> status), and the item can be granted to the user. </td>
     <td>The order remains in the <code>new</code> status until the payment is confirmed. </td>
    </tr>
    <tr>
     <td> <code>done</code> </td>
     <td>Item is granted to the user. </td>
     <td> — </td>
    </tr>
    <tr>
     <td> <code>canceled</code> </td>
     <td>The payment was refunded. </td>
     <td>The order moves to this status when the <a href="https://developers.xsolla.com/api/pay-station/reports/find-transactions#reports/find-transactions/t=request&in=query&path=status">transaction status</a> changes to <code>refunded</code>. </td>
    </tr>
    <tr>
     <td> <code>expired</code> </td>
     <td> Creating a new order for a <a href="https://developers.xsolla.com/api/catalog/limits-overview">limited</a> item, promo code, or promotion moves any previous unpaid order containing that item to the <code>expired</code> status. Only the most recent order can be paid for. </td>
     <td>If a user attempts to pay for an expired order, the payment UI will display a <code>2002</code> error, and the payment will fail. </td>
    </tr>
  </tbody>
</table>

![Order life cycle](https://cdn.xsolla.net/developers/current/images/api_docs/order-life-cycle.svg)

<div class="note">
  <p><b>Note</b></p>
  <p>When the order moves to the <code>expired</code> status while the user is completing a payment, but the payment is successful, the order moves from <code>expired</code> to <code>paid</code> status. This applies only if the purchase limit for the order’s item won’t be exceeded upon payment.</p>
</div>


