Defacto Counterparty API

The Counterparty API from Defacto — 2 operation(s) for counterparty.

OpenAPI Specification

defacto-counterparty-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Defacto Accounting Counterparty API
  version: v1.0.0
  description: Defacto provides instant, embedded financing for SMBs across Europe. This REST API lets partners onboard borrowers, test eligibility and credit limits, upload business/bank data, create invoices, request and manage loans, handle repayments and recollection, issue and manage credit cards, bill fees, and subscribe to webhooks. Reconstructed by API Evangelist from the per-operation OpenAPI fragments published on Defacto's ReadMe developer portal (developers.getdefacto.com/llms.txt). operationId values are the provider's ReadMe reference slugs; summaries are the reference page titles.
  contact:
    email: contact@getdefacto.com
    url: https://developers.getdefacto.com/
servers:
- url: https://api.getdefacto.com
  description: Production
- url: https://api-sandbox.getdefacto.com
  description: Sandbox
security:
- Bearer: []
tags:
- name: Counterparty
paths:
  /counterparties:
    get:
      description: List all the Counterparties. A Counterparty describes any commercial relations with a company. Counterparties are automatically created from the invoices.
      parameters:
      - description: Legal name of the business.
        in: query
        name: business_name
        required: false
        x-nullable: true
        schema:
          type: string
          default: null
      - description: Pagination cursor from the previous response's next_page field. Omit to get the first page.
        in: query
        name: cursor
        required: false
        x-nullable: true
        schema:
          type: string
          default: null
      - description: Legal identifier of the business, such as its SIRET or SIREN in France. Must not contain spaces.
        in: query
        name: identifier
        required: false
        x-nullable: true
        schema:
          type: string
          default: null
      - description: Type of legal business identifier of the business, such as the SIRET in France.
        in: query
        name: identifier_type
        required: false
        x-nullable: true
        schema:
          type: string
          enum:
          - belgium_registration_number
          - bsn
          - cif
          - hr_nummer
          - kvk
          - name
          - nif
          - siren
          - siret
          - steuernummer
          - vat_number
          - null
          default: null
      - description: Maximum number of items to return per page.
        in: query
        name: page_size
        required: false
        schema:
          type: integer
          default: 100
      - description: Description of the relation
        in: query
        name: relation_types
        required: false
        explode: true
        schema:
          type: array
          items:
            enum:
            - BORROWER
            - CLIENT
            - DEBTOR
            - MARKETPLACE_BUYER
            - MARKETPLACE_SELLER
            - SELF
            - SUPPLIER
            type: string
      - description: Whether this counterparty is selected for financing
        in: query
        name: selected_for_financing
        required: false
        x-nullable: true
        schema:
          type: boolean
          default: null
      responses:
        '200':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TypedApiPage7'
      security:
      - Bearer: []
      tags:
      - Counterparty
      operationId: get_counterparties
      summary: /counterparties
    post:
      description: Create a new counterparty. A Counterparty describes any commercial relations with a company. Counterparties are automatically created from the invoices.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APICounterpartyExplicitCreation'
      responses:
        '200':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/APICounterpartyWithExposure'
        '201':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/APICounterpartyWithExposure'
      security:
      - Bearer: []
      tags:
      - Counterparty
      operationId: post_counterparties
      summary: /counterparties
  /counterparty/{counterparty_id}:
    get:
      description: Get a counterparty by id. A Counterparty describes any commercial relations with a company. Counterparties are automatically created from the invoices.
      parameters:
      - in: path
        name: counterparty_id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/APICounterpartyWithExposure'
      security:
      - Bearer: []
      tags:
      - Counterparty
      operationId: get_counterparty-counterparty-id
      summary: /counterparty/{counterparty_id}
components:
  schemas:
    APICreditLimit:
      properties:
        available_amount:
          description: Current amount that Defacto is willing to finance. Therefore, any loan request for a sum more than this amount will be automatically denied.
          type: integer
        max_amount:
          description: Max amount that can be lent to this business.
          type: integer
        max_amount_details:
          default: null
          description: Details describing the reason behind the value of max_amount.
          enum:
          - ACTIVITY_DOCUMENTS_REQUIRED
          - ACTIVITY_NOT_ELIGIBLE_BORROWER
          - ALREADY_USING_FACTORING_OR_DAILLY
          - AMOUNT_SUPERIOR_TO_AVAILABLE_BALANCE
          - AVERAGE_INVOICE_SIZE_TOO_HIGH
          - BLACKLISTED_FACTORED_COUNTERPARTY
          - BORROWER_AND_COUNTERPARTY_HAVE_COMMON_DIRECTOR
          - BORROWER_CHURNED
          - BORROWER_DEFAULTED
          - BORROWER_STATUS
          - BORROWER_TO_SIGN
          - BUSINESS_AGE_BELOW_THRESHOLD
          - BUSINESS_AML_EXTREME_RISK
          - BUSINESS_COMPLIANCE_ISSUE_DETECTED
          - BUSINESS_HARD_COLLECTION
          - BUSINESS_HAS_NO_PROFESSIONAL_EMAIL
          - BUSINESS_INSOLVENCY_PROCEDURE_EXISTS
          - BUSINESS_INSOLVENCY_PROCEDURE_UNKNOWN_STATUS
          - BUSINESS_LEGAL_FORM_NOT_ELIGIBLE
          - BUSINESS_MISSING_INFORMATION
          - BUSINESS_NOT_DIFFUSIBLE
          - BUSINESS_NOT_REGISTERED
          - BUSINESS_NOT_REGISTERED_TO_RCS
          - BUSINESS_NOT_REGISTERED_TO_RCS_OR_RNE
          - BUSINESS_RADIATED
          - BUSINESS_REGION_NOT_COVERED
          - BUSINESS_UNKNOWN
          - BUSINESS_UNKNOWN_BUYER
          - BUSINESS_UNKNOWN_SELLER
          - CAPPING_EXCEEDED
          - CASHED_IN_NOT_REPAID
          - CCSF_TRANSACTION_DETECTED
          - CCSF_TRANSACTION_PENDING_DATA_REQUEST
          - CCSF_TRANSACTION_WAITING_END_INSTALLMENT_PLAN
          - COUNTERPARTY_DATA_MISSING
          - COUNTERPARTY_INSOLVENCY_PROCEDURE_EXISTS
          - COUNTERPARTY_INSOLVENCY_PROCEDURE_UNKNOWN_STATUS
          - COUNTERPARTY_KPI_MISSING
          - COUNTERPARTY_NOT_REGISTERED
          - COUNTERPARTY_NOT_SELECTED_FOR_FINANCING
          - COUNTRY_CAPPING_EXCEEDED
          - COUNTRY_NOT_ELIGIBLE_BORROWER
          - COUNTRY_NOT_ELIGIBLE_COUNTERPARTY
          - CREDIT_RISK_NOT_ELIGIBLE
          - CREDIT_RISK_NOT_ELIGIBLE_COUNTERPARTY
          - DATA_STILL_REFRESHING
          - DEBT_ARREARS_PENDING_GRACE_PERIOD
          - DEPRECATED_LATE_REPAYMENT
          - DOES_NOT_MATCH_ELIGIBILITY_CRITERIA
          - DOUBLE_MOBILIZATION
          - DPD_15_LATE_REPAYMENT_BORROWER
          - DPD_15_LATE_REPAYMENT_BUYER
          - DPD_15_LATE_REPAYMENT_SELLER
          - ELLISPHERE_RISK_INDEX
          - EXCEEDED_PARTNER_CREDIT_LINE
          - EXCESSIVE_AMOUNT_LOAN_REQUEST
          - EXCESSIVE_DURATION_LOAN_REQUEST
          - EXPOSURE_TOO_OLD
          - FILL_INVOICE_BUYER_INFORMATION
          - FILL_INVOICE_SELLER_INFORMATION
          - FINANCIAL_PRODUCT_DEACTIVATED
          - FINANCIAL_PRODUCT_NOT_IN_RELEASE
          - FINANCIAL_STATEMENT_BAD_KPI
          - FINANCIAL_STATEMENT_PARSING_ISSUE
          - HIGH_BUSINESS_RISK_INDEX
          - HIGH_LOAN_DEFAULT_INDEX
          - HIGH_LYSTA_RISK_INDEX
          - INDUSTRY_CODE_NOT_ELIGIBLE_BORROWER
          - INDUSTRY_CODE_NOT_ELIGIBLE_COUNTERPARTY
          - INSOLVENCY_EARLY_SIGNAL_DETECTED
          - INSOLVENCY_PROCEDURE_EXISTS_BORROWER
          - INSOLVENCY_PROCEDURE_EXISTS_BUYER
          - INSOLVENCY_PROCEDURE_EXISTS_SELLER
          - INSTALLMENT_PLAN_DETECTED_FOR_TAX
          - INSTALLMENT_PLAN_DETECTED_FOR_URSSAF
          - INSURANCE_QUOTE_EXPIRED
          - INVOICE_ALREADY_FINANCED
          - INVOICE_AUTO_LIQUIDATION
          - INVOICE_BLACKLIST_WORDS
          - INVOICE_COMPLIANCE_ISSUE_DETECTED
          - INVOICE_DOES_NOT_MATCH_ELIGIBILITY_CRITERIA
          - INVOICE_LME_NON_COMPLIANT
          - INVOICE_MISSING_ACCOUNT_NUMBER
          - INVOICE_MISSING_LEGAL_MENTION
          - INVOICE_MULTIPLE_STAGE
          - INVOICE_NON_ELIGIBLE_USE_CASE
          - INVOICE_NOT_ELIGIBLE_TO_CREDIT_INSURANCE
          - INVOICE_NOT_ISSUED_YET
          - INVOICE_NOT_RELATED_TO_WCR
          - INVOICE_OVERDUE
          - INVOICE_PAYABLE_BORROWER_IS_ACCOUNT_HOLDER
          - INVOICE_RECEIVABLE_ACCOUNT_MISSING_LIVE_CONNECTION
          - INVOICE_RECEIVABLE_ACCOUNT_MISSING_MANDATE
          - INVOICE_RECEIVABLE_BORROWER_IS_NOT_ACCOUNT_HOLDER
          - INVOICE_REPAYMENT_DATE_TOO_FAR_60D
          - KPI_MISSING
          - KPI_SCREENING_NOT_ELIGIBLE_BORROWER
          - KYB_PENDING
          - KYB_PENDING_USER_ACTION
          - KYC_PENDING
          - KYC_PENDING_USER_ACTION
          - LATE_REPAYMENT_BORROWER
          - LEGAL_FORM_NOT_ELIGIBLE_BORROWER
          - LEGAL_FORM_NOT_ELIGIBLE_BUYER
          - LEGAL_FORM_NOT_ELIGIBLE_COUNTERPARTY
          - LINKED_BUSINESS_IS_BLOCKED
          - LOAN_REQUEST_EXPIRED
          - LOW_CASH_BALANCE
          - LOW_FREE_CASH_FLOW
          - MAX_AMOUNT_EXCEEDED
          - MAX_AMOUNT_EXCEEDED_BORROWER
          - MAX_AMOUNT_EXCEEDED_BUYER
          - MAX_AMOUNT_EXCEEDED_SELLER
          - MISSING_COUNTERPARTY_CONTACT_INFORMATION
          - MISSING_PUBLIC_PROCUREMENT_DOCUMENT
          - NEED_BANKING_INTEGRATION
          - NOT_AN_INVOICE
          - NOT_DIFFUSIBLE_BUYER
          - NOT_DIFFUSIBLE_SELLER
          - NOT_ENOUGH_DATA
          - NOT_PRE_ELIGIBLE_SPV
          - NOT_REGISTERED_BUYER
          - NOT_REGISTERED_SELLER
          - NO_TAX_PAYMENT_FOUND
          - NO_URSSAF_PAYMENTS_FOUND
          - NO_URSSAF_PAYMENT_FOUND
          - OFFBOARDED
          - ORANGE_FLAG_TRANSACTIONS
          - OTHER_BUSINESS_FROM_DIRECTOR_HAS_INSOLVENCY_PROCEDURE
          - OUTDATED_DATA
          - OUTDATED_INVOICE
          - OUTDATED_INVOICE_2WEEKS
          - OUTDATED_INVOICE_3WEEKS
          - OVERDRAFT_REQUIRED
          - PLEASE_RECONNECT_BANK_ACCOUNTS
          - POSTAL_CODE_NOT_ELIGIBLE_BORROWER
          - POSTAL_CODE_NOT_ELIGIBLE_COUNTERPARTY
          - PROACTIVE_RECOLLECTION
          - PRUDENTIAL_EXPOSURE_EXCEEDED
          - QONTO_INTEGRATION_GERMAN_USER_DOES_NOT_HAVE_4_MONTHS_OF_HISTORY
          - QONTO_INTEGRATION_USER_DOES_NOT_HAVE_6_MONTHS_OF_HISTORY
          - QONTO_INTEGRATION_USER_DOES_NOT_MEET_MINIMUM_REQUIREMENT_FOR_CREDIT_LINE
          - RECENT_DEBT_ARREARS_KO
          - RECENT_DEBT_ARREARS_PENDING_DATA_REQUEST
          - RECENT_REVENUE_DROP
          - RECENT_SEIZURE_DETECTED
          - RECENT_TAX_ARREARS_PENDING_DATA_REQUEST
          - RECENT_UNPAID_PRIVILEGED_TRANSACTIONS
          - RECENT_UNPAID_PRIVILEGED_TRANSACTIONS_PENDING_DATA_REQUEST
          - RECENT_URSSAF_ARREARS_PENDING_DATA_REQUEST
          - RED_FLAG_TRANSACTIONS
          - RELATED_COUNTERPARTY_HAS_FLAG
          - RELATED_COUNTERPARTY_IS_LATE
          - REMOVED_FROM_COMMERCIAL_REGISTER_BORROWER
          - REMOVED_FROM_COMMERCIAL_REGISTER_BUSINESS
          - REMOVED_FROM_COMMERCIAL_REGISTER_BUYER
          - REMOVED_FROM_COMMERCIAL_REGISTER_SELLER
          - REPAYMENT_CONCENTRATION_IS_TOO_HIGH
          - REQUIRED_FINANCIAL_STATEMENT
          - RISK_SCORE_DOWNGRADING
          - SMALL_RECURRING_AMOUNT_DETECTED_FOR_URSSAF
          - TOO_LONG
          - UNAUTHORIZED_LOAN_PAYMENT_ACCOUNT
          - UNAUTHORIZED_LOAN_PAYMENT_ACCOUNT_BANK_IDENTIFIER
          - UNAUTHORIZED_LOAN_PAYMENT_BENEFICIARY
          - URSSAF_PAYMENTS_STOPPED
          - USER_DOES_NOT_MEET_MINIMUM_MAX_AMOUNT_SIZE
          - USER_DOES_NOT_MEET_MINIMUM_REQUIREMENT_FOR_CREDIT_LINE
          - WAITING_FOR_THIRD_PARTY_PROVIDER
          - WAIT_FOR_REPAYMENT
          - null
          type: string
          nullable: true
      required:
      - available_amount
      - max_amount
      type: object
    TypedApiPage7:
      properties:
        count:
          type: integer
        data:
          items:
            $ref: '#/components/schemas/APICounterpartyWithExposure'
          type: array
        next_page:
          default: null
          type: string
          nullable: true
        page_size:
          type: integer
        previous_page:
          default: null
          type: string
          nullable: true
        total:
          default: null
          type: integer
          nullable: true
      required:
      - count
      - page_size
      type: object
    Address:
      properties:
        address_line_1:
          type: string
          nullable: true
        address_line_2:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        postal_code:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
      type: object
    APICounterpartyExplicitCreation:
      properties:
        address:
          allOf:
          - $ref: '#/components/schemas/Address'
          default: null
          nullable: true
        contact:
          allOf:
          - $ref: '#/components/schemas/APICounterpartyContact'
          default: null
          nullable: true
        identifier:
          description: Legal identifier of the business, such as its SIRET or SIREN in France. Must not contain spaces.
          type: string
        identifier_type:
          description: Type of legal business identifier of the business, such as the SIRET in France.
          enum:
          - belgium_registration_number
          - bsn
          - cif
          - hr_nummer
          - kvk
          - name
          - nif
          - siren
          - siret
          - steuernummer
          - vat_number
          type: string
        name:
          default: null
          description: Legal name of the business.
          type: string
          nullable: true
        relation_types:
          items:
            enum:
            - BORROWER
            - CLIENT
            - DEBTOR
            - MARKETPLACE_BUYER
            - MARKETPLACE_SELLER
            - SELF
            - SUPPLIER
            type: string
          minItems: 1
          type: array
        vat_number:
          default: null
          description: VatNumber
          type: string
          nullable: true
      required:
      - identifier
      - identifier_type
      - relation_types
      type: object
    APICounterpartyWithExposure:
      properties:
        address:
          allOf:
          - $ref: '#/components/schemas/Address'
          default: null
          nullable: true
        contact:
          allOf:
          - $ref: '#/components/schemas/APICounterpartyContact'
          default: null
          nullable: true
        credit_limit:
          $ref: '#/components/schemas/APICreditLimit'
        id:
          format: uuid
          type: string
        identifier:
          description: Legal identifier of the business, such as its SIRET or SIREN in France. Must not contain spaces.
          type: string
        identifier_type:
          description: Type of legal business identifier of the business, such as the SIRET in France.
          enum:
          - belgium_registration_number
          - bsn
          - cif
          - hr_nummer
          - kvk
          - name
          - nif
          - siren
          - siret
          - steuernummer
          - vat_number
          type: string
        name:
          description: Legal name of the business.
          type: string
        relation_types:
          items:
            enum:
            - BORROWER
            - CLIENT
            - DEBTOR
            - MARKETPLACE_BUYER
            - MARKETPLACE_SELLER
            - SELF
            - SUPPLIER
            type: string
          minItems: 1
          type: array
        selected_for_financing:
          default: null
          description: Whether this counterparty is selected for financing
          type: boolean
          nullable: true
        vat_number:
          default: null
          description: VatNumber
          type: string
          nullable: true
      required:
      - credit_limit
      - id
      - identifier
      - identifier_type
      - name
      - relation_types
      type: object
    APICounterpartyContact:
      properties:
        email:
          format: email
          type: string
        first_name:
          type: string
        last_name:
          type: string
        phone_number:
          type: string
      required:
      - email
      - first_name
      - last_name
      - phone_number
      type: object
  securitySchemes:
    Bearer:
      in: header
      name: Authorization
      type: apiKey