# Organization API: Customer Portal: Invoices

> The 15 Organization API operations for invoices.

Source: https://docs.coritan.com/api/reference/organizations/customer-portal/invoices/

Part of [Customer Portal](/api/reference/organizations/customer-portal/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/portal/invoices`](#op-get-api-v1-orgs-org-slug-portal-invoices) | Newest first, ties by id |
| GET | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}`](#op-get-api-v1-orgs-org-slug-portal-invoices-invoice-id) | Get my invoice |
| POST | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/apply-credit`](#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-apply-credit) | Apply the customer's credit balance toward an unpaid invoice |
| POST | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/charge`](#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-charge) | Pay an invoice using a saved payment method (merchant-initiated charge) |
| POST | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/checkout`](#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-checkout) | Canonical hosted checkout for an org-customer invoice (alias of /pay) |
| GET | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/checkout-session`](#op-get-api-v1-orgs-org-slug-portal-invoices-invoice-id-checkout-session) | Resume an in-flight checkout after a new tab, login, or API restart |
| POST | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/confirm-payment`](#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-confirm-payment) | Finalize a charge after customer completes SCA (3-D Secure) |
| GET | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/gateways`](#op-get-api-v1-orgs-org-slug-portal-invoices-invoice-id-gateways) | Gateway accounts that can checkout this invoice's pay currency |
| POST | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/pay`](#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-pay) | Hosted checkout for an invoice (legacy path; prefer /checkout) |
| POST | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/pay-intent`](#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-pay-intent) | Create an in-page Stripe Payment Element intent for an org invoice |
| POST | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/paypal-capture`](#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-paypal-capture) | Capture paypal order |
| POST | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/paypal-stash`](#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-paypal-stash) | Persist a PayPal order id so a redirect or reboot can still capture it |
| GET | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/pdf`](#op-get-api-v1-orgs-org-slug-portal-invoices-invoice-id-pdf) | The invoice as a document to keep |
| GET | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/refund-eligibility`](#op-get-api-v1-orgs-org-slug-portal-invoices-invoice-id-refund-eligibility) | My invoice refund eligibility |
| POST | [`/api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/refund-request`](#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-refund-request) | Request my invoice refund |

### Newest first, ties by id {#op-get-api-v1-orgs-org-slug-portal-invoices}

`GET /api/v1/orgs/{org_slug}/portal/invoices`

Newest first, ties by id. ``with_total`` wraps the page as
``{items, total, limit, offset, counts}``; counts are per status for the
same search, whatever the status filter.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `status_filter` | query | string | no |  |
| `q` | query | string | no |  |
| `limit` | query | integer | no | Default: `50`. |
| `offset` | query | integer | no | Default: `0`. |
| `with_total` | query | boolean | no | Default: `False`. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Get my invoice {#op-get-api-v1-orgs-org-slug-portal-invoices-invoice-id}

`GET /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Apply the customer's credit balance toward an unpaid invoice {#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-apply-credit}

`POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/apply-credit`

Apply the customer's credit balance toward an unpaid invoice.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Pay an invoice using a saved payment method (merchant-initiated charge) {#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-charge}

`POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/charge`

Pay an invoice using a saved payment method (merchant-initiated charge).
If no payment_method_id specified, uses the default method.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |
| `payment_method_id` | query | integer | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Canonical hosted checkout for an org-customer invoice (alias of /pay) {#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-checkout}

`POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/checkout`

Canonical hosted checkout for an org-customer invoice (alias of ``/pay``).

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |
| `return_url` | query | string | no |
| `cancel_url` | query | string | no |
| `currency` | query | string | no |
| `gateway_name` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Resume an in-flight checkout after a new tab, login, or API restart {#op-get-api-v1-orgs-org-slug-portal-invoices-invoice-id-checkout-session}

`GET /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/checkout-session`

Resume an in-flight checkout after a new tab, login, or API restart.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Finalize a charge after customer completes SCA (3-D Secure) {#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-confirm-payment}

`POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/confirm-payment`

Finalize a charge after customer completes SCA (3-D Secure).
Retrieves the PaymentIntent from Stripe and settles the org invoice on success.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |
| `gateway_name` | query | string | yes |
| `payment_intent_id` | query | string | yes |
| `currency` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Gateway accounts that can checkout this invoice's pay currency {#op-get-api-v1-orgs-org-slug-portal-invoices-invoice-id-gateways}

`GET /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/gateways`

Gateway accounts that can checkout this invoice's pay currency.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |
| `currency` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Hosted checkout for an invoice (legacy path; prefer /checkout) {#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-pay}

`POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/pay`

Hosted checkout for an invoice (legacy path; prefer ``/checkout``).
Creates a hosted checkout session and returns an approval URL.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |
| `return_url` | query | string | no |
| `cancel_url` | query | string | no |
| `currency` | query | string | no |
| `gateway_name` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Create an in-page Stripe Payment Element intent for an org invoice {#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-pay-intent}

`POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/pay-intent`

Create an in-page Stripe Payment Element intent for an org invoice.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |
| `currency` | query | string | no |
| `country` | query | string | no |
| `gateway_name` | query | string | no |
| `save_method` | query | boolean | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Capture paypal order {#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-paypal-capture}

`POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/paypal-capture`

Finalize an embedded PayPal Buttons one-off payment: capture the
buyer-approved order server-side and apply it to the org invoice (USD ledger).
Idempotent via the gateway_reference uniqueness in settle_org_invoice_payment.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |
| `order_id` | query | string | yes |
| `gateway_name` | query | string | yes |
| `currency` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Persist a PayPal order id so a redirect or reboot can still capture it {#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-paypal-stash}

`POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/paypal-stash`

Persist a PayPal order id so a redirect or reboot can still capture it.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |
| `order_id` | query | string | yes |
| `gateway_name` | query | string | yes |
| `currency` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### The invoice as a document to keep {#op-get-api-v1-orgs-org-slug-portal-invoices-invoice-id-pdf}

`GET /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/pdf`

The invoice as a document to keep. Statements are staff-facing; this is
the copy a customer files with their own accounts.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### My invoice refund eligibility {#op-get-api-v1-orgs-org-slug-portal-invoices-invoice-id-refund-eligibility}

`GET /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/refund-eligibility`

What the Refund Policy says about this invoice, so the page can offer
the request, or say plainly why it cannot, before the customer types.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Request my invoice refund {#op-post-api-v1-orgs-org-slug-portal-invoices-invoice-id-refund-request}

`POST /api/v1/orgs/{org_slug}/portal/invoices/{invoice_id}/refund-request`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `invoice_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

Type: Body.

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
