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

# Create payment term

## Field support per integration

> [accordion] Exact Online
>
> > [!NOTE]
> >
> > If you're not using the [Interactive Authentication Flow](https://docs.maesn.com/authentication.md#interactive-authentication-flow), make sure the query parameter `companyId` is correctly populated.
> > You can obtain this value by using the `GET Companies` endpoint available under the Authentication section.
>
> Supported request parameters:
>
> **code** `string`
>
> **description** `string`
>
> **discountDays** `number`
>
> **discountPercentage** `number`
>
> **dueType** `enum`
>
> Available options:
> `DUE_IN_DAYS`
>
> **paymentDays** `number`
>
> **paymentMethod** `enum` *required*
>
> Available options:
> `CASH`, `BANK_TRANSFER`, `PAYMENT_SERVICE_PROVIDER`, `AUTOMATIC_BANK_WITHDRAWAL`


## OpenAPI

````yaml post /accounting/paymentTerms
openapi: 3.0.0
info:
  title: Maesn unified API
  description: The Maesn unified API description
  version: '1.0'
  contact: {}
servers:
  - url: https://api.maesn.dev
security: []
tags:
  - name: maesn
    description: ''
paths:
  /accounting/paymentTerms:
    post:
      tags:
        - accounting
      operationId: createPaymentTerm
      parameters:
        - name: companyId
          required: false
          in: query
          schema:
            type: string
        - name: environmentName
          in: query
          schema:
            type: string
          required: false
        - name: X-API-KEY
          description: API key
          in: header
          schema:
            type: string
            example: example value
          required: true
        - name: X-ACCOUNT-KEY
          description: Account key
          in: header
          schema:
            type: string
            example: example value
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentTermRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/BaseResponseDto'
                  - properties:
                      data:
                        $ref: '#/components/schemas/PaymentTermResponseDto'
                        type: object
components:
  schemas:
    PaymentTermRequestDto:
      type: object
      properties:
        code:
          type: string
          example: '1'
        description:
          type: string
          example: 31 dagen
        discountDays:
          type: number
          example: 10
        discountDays2:
          type: number
          example: 14
        discountPercentage:
          type: number
          example: 5
        discountPercentage2:
          type: number
          example: 3
        discountPeriods:
          type: array
          items:
            $ref: '#/components/schemas/DiscountPeriod'
        dueType:
          type: string
          enum:
            - DUE_IN_DAYS
            - DUE_AS_PERIOD
        name:
          type: string
          example: 31 DAYS
        paymentDays:
          type: number
          example: 31
        paymentMethod:
          type: string
          enum:
            - CASH
            - BANK_TRANSFER
            - PAYMENT_SERVICE_PROVIDER
            - AUTOMATIC_BANK_WITHDRAWAL
          example: BANK_TRANSFER
    BaseResponseDto:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/MetaResponse'
        data:
          oneOf:
            - type: object
            - type: array
    PaymentTermResponseDto:
      type: object
      properties:
        id:
          type: string
          example: 08d52c49-b90c-4328-b1ec-623df74f904a
        code:
          type: string
          example: '1'
        createdDate:
          type: string
          example: '2021-01-01T00:00:00Z'
        description:
          type: string
          example: 31 dagen
        discountDays:
          type: number
          example: 10
        discountDays2:
          type: number
          example: 14
        discountDaysCalculation:
          type: string
          example: 10D
        discountPercentage:
          type: number
          example: 5
        discountPercentage2:
          type: number
          example: 3
        discountPeriods:
          type: array
          items:
            $ref: '#/components/schemas/DiscountPeriod'
        dueType:
          type: string
          enum:
            - DUE_IN_DAYS
            - DUE_AS_PERIOD
        name:
          type: string
          example: 31 DAYS
        paymentDays:
          type: number
          example: 31
        paymentDaysCalculation:
          type: string
          example: 10D
        paymentMethod:
          type: string
          enum:
            - CASH
            - BANK_TRANSFER
            - PAYMENT_SERVICE_PROVIDER
            - AUTOMATIC_BANK_WITHDRAWAL
          example: BANK_TRANSFER
        updatedDate:
          type: string
          example: '2021-01-01T00:00:00Z'
    DiscountPeriod:
      type: object
      properties:
        invoiceRange:
          type: string
          example: Invoice issuance range up to day 5 of the month
        discountDeadline:
          type: string
          example: Day 15 of the current month
        discountDeadline2:
          type: string
          example: Day 25 of the current month
        paymentDeadline:
          type: string
          example: Day 30 of the current month
    MetaResponse:
      type: object
      properties:
        warnings:
          type: array
          items:
            type: string
            example: Field not used by target system
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
        partialErrors:
          type: array
          description: >-
            Secondary operations that failed after the main operation succeeded.
            See [Partial Errors](/guides/partial-errors).
          items:
            type: object
            properties:
              code:
                type: string
                example: FILE_UPLOAD_FAILED
              message:
                type: string
                example: >-
                  Attachment invoice.pdf could not be uploaded to the target
                  system.
    PaginationResponse:
      type: object
      properties:
        total:
          type: number
          example: 125
        perPage:
          type: number
          example: 50
        currentPage:
          type: number
          example: 1
        totalPages:
          type: number
          example: 3

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.