Categories

Create a category

Changed on

Create a category

ℹ️ This endpoint requires the following scope: categories:all

post/api/external/v2/categories

Request

  • Base URL
    https://app.pennylane.com
  • URL
    https://app.pennylane.com/api/external/v2/categories
  • Auth
    OAuth 2
    Authorization code: https://app.pennylane.com/oauth/authorize
    Token URL: https://app.pennylane.com/oauth/oauth/token scopes: categories:all

Headers

X-Company-Idstring
Example:12345

Numeric ID of the company to act on. Required when authenticating with a firm token. Ignored when the token is already bound to a company.

Request body

labelstring required
category_group_idinteger required
analytical_codestring nullable
ledger_account_idinteger nullable

Id of the ledger account to map to this category. Only valid for categories belonging to a category group with self-service accounting enabled; rejected otherwise. Bank, pending, and, when applicable, cash accounts cannot be used as transaction counterparts.

Example request

{
  "label": "Loyers",
  "category_group_id": 23,
  "analytical_code": "CODE123",
  "ledger_account_id": 124
}

Response

Returns the created category

idinteger required
labelstring required
created_atstring date-time required
updated_atstring date-time required
analytical_codestring nullable required

Example response

{
  "id": 42,
  "label": "Alimentaire",
  "created_at": "2023-08-30T10:08:08.146343Z",
  "updated_at": "2023-08-30T10:08:08.146343Z",
  "category_group": {
    "id": 348
  },
  "analytical_code": "CODE123",
  "ledger_account": {
    "id": 124,
    "url": "https://app.pennylane.com/api/external/v2/ledger_accounts/124"
  }
}

Changes

    • info

      added the new optional header request parameter X-Company-Id

    • info

      added the new optional request property

    • info

      added the required property to the response with the status