# Get the organization's billing state

`GET /v1/orgs/{org_id}/billing`

Requires role member or higher.

## Authentication

A session token: `Authorization: Bearer <session token>`, or the session cookie in the browser. Requires role `member` or higher.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_id` | path | string | yes |  |

## Responses

### 200

The organization's plan and subscription, as last synchronized from Stripe.

`application/json`

```json
{
  "additionalProperties": false,
  "description": "The organization's plan and subscription, as last synchronized from Stripe.",
  "properties": {
    "billing_enabled": {
      "description": "False when the API has no Stripe configuration; actions answer 503.",
      "type": "boolean"
    },
    "can_manage": {
      "description": "True for the owner.",
      "type": "boolean"
    },
    "cancel_at_period_end": {
      "type": "boolean"
    },
    "current_period_end": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount": {
      "anyOf": [
        {
          "additionalProperties": false,
          "description": "The discount applied to the subscription, as last synchronized from Stripe.",
          "properties": {
            "amount_off": {
              "anyOf": [
                {
                  "description": "Amount off per invoice, in cents.",
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "code": {
              "anyOf": [
                {
                  "description": "The promotion code redeemed, when the discount came from one.",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "currency": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "ends_at": {
              "anyOf": [
                {
                  "description": "When the discount ends; null when it does not end.",
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "percent_off": {
              "anyOf": [
                {
                  "description": "Percent off the plan price.",
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "code",
            "percent_off",
            "amount_off",
            "currency",
            "ends_at"
          ],
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "payment_method": {
      "anyOf": [
        {
          "additionalProperties": false,
          "properties": {
            "brand": {
              "type": "string"
            },
            "exp_month": {
              "type": "integer"
            },
            "exp_year": {
              "type": "integer"
            },
            "last4": {
              "type": "string"
            }
          },
          "required": [
            "brand",
            "last4",
            "exp_month",
            "exp_year"
          ],
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "plan_id": {
      "type": "string"
    },
    "scheduled_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "scheduled_plan_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "anyOf": [
        {
          "anyOf": [
            {
              "enum": [
                "active"
              ],
              "type": "string"
            },
            {
              "enum": [
                "past_due"
              ],
              "type": "string"
            },
            {
              "enum": [
                "canceled"
              ],
              "type": "string"
            },
            {
              "enum": [
                "unpaid"
              ],
              "type": "string"
            },
            {
              "enum": [
                "incomplete"
              ],
              "type": "string"
            },
            {
              "enum": [
                "incomplete_expired"
              ],
              "type": "string"
            },
            {
              "enum": [
                "trialing"
              ],
              "type": "string"
            },
            {
              "enum": [
                "paused"
              ],
              "type": "string"
            }
          ]
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "billing_enabled",
    "plan_id",
    "status",
    "current_period_end",
    "cancel_at_period_end",
    "scheduled_plan_id",
    "scheduled_at",
    "payment_method",
    "discount",
    "can_manage"
  ],
  "type": "object"
}
```

### 401

unauthorized: no valid session, or the email is not verified.

Problem type: [unauthorized](https://docs.dlogify.com/errors/unauthorized.md).

### 404

not-found: the resource does not exist, or the caller is not a member of its organization.

Problem type: [not-found](https://docs.dlogify.com/errors/not-found.md).

### 429

rate-limited: per-user management request limit.

Problem type: [rate-limited](https://docs.dlogify.com/errors/rate-limited.md).

## Example

```bash
curl -X GET "https://api.dlogify.com/v1/orgs/{org_id}/billing" \
  -H "Authorization: Bearer $DLOGIFY_SESSION"
```

Source: https://docs.dlogify.com/api/billing/getOrgBilling
