# Organization API: Billing & Payouts: Staff

> The 12 Organization API operations for staff.

Source: https://docs.coritan.com/api/reference/organizations/billing-payouts/staff/

Part of [Billing & Payouts](/api/reference/organizations/billing-payouts/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/staff/invoices`](#op-get-api-v1-orgs-org-slug-staff-invoices) | Staff invoices |
| POST | [`/api/v1/orgs/{org_slug}/staff/invoices`](#op-post-api-v1-orgs-org-slug-staff-invoices) | Raise a one-line invoice by hand: a setup fee, an add-on, a correction |
| GET | [`/api/v1/orgs/{org_slug}/staff/invoices/export.csv`](#op-get-api-v1-orgs-org-slug-staff-invoices-export-csv) | Every invoice in the window, as a CSV |
| GET | [`/api/v1/orgs/{org_slug}/staff/invoices/stats`](#op-get-api-v1-orgs-org-slug-staff-invoices-stats) | Staff invoices stats |
| GET | [`/api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}`](#op-get-api-v1-orgs-org-slug-staff-invoices-invoice-id) | Staff invoice hub |
| PATCH | [`/api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}`](#op-patch-api-v1-orgs-org-slug-staff-invoices-invoice-id) | Staff patch invoice |
| POST | [`/api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}/cancel`](#op-post-api-v1-orgs-org-slug-staff-invoices-invoice-id-cancel) | Close an invoice nobody should pay |
| POST | [`/api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}/charge`](#op-post-api-v1-orgs-org-slug-staff-invoices-invoice-id-charge) | Staff charge invoice |
| POST | [`/api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}/mark-paid`](#op-post-api-v1-orgs-org-slug-staff-invoices-invoice-id-mark-paid) | Staff mark invoice paid |
| GET | [`/api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}/pdf`](#op-get-api-v1-orgs-org-slug-staff-invoices-invoice-id-pdf) | The same document the customer downloads from their portal |
| POST | [`/api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}/refund`](#op-post-api-v1-orgs-org-slug-staff-invoices-invoice-id-refund) | Staff refund invoice |
| POST | [`/api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}/send`](#op-post-api-v1-orgs-org-slug-staff-invoices-invoice-id-send) | Staff send invoice |

### Staff invoices {#op-get-api-v1-orgs-org-slug-staff-invoices}

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

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `q` | query | string or null | no |  |
| `customer_id` | query | integer or null | no |  |
| `status_filter` | query | string or null | no |  |
| `audience` | query | string or null | no |  |
| `limit` | query | integer | no | Default: `50`. |
| `offset` | query | integer | no | Default: `0`. |

#### Responses

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

### Raise a one-line invoice by hand: a setup fee, an add-on, a correction {#op-post-api-v1-orgs-org-slug-staff-invoices}

`POST /api/v1/orgs/{org_slug}/staff/invoices`

Raise a one-line invoice by hand: a setup fee, an add-on, a correction.

#### Parameters

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

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `customer_id` | integer | yes |
| `description` | string | yes |
| `amount` | number or string | yes |
| `tax` | number or string | no |
| `currency` | string or null | no |
| `due_days` | integer | no |
| `notes` | string or null | no |
| `service_id` | integer or null | no |
| `send_email` | boolean | no |

#### Responses

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

### Every invoice in the window, as a CSV {#op-get-api-v1-orgs-org-slug-staff-invoices-export-csv}

`GET /api/v1/orgs/{org_slug}/staff/invoices/export.csv`

Every invoice in the window, as a CSV.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |
| `status` | query | string or null | no |
| `since` | query | string (date) or null | no |
| `until` | query | string (date) or null | no |

#### Responses

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

### Staff invoices stats {#op-get-api-v1-orgs-org-slug-staff-invoices-stats}

`GET /api/v1/orgs/{org_slug}/staff/invoices/stats`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |
| `audience` | query | string or null | no |

#### Responses

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

### Staff invoice hub {#op-get-api-v1-orgs-org-slug-staff-invoices-invoice-id}

`GET /api/v1/orgs/{org_slug}/staff/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. |

### Staff patch invoice {#op-patch-api-v1-orgs-org-slug-staff-invoices-invoice-id}

`PATCH /api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}`

#### Parameters

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

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `notes` | string or null | no |
| `due_date` | string (date) or null | no |

#### Responses

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

### Close an invoice nobody should pay {#op-post-api-v1-orgs-org-slug-staff-invoices-invoice-id-cancel}

`POST /api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}/cancel`

Close an invoice nobody should pay. A paid one is refunded, not cancelled.

#### Parameters

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

#### Request body

`application/json`

| Field | Type | Required |
| --- | --- | --- |
| `reason` | string or null | no |

#### Responses

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

### Staff charge invoice {#op-post-api-v1-orgs-org-slug-staff-invoices-invoice-id-charge}

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

Charge the customer's saved method for an unpaid invoice now, the way
the dunning job would on its next attempt. Skipped, not forced, when the
customer has turned auto-pay off or a payment is still settling.

#### 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. |

### Staff mark invoice paid {#op-post-api-v1-orgs-org-slug-staff-invoices-invoice-id-mark-paid}

`POST /api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}/mark-paid`

#### 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. |

### The same document the customer downloads from their portal {#op-get-api-v1-orgs-org-slug-staff-invoices-invoice-id-pdf}

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

The same document the customer downloads from their portal.

#### 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. |

### Staff refund invoice {#op-post-api-v1-orgs-org-slug-staff-invoices-invoice-id-refund}

`POST /api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}/refund`

Refund a paid invoice on staff's own decision (a goodwill gesture, a
duplicate charge, a mistake), in full or in part, to the payment method
or the wallet. Recorded as a refund request staff opened and approved, so
the ledger, the invoice, the service and the audit log move exactly as
they do for a request the customer made.

#### Parameters

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

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `amount` | number or string | yes |
| `reason` | string | yes |
| `to` | string | no |

#### Responses

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

### Staff send invoice {#op-post-api-v1-orgs-org-slug-staff-invoices-invoice-id-send}

`POST /api/v1/orgs/{org_slug}/staff/invoices/{invoice_id}/send`

Send the invoice email again: the issued one for an open invoice, the
overdue one once it is past due. Nothing about the invoice changes.

#### 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. |
