# Payment Flow

Note: `l2Txnhash` (the "L2-hash") should always be used as the unique identifier of a transaction. This is a unique transaction-hash for any transaction on [AkashicChain](/introduction/terminology.md#akashicchain). It is present for Confirmed deposits and Pending/Confirmed payouts. This is particularly important for the case of [Layer 2](/introduction/terminology.md#layer-2) transactions, which will not have a Layer 1 hash (`txHash`)

## <mark style="color:blue;">Deposit Flow</mark>

{% @mermaid/diagram content="sequenceDiagram
autonumber
Server->>Akashic: getDepositAddress<br/>to retrieve permanent L1 address for client<br/>using unique client identifier
Akashic-->>Server: permanent L1 address
Server->>client: permanent L1 address
loop
client->>L1/L2 network: deposit to address
Akashic->>Server: pending deposit callback<br/>with identifier and txHash
Akashic->>Server: confirm deposit callback<br/>with identifier and l2TxnHash/txHash
note over Server: \*Recommended<br/>credit client balance
end
" %}

## <mark style="color:blue;">Payout Flow</mark>

{% @mermaid/diagram content="sequenceDiagram
autonumber
Server->>Akashic: payout with unique client identifier
Akashic-->>Server: Success
note over Server: \*Recommended<br/>debit client balance
Akashic->>L1/L2 network: payout
Akashic->>Server: pending payout callback<br/>with identifier and txHash
Akashic->>Server: confirm payout callback<br/>with identifier and l2TxnHash/txHash
" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akashicpay.com/guides/payment-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
