# Pay Invoice Flow

When implementing the API with the dashboard for the invoice payment section you will need to use three-or-four main API calls. They include:

```
Invoice Search
Invoice Retrieve
Invoice Pay Option
Invoice Pay
```

<details>

<summary>Show Invoices - Invoice Search API Route</summary>

This can be used to display all the current invoices and whether or not they are paid or awaiting payment.&#x20;

If they are requiring payment, this can be used to inform the UI to show the payment button.

</details>

<details>

<summary>Display Payment Options - Invoice Pay Option API Route</summary>

Similar to the Cart Calculation API with **validate\_payment\_platform**, the Invoice Pay Option API Route will return you a full list of available payment methods for the invoice.

This route has complex logic and will provide a list of all allowed payment methods and saved cards based on the current customer, their IP address location and the size of the invoice.

</details>

<details>

<summary>Redirect to Payment Platform / Capture Payment -Invoice Pay API Route</summary>

At this stage, you can use the Invoice Pay API Route to either get a payment redirection URL or capture payment with a saved payment method.

You should only use payment methods which are validated by the Invoice Pay Option API Route for the specific cart.

</details>

<details>

<summary>Show Invoice Paid  Page</summary>

This is the final stage and will show the customer the customer a page indicating the invoice has been paid.

</details>


---

# 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://internal.developer.documentation.private.user.pingproxies.com/checkout-and-payments/pay-invoice-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.
