> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atum.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# After submission

> Track a submitted payment, read its status, and retry safely without paying twice.

A `payment_id` means the gateway accepted your payment. It does not mean the funds have arrived. This page shows how to follow a payment to the end and what to do if it fails.

## Payment status

| `status` | Meaning | Final | Can become |
| - | - | - | - |
| `pending` | Accepted and in progress. Quotes are being collected, or your funds are being moved into the [settlement vault](https://docs.atum.xyz/get-started/concepts/settlement-vault.md). Nothing has reached the recipient yet. | No | any other status |
| `finalizing` | The payout to your recipient is mined on the destination chain, waiting for that chain to make it final. | No | `completed`, `failed`, `refunding`, `refund_available`, `refunded` |
| `completed` | Delivered and final on the destination chain. | Yes | — |
| `failed` | Did not complete. `error` says why. If `transactions.deposit` is set, your funds went into the settlement vault: see [A failed payment with a deposit](https://docs.atum.xyz/get-started/support/refunds.md#failed-with-a-deposit). | Yes | — |
| `refunding` | Not delivered. Any funds you deposited are on their way back from the settlement vault. | No | `completed`, `failed`, `refund_available`, `refunded` |
| `refund_available` | Not delivered. The refund is ready, but your funds are still in the settlement vault until it is submitted. | No | `completed`, `refunded` |
| `refunded` | Your funds are back. | Yes | — |

The usual paths:

```mermaid theme={"theme":"github-dark"}
stateDiagram-v2
    [*] --> pending
    pending --> finalizing: payout on the destination chain
    finalizing --> completed: destination chain confirms the payout
    pending --> completed: fast chains can skip finalizing
    pending --> failed: not completed
    pending --> refunding: not delivered
    finalizing --> refunding: not delivered
    refunding --> refunded: settlement operator returns your funds
    refunding --> refund_available: refund ready for you to submit
    refund_available --> refunded: refund lands
    completed --> [*]
    failed --> [*]
    refunded --> [*]
```

`finalizing` is not final. If you act on it, for example to release goods, you accept the small risk that the payout is reversed. You can also open the payout transaction (`transactions.fulfillment`) in the destination chain's block explorer and wait for the number of confirmations you are comfortable with. How long `finalizing` lasts, and what Atum waits for on each chain, is on [Finality](https://docs.atum.xyz/get-started/concepts/finality.md#time-to-finality).

`refunding` and `refund_available` are not final either. A late delivery can still end the payment as `completed`. [Refunds](https://docs.atum.xyz/get-started/support/refunds.md) explains who returns your funds and how to submit a refund yourself.

## Track a payment

`POST /v1/payments` keeps the connection open for up to 30 seconds and answers as soon as the payment is `finalizing`, `completed` or `failed`. If it is still `pending`, poll the status every few seconds until it is `completed`, `failed` or `refunded`. If it is `refund_available`, submit the refund yourself.

> [tab] HTTP
>
> ```bash theme={"theme":"github-dark"}
> curl -sS "https://payment-gw.production-testnet.atum.xyz/v1/payments/${PAYMENT_ID}/status"
> ```

> [tab] SDK
>
> ```typescript theme={"theme":"github-dark"}
> const status = await client.payments.getPaymentStatus({ paymentId });
> ```

> [tab] CLI
>
> ```bash theme={"theme":"github-dark"}
> payment-status --gateway https://payment-gw.production-testnet.atum.xyz "$PAYMENT_ID"
> ```

## What the status response contains

| Field | What it tells you |
| - | - |
| `status`, `error` | Where the payment is, and why it failed if it did. |
| `transactions.deposit` | Your funds moving into the settlement vault on the source chain. |
| `transactions.fulfillment` | The payout to your recipient on the destination chain. |
| `transactions.refund` | Your funds returning from the settlement vault, on a refunded payment. |
| `refund_signature`, `refund_reason` | On a payment that was not delivered: the refund to submit yourself, and why the settlement operator gave up. See [Refunds](https://docs.atum.xyz/get-started/support/refunds.md). |
| `requested_count`, `decline_summary` | How many settlement operators were asked, and why any of them declined. |

Each entry in `transactions` has the transaction hash, the chain, and the block once it is mined. A `completed` payment always has both `transactions.deposit` and `transactions.fulfillment`. Read every transaction from `transactions`.

Full shape: [Get payment status](https://docs.atum.xyz/api-reference/payment-gateway/get-payment-status.md).

## When a payment fails

Read `error.code` first, then `decline_summary`. [Deadlines](https://docs.atum.xyz/get-started/concepts/deadlines.md#deadline-errors) lists every deadline error and what to change. For example, a quote window that ends after the operators' quotes would expire:

```json theme={"theme":"github-dark"}
{
  "payment_id": "0x…",
  "status": "failed",
  "error": {
    "code": "NO_QUOTES_RECEIVED",
    "message": "No settlement quotes were received within the auction window. This request_id is spent, so a new attempt needs a new one.",
    "retry_classification": "RETRY_WITH_NEW_IDENTIFIER"
  },
  "requested_count": 2,
  "decline_summary": [
    { "reason": "QUOTE_WINDOW_TOO_LONG", "count": 2 }
  ]
}
```

Both settlement operators declined. Send a new payment with a new `request_id` and a shorter quote window.

## Retry without paying twice

Not sure it was accepted? Send the same signed request again: if the gateway already accepted it, you get the original payment back instead of a second one. What to do for each status: [Retrying by status](https://docs.atum.xyz/payment-protocols/idempotency.md#retrying-by-status).

## Next steps

| Topic | Guide |
| - | - |
| The deadlines and the errors they cause | [Deadlines](https://docs.atum.xyz/get-started/concepts/deadlines.md) |
| Symptom-first diagnosis | [Troubleshooting](https://docs.atum.xyz/get-started/support/troubleshooting.md) |
| Reconcile a payment | [Reconciliation](https://docs.atum.xyz/get-started/support/reconciliation.md) |


## Related topics

- [Overview](https://docs.atum.xyz/api-reference/payment-gateway/introduction.md)
- [Finality](https://docs.atum.xyz/get-started/concepts/finality.md)
- [Get a price quote](https://docs.atum.xyz/get-started/get-a-price-first.md)
- [Prepare a payment](https://docs.atum.xyz/get-started/prepare-a-payment.md)
- [Payment request](https://docs.atum.xyz/get-started/concepts/payment-intent.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.