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

# Create credit terms application

> Create a new credit terms application.
    #### [Authorization scenarios](/content/developer-guide/introduction/authorization#scenarios)
    | Guest | Host | Self |
    |-------|------|------|
    | ✅    | ❌   | ❌  |



## OpenAPI

````yaml /content/developer-guide/api-reference/openapi_v1.json post /credit-applications/credit-terms
openapi: 3.1.0
info:
  title: API - V1
  version: 1.0.0
servers:
  - url: https://api.mycreditapp.ai/v1-beta
security: []
paths:
  /credit-applications/credit-terms:
    post:
      tags:
        - Credit applications
      summary: Create credit terms application
      description: |-
        Create a new credit terms application.
            #### [Authorization scenarios](/content/developer-guide/introduction/authorization#scenarios)
            | Guest | Host | Self |
            |-------|------|------|
            | ✅    | ❌   | ❌  |
      operationId: create_credit_terms_credit_applications_credit_terms_post
      parameters:
        - name: Requester-Organization-ID
          in: header
          required: true
          schema:
            type: string
            format: uuid
            description: |

              The unique identifier of the organization making the request.
              **This ID is used to authorize the requester within the system**.
            examples:
              - 054b4106-174b-46b0-97f8-86d8d7b6f0af
            title: Requester-Organization-Id
          description: |

            The unique identifier of the organization making the request.
            **This ID is used to authorize the requester within the system**.
        - name: Target-Organization-ID
          in: header
          required: true
          schema:
            type: string
            format: uuid
            description: >

              The unique identifier of the organization that is the target of
              the request.

              The `Target-Organization-ID` may match the
              `Requester-Organization-ID` if the requester accesses their own
              resources.

              If the `Target-Organization-ID` differs from the
              `Requester-Organization-ID`, the requester can access third-party
              resources **if the requester has a connection with the target
              organization and is authorized to perform such actions**.
            examples:
              - 123e4567-e89b-12d3-a456-426614174000
            title: Target-Organization-Id
          description: >

            The unique identifier of the organization that is the target of the
            request.

            The `Target-Organization-ID` may match the
            `Requester-Organization-ID` if the requester accesses their own
            resources.

            If the `Target-Organization-ID` differs from the
            `Requester-Organization-ID`, the requester can access third-party
            resources **if the requester has a connection with the target
            organization and is authorized to perform such actions**.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCreditTerms'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditApplication'
        '400':
          description: Bad Request
          content:
            application/json:
              example:
                detail:
                  - loc: []
                    msg: Unsupported CRUD operation!
                    type: request
                    code: unsupported_crud_operation
                  - loc: []
                    msg: Invalid currency code!
                    type: request
                    code: credit_application_invalid_currency
              schema:
                $ref: '#/components/schemas/APIError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                detail:
                  - loc: []
                    msg: Token is required!
                    type: token
                    code: token_required
                  - loc: []
                    msg: The token has expired!
                    type: token
                    code: token_expired
                  - loc: []
                    msg: Invalid token!
                    type: token
                    code: invalid_token
        '403':
          description: Forbidden
          content:
            application/json:
              example:
                detail:
                  - loc: []
                    msg: >-
                      Creating credit application for your own organization is
                      forbidden!
                    type: request
                    code: create_credit_application_access_denied
                  - loc: []
                    msg: Access denied!
                    type: request
                    code: access_denied
              schema:
                $ref: '#/components/schemas/APIError'
        '404':
          description: Not Found
          content:
            application/json:
              example:
                detail:
                  - loc: []
                    msg: Account not found!
                    type: request
                    code: account_not_found
                  - loc: []
                    msg: Organization not found!
                    type: request
                    code: organization_not_found
              schema:
                $ref: '#/components/schemas/APIError'
        '409':
          description: Conflict
          content:
            application/json:
              example:
                detail:
                  - loc: []
                    msg: >-
                      The account is in the process of being deleted! The
                      Account's email can only be reused after its data has been
                      completely deleted. The removal process may take up to 24
                      hours.
                    type: request
                    code: account_being_deleted
                  - loc: []
                    msg: >-
                      The organization is in the process of being deleted! The
                      removal process may take up to 24 hours.
                    type: request
                    code: organization_being_deleted
              schema:
                $ref: '#/components/schemas/APIError'
        '413':
          description: Request Entity Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                detail:
                  - loc: []
                    msg: The request is too large!
                    type: request
                    code: request_too_large
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                detail:
                  - loc:
                      - string
                      - 0
                    msg: string
                    type: string
                    code: validation_error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                detail:
                  - loc: []
                    msg: Error processing request, please try later!
                    type: try_later
                    code: internal_conflict_error
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                detail:
                  - loc: []
                    msg: Service is under maintenance, please try later!
                    type: maintanance
                    code: service_under_maintenance
      security:
        - Token: []
components:
  schemas:
    CreateCreditTerms:
      properties:
        details:
          $ref: '#/components/schemas/CreditTermsDetails'
          description: Credit application credit terms details
        trade_profile:
          $ref: '#/components/schemas/CreditTermsTradeProfile'
          description: Credit application credit terms trade profile
        security_compliance:
          items:
            $ref: '#/components/schemas/CreditEnhancements'
          type: array
          title: Security Compliance
          description: List of credit security compliance enhancements items
      type: object
      required:
        - details
        - trade_profile
        - security_compliance
      title: CreateCreditTerms
    CreditApplication:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: >-
            Unique identifier of the [credit
            application](https://docs.mycreditapp.ai/api-reference/credit-applications/create-credit-terms-application)
          examples:
            - b2a9f8d3-7b7d-4c1b-a2a1-9c2d0b123456
        credit_application_type:
          $ref: '#/components/schemas/CreditApplicationType'
          description: Type of credit application
        forwarder_id:
          type: string
          format: uuid
          title: Forwarder Id
          description: >-
            Unique identifier of the owner
            [organization](https://docs.mycreditapp.ai/api-reference/organizations/get-organization)
          examples:
            - d2f8e6c4-1b3c-4a7b-9d2f-3b1e0a987654
        shipper_id:
          type: string
          format: uuid
          title: Shipper Id
          description: >-
            Unique identifier of the guest
            [organization]({app_settings.public_docs_url}/organizations/get-organization)
          examples:
            - c1e2f3b4-5a6b-7c8d-9e0f-1a2b3c4d5e6f
        status:
          $ref: '#/components/schemas/CreditApplicationStatus'
          description: Current status of the credit application
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when the credit application was created
          examples:
            - '2025-01-01T12:00:00.123456'
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Timestamp when the credit application was last updated
          examples:
            - '2025-01-02T12:00:00.123456'
      type: object
      required:
        - id
        - credit_application_type
        - forwarder_id
        - shipper_id
        - status
        - created_at
        - updated_at
      title: CreditApplication
    APIError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ErrorItem'
          type: array
          title: Detail
          description: >

            List of returned errors.

            **All unsuccessful error codes except code `422` can only contain 1
            element in the list**.
      type: object
      required:
        - detail
      title: APIError
    CreditTermsDetails:
      properties:
        annual_revenue:
          type: integer
          maximum: 2147483647
          exclusiveMinimum: 0
          title: Annual Revenue
          description: Annual revenue of the applicant
          examples:
            - 50000
            - 1000000
        credit_amount:
          type: integer
          maximum: 2147483647
          exclusiveMinimum: 0
          title: Credit Amount
          description: Requested credit amount
          examples:
            - 10000
            - 50000
        currency:
          type: string
          maxLength: 3
          minLength: 3
          title: Currency
          description: >-
            Valid [currency
            code](https://docs.mycreditapp.ai/api-reference/resources/get-the-available-currencies)
            in ISO 4217
          examples:
            - USD
            - EUR
        payment_terms:
          type: string
          maxLength: 20
          title: Payment Terms
          description: Payment terms agreed for credit
          examples:
            - Net 30
            - Net 90
        freight_spend:
          type: integer
          maximum: 2147483647
          exclusiveMinimum: 0
          title: Freight Spend
          description: Freight spend of the organization
          examples:
            - 10000
            - 250000
        purpose:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Purpose
          description: Optional purpose of the credit request
          examples:
            - Purchase of example goods
      type: object
      required:
        - annual_revenue
        - credit_amount
        - currency
        - payment_terms
        - freight_spend
      title: CreditTermsDetails
    CreditTermsTradeProfile:
      properties:
        shipping_routes:
          items:
            type: string
          type: array
          title: Shipping Routes
          description: List of shipping routes for trade profile
          examples:
            - - New York - Rotterdam
              - Shanghai - Los Angeles
        trade_types:
          items:
            $ref: '#/components/schemas/TradeType'
          type: array
          title: Trade Types
          description: List of trade types involved
        avg_shipment_value:
          type: integer
          maximum: 2147483647
          exclusiveMinimum: 0
          title: Avg Shipment Value
          description: Average shipment value
          examples:
            - 15000
            - 35000
      type: object
      required:
        - shipping_routes
        - trade_types
        - avg_shipment_value
      title: CreditTermsTradeProfile
    CreditEnhancements:
      properties:
        title:
          type: string
          maxLength: 100
          title: Title
          description: Title of the credit enhancement
          examples:
            - Sign a credit agreement
            - Agree to UCC-1 Filing or similar
        description:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Description
          description: Optional description of the credit enhancement
          examples:
            - >-
              A formal agreement outlining the terms and remedies in case of
              non-payment
        other:
          type: boolean
          title: Other
          description: Indicates if this enhancement is 'other' type
      type: object
      required:
        - title
        - other
      title: CreditEnhancements
    CreditApplicationType:
      type: string
      enum:
        - credit_terms
        - trade_finance
        - factoring
      title: CreditApplicationType
    CreditApplicationStatus:
      type: string
      enum:
        - pending
        - internal_review
        - external_review
        - needs_action
        - approved
        - finalized
        - declined
        - rejected
        - expired
        - sign_document_created
        - sign_document_in_progress
        - sign_document_completed
        - sign_document_expired
        - sign_document_canceled
        - sign_document_declined
        - sign_document_process_failed
      title: CreditApplicationStatus
    ErrorItem:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Loc
          description: |

            Shows the dynamic location of the current error.
            If an empty array is returned, the error is static.
          examples:
            - - body
              - date_field
              - 0
            - - header
              - Authorization
        msg:
          type: string
          title: Msg
          description: |

            A human-readable message providing more details about the error.
          examples:
            - Token is required!
            - Invalid token!
        type:
          type: string
          title: Type
          description: >

            A string indicating the type of error.

            **The list is not fixed, so it's necessary to pay attention to the
            possible type for a specific error**.
          examples:
            - token
            - request
            - try_later
        code:
          type: string
          title: Code
          description: >

            Unique text error code identifying the error.

            **The list is not fixed, so it's necessary to pay attention to the
            possible code for a specific error**.
          examples:
            - token_required
            - invalid_token
            - access_denied
      type: object
      required:
        - loc
        - msg
        - type
        - code
      title: ErrorItem
    TradeType:
      type: string
      enum:
        - import
        - export
        - domestic
      title: TradeType
  securitySchemes:
    Token:
      type: http
      description: >-
        [Bearer
        authentication](/content/developer-guide/introduction/authentication)
        using a JWT token. Provide a valid access token. Authorization header
        format: `Authorization: Bearer <token>`.
      scheme: bearer

````