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

> View the status, counterparty status, and return request status for incoming and outgoing Instant Payments

# Statuses

Use `status` to understand the Lead-side lifecycle of an instant payment, `counterparty_status` to understand the counterparty-side lifecycle for outgoing payments after the payment reaches `posted`, and the return\_request status to understand the lifecycle of a return request that references the given instant payment.

## Status

| **Status**     | **Description**                                                      | Direction             |
| :------------- | :------------------------------------------------------------------- | --------------------- |
| `created`      | Lead created the outgoing instant payment.                           | Outgoing only         |
| `under_review` | Lead is manually reviewing the instant payment.                      | Incoming and outgoing |
| `canceled`     | You canceled the outgoing instant payment.                           | Outgoing only         |
| `posted`       | Lead posted the instant payment to your account.                     | Incoming and outgoing |
| `rejected`     | Lead, the counterparty, or the network rejected the instant payment. | Incoming and outgoing |

## Counterparty Status

| **Counterparty Status** | **Description**                                                                                           | **Direction**         |
| :---------------------- | :-------------------------------------------------------------------------------------------------------- | :-------------------- |
| `under_review`          | The counterparty is manually reviewing your outgoing payment before posting it to the creditor's account. | Outgoing only         |
| `posted`                | The instant payment posted to the creditor's account.                                                     | Incoming and outgoing |
| `rejected`              | The counterparty rejected your outgoing payment before it reached the creditor's account.                 | Outgoing only         |

## Return Request Status

| Return Request Status | Description                                                              | Direction             |
| :-------------------- | :----------------------------------------------------------------------- | :-------------------- |
| `response_needed`     | The incoming return request requires a response from you.                | Incoming only         |
| `pending`             | The outgoing return request is pending a response from the counterparty. | Outgoing only         |
| `accepted`            | The return request was accepted and a return is expected.                | Incoming and outgoing |
| `rejected`            | The return request was rejected.                                         | Incoming and outgoing |

# Incoming Payments

```mermaid theme={null}
graph LR
J -.- A
O -.-F
subgraph Incoming counterparty_status
		 O(["posted"])
end

subgraph Incoming status
	F(["START"])
	H(["rejected"])
	I(["under_review"])
	J(["posted"])
	F --> J
	F -- "Lead manual review"--> I
	I -- "Manual review failure" --> H
	I -- "Manual review success" --> J
	F -- "Lead validation failure" --> H

end

subgraph Incoming return_request status
	A(["response_needed"])
	C(["accepted"])
	D(["rejected"])
	A -- "You return" --> C
	A -- "You reject" --> D
end

subgraph State Key
       direction LR
       X([Start])
       Y([Pending])
       Z([Terminal])
end

linkStyle 3 stroke:#155724,stroke-width:2px;

classDef startStyle fill:#d4edda,stroke:#155724,stroke-width:3px;
classDef progressStyle fill:#e1f5fe,stroke:#03a9f4,stroke-width:3px;
classDef terminalStyle fill:#eceff1,stroke:#455a64,stroke-width:3px;

class F,A,X startStyle;
class I,Y progressStyle;
class C,D,H,J,Z,O terminalStyle;
```

# Outgoing Payments

```mermaid theme={null}
graph LR

subgraph Outgoing status
   A(["created"])
   B(["under_review"])
   C(["rejected"])
   J(["canceled"])
   E(["posted"])
   A --> E
   A -- "Lead manual review" --> B
   A -- "Lead validation failure or network or counterparty rejection" --> C
   B -- "Manual review success" --> E
   B -- "Manual review failure" --> C
   A -- "You canceled" --> J
   B -- "You canceled" --> J
end

E -.- D
E -.- L

subgraph Outgoing return_request status
		 D(["pending"])
		 F(["accepted"])
		 G(["rejected"])
		 D -- "Counterparty accepted" --> F
		 D -- "Counterparty rejected" --> G
end

subgraph Outgoing counterparty_status
		 L(["START"])
		 M(["under_review"])
		 N(["rejected"])
		 O(["posted"])
		 L -- "Counterparty manual review" --> M
            M -- "Manual review failure" --> N
            M -- "Manual review success" --> O
		 L -- "Counterparty rejected" --> N
		 L -- "Counterparty accepted" --> O
end

subgraph State Key
   direction LR
   T([Start])
   U([Pending])
   V([Terminal])
end

linkStyle 0 stroke:#155724,stroke-width:2px;

classDef startStyle fill:#d4edda,stroke:#155724,stroke-width:3px;
classDef progressStyle fill:#e1f5fe,stroke:#03a9f4,stroke-width:3px;
classDef terminalStyle fill:#eceff1,stroke:#455a64,stroke-width:3px;
classDef brownStyle fill:#efebe9,stroke:#5d4037,stroke-width:2px;
classDef invisible fill:none,stroke:none

class A,D,W,T,L startStyle;
class B,X,U,M progressStyle;
class C,E,F,G,J,Y,Z,V,N,O terminalStyle;
class H,I brownStyle;
```

<br />
