Skip to content

Bulk create categories and subcategories

Request

Creates multiple categories and subcategories in a single request. Automatically groups subcategories under their parent categories.

Security
oauth2ClientCredentials(Required scopes: categories:write)
Headers
org_wallet_refstring

Organization wallet reference, defaults to "1" if not provided

business_idstringrequired

Business identifier for the request

Bodyapplication/jsonrequired
itemsArray of objects(BulkCreateCategoryItemV1Dto)required

Array of category/subcategory items to create

Example:
[ { "category": "Office Expenses", "subcategory": "Water Bill", "code": "405034", "description": "Water bill" }, { "category": "Office Expenses", "subcategory": "Rent", "code": "405035", "description": "HQ RENT" } ]
curl -i -X POST \
  https://developer.boyahq.com/_mock/v2/openapi/categories/bulk \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'business_id: string' \
  -H 'org_wallet_ref: string' \
  -d '{
    "items": [
      {
        "category": "Office Expenses",
        "subcategory": "Water Bill",
        "code": "405034",
        "description": "Water bill"
      },
      {
        "category": "Office Expenses",
        "subcategory": "Rent",
        "code": "405035",
        "description": "HQ RENT"
      }
    ]
  }'

Responses

Categories and subcategories created successfully

Bodyapplication/json
categoriesArray of objects(CategoryV1Dto)

Array of created categories with their subcategories

totalCategoriesnumber

Total number of categories created

Example:2
totalSubcategoriesnumber

Total number of subcategories created

Example:5
messagestring

Response message

Example:"Successfully created 2 categories and 5 subcategories"
Response
{ "categories": [ {} ], "totalCategories": 2, "totalSubcategories": 5, "message": "Successfully created 2 categories and 5 subcategories" }