> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kukkingu.software/llms.txt
> Use this file to discover all available pages before exploring further.

# Reorder billables

> Updates the ordering of billables for the provided invoice. Billables not listed keep relative order by creation date.



## OpenAPI

````yaml https://api.contracting.kukkingu.software/api/v1/docs.json post /api/v1/billables/order
openapi: 3.1.0
info:
  title: Contracting Backend API
  version: 0.1.0
  description: API documentation for the Contracting backend service.
servers:
  - url: https://api.contracting.kukkingu.software
    description: API server
security:
  - bearerAuth: []
paths:
  /api/v1/billables/order:
    post:
      tags:
        - Billables
      summary: Reorder billables
      description: >-
        Updates the ordering of billables for the provided invoice. Billables
        not listed keep relative order by creation date.
      parameters:
        - schema:
            type: string
            example: tnt_pfh0haxfpzowht3oi213cqos
            description: >-
              Specifies the tenant context for the request. All endpoints
              operate within this tenant scope.
          in: header
          name: tenant-id
          required: true
          description: >-
            Specifies the tenant context for the request. All endpoints operate
            within this tenant scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                invoiceId:
                  type: string
                  description: The ID of the invoice.
                  examples:
                    - inv_mqxd1kc6bgtcc676xoqzax47
                ids:
                  type: array
                  items:
                    type: string
                    description: Unique identifier of the billable.
                    example: bil_eym9hcqlh1m7v3d36blf0vfx
                  description: >-
                    Ordered list of billable IDs representing the desired sort
                    order.
              required:
                - invoiceId
                - ids
              additionalProperties: false
              description: Request body that defines the target order for billables.
        description: Request body that defines the target order for billables.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: string
                      description: Unique identifier of the billable.
                      example: bil_eym9hcqlh1m7v3d36blf0vfx
                    description: >-
                      Ordered list of billable IDs after the reorder operation
                      is applied.
                required:
                  - data
                additionalProperties: false
                description: Standard success response payload wrapped in a data property.
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine-readable error code.
                    example: ValidationError
                  message:
                    type: string
                    description: Human-readable validation error summary.
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Request field that failed validation.
                        message:
                          type: string
                          description: Validation failure message for the field.
                        constraint:
                          type: string
                          description: Validation rule that was violated.
                      required:
                        - field
                        - message
                        - constraint
                      additionalProperties: false
                required:
                  - error
                  - message
                additionalProperties: false
                description: Error response returned when request validation fails.
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    default: Unauthorized
                    description: Machine-readable error code.
                    example: Unauthorized
                    type: string
                  message:
                    default: Unauthorized
                    description: Human-readable error message.
                    example: Unauthorized
                    type: string
                required:
                  - error
                  - message
                additionalProperties: false
                description: Error response for requests without valid authentication.
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    default: Forbidden
                    description: Machine-readable error code.
                    example: Forbidden
                    type: string
                  message:
                    default: Forbidden
                    description: Human-readable error message.
                    example: Forbidden
                    type: string
                required:
                  - error
                  - message
                additionalProperties: false
                description: Error response for requests blocked by authorization rules.
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    default: NotFound
                    description: Machine-readable error code.
                    example: NotFound
                    type: string
                  message:
                    default: Not Found
                    description: Human-readable error message.
                    example: Not Found
                    type: string
                required:
                  - error
                  - message
                additionalProperties: false
                description: Error response when the requested resource does not exist.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````