Skip to content

Choose the default billing organization

Saves which organization to preselect as Bill to when you rent a Forge cloud server, and returns the billing organizations with it as default_organization_id. The choice is yours alone and follows you across devices.

It only preselects. Every server is billed to the organization its create names in organization_id, and nothing already running moves. If the saved organization later stops being selectable, the list falls back to your current organization, or the first selectable one, until you choose again.

The organization must be one of yours marked selectable in List billing organizations. Otherwise the request is refused with 403 FORGE_COMPUTE_BILLING_ORGANIZATION_NOT_SELECTABLE, whose message is the reason to show, and nothing is saved. Requires a credential that acts for a person; one confined to some organizations can choose only among those.

PUThttps://api.aitronos.com/v1/forge/compute/billing-organizations/default

Body Parameters

organization_id string required

The organization to preselect: an id from organizations marked selectable. Unknown fields are refused.


Returns

The billing organizations, with default_organization_id set to the chosen organization.

{
  "default_organization_id": "org_8f2d4b6a1c3e4f5a8b7c9d0e1f2a3b4c",
  "title": "Bill to",
  "help": "Rented servers are billed to this organization's Forge cloud compute.",
  "organizations": [
    {
      "id": "org_3c1e9a7b5d2f4e8a9b0c6d1e2f3a4b5c",
      "name": "Acme Engineering",
      "logo_url": "https://cdn.example.com/logos/acme.png",
      "selectable": true,
      "reason": null,
      "month_to_date_label": "CHF 0.52 on servers this month",
      "order": 0
    },
    {
      "id": "org_8f2d4b6a1c3e4f5a8b7c9d0e1f2a3b4c",
      "name": "Side Project",
      "logo_url": null,
      "selectable": true,
      "reason": null,
      "month_to_date_label": null,
      "order": 1
    }
  ]
}

Errors

StatusCodeWhen
401AUTHENTICATION_REQUIREDNo valid credential.
403API_KEY_PERSON_REQUIREDAn organization API key: it has no person of its own.
403FORGE_COMPUTE_BILLING_ORGANIZATION_NOT_SELECTABLEServers cannot be billed to this organization: you are not an active member of it, your credential is confined to other organizations ("This key cannot be used in this organization."), Forge cloud compute is off there or could not be checked, you do not hold use_forge there, or Aitronos servers are not offered to you there. message is the reason to show; details.organization_id is the organization. Nothing was saved.
422VALIDATION_ERRORA body of the wrong shape: organization_id missing or empty, or an unknown field.
cURL
curl -X PUT "https://api.aitronos.com/v1/forge/compute/billing-organizations/default" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"organization_id": "org_8f2d4b6a1c3e4f5a8b7c9d0e1f2a3b4c"}'

Response:

{
  "default_organization_id": "org_8f2d4b6a1c3e4f5a8b7c9d0e1f2a3b4c",
  "title": "Bill to",
  "help": "Rented servers are billed to this organization's Forge cloud compute.",
  "organizations": [
    {
      "id": "org_3c1e9a7b5d2f4e8a9b0c6d1e2f3a4b5c",
      "name": "Acme Engineering",
      "logo_url": "https://cdn.example.com/logos/acme.png",
      "selectable": true,
      "reason": null,
      "month_to_date_label": "CHF 0.52 on servers this month",
      "order": 0
    },
    {
      "id": "org_8f2d4b6a1c3e4f5a8b7c9d0e1f2a3b4c",
      "name": "Side Project",
      "logo_url": null,
      "selectable": true,
      "reason": null,
      "month_to_date_label": null,
      "order": 1
    }
  ]
}