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

# Configure Global Invoicing Preferences



## OpenAPI

````yaml POST /v1/c/preferences/invoicing
openapi: 3.0.3
info:
  title: wingback-api
  description: ''
  contact:
    name: ''
  license:
    name: commercial
  version: 0.1.0
servers:
  - url: http://127.0.0.1:8080
    description: Local server
  - url: https://api.app.test.wingback.com
    description: Testing server
security: []
paths:
  /v1/c/preferences/invoicing:
    post:
      tags:
        - wb_customer
      summary: Update invoicing preferences
      operationId: update_preferences_invoicing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/inbound.preferences.InvoicingPreferences'
        required: true
      responses:
        '200':
          description: Updated
      security:
        - api-key: []
        - wb_user_cookie: []
components:
  schemas:
    inbound.preferences.InvoicingPreferences:
      type: object
      description: |-
        Configuration of invoicing engine

        Empty fields (i.e. as None) won't be changed
      properties:
        automatic_payment:
          type: boolean
          description: Should invoice amount be charged automatically or not
          nullable: true
        due_date_policy:
          allOf:
            - $ref: '#/components/schemas/DueDatePolicy'
          nullable: true
        flat_fee_due_date_policy:
          allOf:
            - $ref: '#/components/schemas/DueDatePolicy'
          nullable: true
        invoice_trigger:
          allOf:
            - $ref: '#/components/schemas/InvoiceTrigger'
          nullable: true
        usage_period_closing_policy:
          allOf:
            - $ref: '#/components/schemas/UsagePeriodClosingPolicy'
          nullable: true
    DueDatePolicy:
      type: string
      description: >-
        Determines when the due_date of the invoices should be set when created:

        * StartOfPeriod - invoices are due at the beginning of the billing
        period

        * EndOfPeriod - invoices are due at the end of the billing period
      enum:
        - start_of_period
        - end_of_period
    InvoiceTrigger:
      oneOf:
        - type: string
          description: invoices are created as soon as invoice items are validated
          enum:
            - immediate
        - type: object
          required:
            - periodic
          properties:
            periodic:
              $ref: '#/components/schemas/UnboundedPeriodRule'
        - type: string
          description: invoices are created on wb_customer action
          enum:
            - manual
      description: |-
        When the invoices should be created

        Note: EveryCycle and Periodic aren't yet supported,
        they will behave as Manual
    UsagePeriodClosingPolicy:
      type: string
      description: >-
        Determines how usage period should be closed:

        * Automatic - usage period will be closed as soon as claim period ends

        * Manual -  usage period will be open until closed manually

        * Delayed - automatic with delay after the claim period ends. Valid
        delays are 15 minutes, 1 hour, 1 day
      enum:
        - automatic
        - manual
        - 15 minutes
        - 1 hour
        - 1 day
    UnboundedPeriodRule:
      type: object
      description: |-
        How period are generated, independently from a start
        or end
      required:
        - cycle_count
        - cycle
      properties:
        cycle:
          $ref: '#/components/schemas/TriggerCycle'
        cycle_count:
          type: integer
          description: the number of days/week/month etc. in a period
          minimum: 0
        cycle_start_offset:
          type: integer
          description: |-
            Number of full days between the cycle's natural start and
            the claims starts. For example if claims are to start on
            the morning of the 14 each month, the offset will be 13.
            This value can be null, meaning either that it's not
            specified at this level (eg in preferences) or that it's
            0 (ie a natural cycle)
          nullable: true
          minimum: 0
    TriggerCycle:
      type: string
      description: |-
        Enum that lists supported trigger cycles for periodic triggers:
        * Month - every month
        * Quarter - every quarter
        * Year - every year
      enum:
        - day
        - week
        - month
        - quarter
        - year
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: wb-key
    wb_user_cookie:
      type: apiKey
      in: cookie
      name: app-session

````