Skip to main content
PATCH
/
orgs
/
{org_id}
/
orgs
/
{sub_org_id}
/
billing
Update Sub-Organization Billing Config
curl --request PATCH \
  --url https://api.useinvent.com/orgs/{org_id}/orgs/{sub_org_id}/billing \
  --header 'Content-Type: application/json' \
  --data '
{
  "auto_recharge": {
    "enabled": true,
    "recharge_threshold": 252.5,
    "recharge_amount": 252.5
  },
  "spending_cap": {
    "enabled": true,
    "amount": 50000,
    "reset_at": "2023-11-07T05:31:56Z"
  }
}
'
{
  "id": "<string>",
  "name": "<string>",
  "verified": true,
  "disabled": true,
  "type": "PERSONAL",
  "plan": "free",
  "balance": 123,
  "promo_balance": 123,
  "promo_balance_reset_at": "2023-11-07T05:31:56Z",
  "billing": {
    "auto_recharge": {
      "enabled": true,
      "recharge_threshold": 252.5,
      "recharge_amount": 252.5
    },
    "spending_cap": {
      "enabled": true,
      "amount": 50000,
      "reset_at": "2023-11-07T05:31:56Z"
    },
    "payment_method": {
      "type": "<string>",
      "payment_method_id": "<string>",
      "brand": "<string>",
      "last4": "<string>",
      "inactive": true,
      "failed_at": "2023-11-07T05:31:56Z",
      "failed_message": "<string>"
    },
    "last_low_balance_notification_at": "2023-11-07T05:31:56Z",
    "last_out_of_balance_notification_at": "2023-11-07T05:31:56Z",
    "last_spending_cap_notification_at": "2023-11-07T05:31:56Z"
  },
  "logo_url": "<string>",
  "deleted": true,
  "created_at": "2023-11-07T05:31:56Z",
  "spending_cap_used": 123,
  "updated_at": "2023-11-07T05:31:56Z",
  "role": "ADMIN",
  "features": {
    "enterprise": true,
    "allow_overdraft": true,
    "workflows": true,
    "broadcasts": true,
    "enable_japifon": true,
    "custom_domain": true,
    "slack_access": true
  },
  "config": {
    "email": "jsmith@example.com",
    "address": "<string>",
    "terms_url": "<string>",
    "privacy_url": "<string>"
  },
  "parent_org": {
    "id": "<string>",
    "name": "<string>",
    "verified": true,
    "logo_url": "<string>",
    "plan": "free",
    "config": {
      "email": "jsmith@example.com",
      "address": "<string>",
      "terms_url": "<string>",
      "privacy_url": "<string>"
    },
    "features": {
      "enterprise": true,
      "allow_overdraft": true,
      "workflows": true,
      "broadcasts": true,
      "enable_japifon": true,
      "custom_domain": true,
      "slack_access": true
    },
    "parent_org_id": "<string>"
  }
}

Path Parameters

org_id
string
required

The ID of the parent organization

sub_org_id
string
required

The ID of the sub-organization

Body

Schema for updating payment configuration

auto_recharge
object
required
spending_cap
object

Response

200 - application/json

The sub-organization with updated billing config.

Detailed information about an org (organization)

id
string
required

Unique identifier for the org

name
string
required

Name of the org

verified
boolean
required

Verification status of the org

disabled
boolean
required

Whether the org is disabled by the system

type
enum<string>
required

Type of the organization

Available options:
PERSONAL,
TEAM
plan
enum<string>
required

Type of subscription plan

Available options:
free,
business
balance
number
required

Current balance of the org

promo_balance
number
required

Current promotional balance of the org

promo_balance_reset_at
string<date-time> | null
required

Timestamp when the promotional balance was last reset

billing
object
required

Schema for updating payment configuration

logo_url
string | null
required

URL of the organization logo

deleted
boolean
required

Deletion status of the org

created_at
string<date-time> | null
required

Timestamp when the org was created

spending_cap_used
number
required

Amount spent in the current month against the spending cap

updated_at
string<date-time> | null
required

Timestamp when the org was last updated

role
enum<string>

Role of the user within the organization

Available options:
ADMIN,
DEVELOPER,
MANAGER,
STAFF
features
object

Org gate-keeping features configuration

config
object

Organization configuration settings

parent_org
object

Parent organization details if this is a sub-org