# Spend

Returns spend data about the specified company.

It's also possible to specify what fields from the API should be returned. By default, only some fields are returned.

Endpoint: POST /data-api/v1/company/spend
Security: authorization

## Request fields (application/json):

  - `fields` (array)
    A list of data points to be returned in the API response.

  - `filters` (object, required)
    Filters for company spend data. Must provide either company_id OR company_ids, but not both.
    Example: {"category_ids":["03B36D42E7F8E60BE58BA4356B6AF40C","3B7D551F81A8A448041BF23C85E3D21B"],"company_id":"1698C53EBC888758570396E0334965C1"}

  - `filters.category_ids` (array)
    Array of category IDs to filter by

  - `filters.company_ids` (array)
    Array of company IDs

  - `limit` (integer)
    The number of records to return in the request.

  - `offset` (integer)
    Used for paginating records.

  - `sorts` (array)

  - `sorts.direction` (string, required)
    Sort direction
    Enum: "ASC", "DESC"

  - `sorts.field` (string, required)
    Enum: "spend", "category_id", "country_code"

## Response 200 fields (application/json):

  - `count` (integer)

  - `data` (array)

  - `data.category_description` (string)

  - `data.category_id` (string)

  - `data.category_name` (string)

  - `data.company_id` (string)

  - `data.country_code` (string)

  - `data.country_name` (string)

  - `data.spend` (integer)

## Response 401 fields (application/json):

  - `errors` (array)

  - `errors.detail` (string, required)
    Example: The token provided is not valid

  - `errors.source` (string)

  - `errors.title` (string, required)
    Example: Unauthorized

## Response 422 fields (application/json):

  - `errors` (array, required)

  - `errors.detail` (string, required)
    Example: null value where string expected

  - `errors.source` (object, required)

  - `errors.source.pointer` (string, required)
    Example: /data/attributes/petName

  - `errors.title` (string, required)
    Example: Invalid value

