# Organization API: Org Staff Billing

> Every Organization API operation tagged Org Staff Billing.

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

Base URL: `https://api.coritan.com/api/v1`. Paths below are complete.

To try these requests in the browser, open the [interactive Organization API reference](https://api.coritan.com/docs/org).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/staff/disputes`](#op-get-api-v1-orgs-org-slug-staff-disputes) | Staff disputes |
| GET | [`/api/v1/orgs/{org_slug}/staff/dunning`](#op-get-api-v1-orgs-org-slug-staff-dunning) | Staff dunning |
| GET | [`/api/v1/orgs/{org_slug}/staff/dunning/stats`](#op-get-api-v1-orgs-org-slug-staff-dunning-stats) | How many invoices the retry job holds in each state, and what they still owe |
| GET | [`/api/v1/orgs/{org_slug}/staff/transactions`](#op-get-api-v1-orgs-org-slug-staff-transactions) | Every payment, refund and wallet movement the brand has recorded |
| GET | [`/api/v1/orgs/{org_slug}/staff/transactions/export.csv`](#op-get-api-v1-orgs-org-slug-staff-transactions-export-csv) | The transactions list as it is filtered, as a CSV, for the books |
| GET | [`/api/v1/orgs/{org_slug}/staff/transactions/stats`](#op-get-api-v1-orgs-org-slug-staff-transactions-stats) | Totals per type over the window, for the strip above the list |

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

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

Chargebacks against this brand's customers, with the customer and the
invoice named: ``customer_name`` (first and last name, else ``null``),
``customer_email`` and ``customer`` for the person, ``invoice_number``
beside ``org_invoice_id`` for the invoice the payment was on. It costs two
outer joins on the one statement, and nothing per row.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `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. |

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

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

Invoices the retry job is working, with the stage, the next attempt and
the last error, so failing payments are a list rather than a surprise.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `status` | 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. |

### How many invoices the retry job holds in each state, and what they still owe {#op-get-api-v1-orgs-org-slug-staff-dunning-stats}

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

How many invoices the retry job holds in each state, and what they
still owe. ``owed_by_currency`` is that balance per invoice currency
(``{"USD": "32.97", "EUR": "12.99"}``, decimal strings in the currency's
own units like every amount here); ``owed`` stays as the sum across
currencies for older clients, and is only a real figure when the queue is
in one currency.

#### Parameters

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

#### Responses

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

### Every payment, refund and wallet movement the brand has recorded {#op-get-api-v1-orgs-org-slug-staff-transactions}

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

Every payment, refund and wallet movement the brand has recorded.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `type` | query | string or null | no |  |
| `gateway` | query | string or null | no |  |
| `customer_id` | query | integer or null | no |  |
| `q` | query | string or null | no |  |
| `since` | query | string (date) or null | no |  |
| `until` | query | string (date) 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. |

### The transactions list as it is filtered, as a CSV, for the books {#op-get-api-v1-orgs-org-slug-staff-transactions-export-csv}

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

The transactions list as it is filtered, as a CSV, for the books.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |
| `type` | query | string or null | no |
| `gateway` | 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. |

### Totals per type over the window, for the strip above the list {#op-get-api-v1-orgs-org-slug-staff-transactions-stats}

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

Totals per type over the window, for the strip above the list.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `days` | query | integer | no | Default: `30`. |

#### Responses

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