Defacto Testing API
The Testing API from Defacto — 5 operation(s) for testing.
The Testing API from Defacto — 5 operation(s) for testing.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/defacto-testing-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Defacto Accounting Testing 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: Testing
paths:
/hello:
get:
description: Make a first call to this endpoint to test your connection to Defacto API with your API Key
responses:
'200':
description: A welcoming message from Defacto API.
content:
text/plain:
schema: {}
security:
- Bearer: []
tags:
- Testing
operationId: get_hello
summary: /hello
/sandbox/business-generator:
get:
description: '
Generate a fake business for you to use in your test.
Important, this endpoint does not create the business but simply return the payload.
Call `/borrowers` to register this business and generate loan for it
Warning: these invoices and their IBANs will not work in production.
'
parameters:
- in: query
name: country
required: false
schema:
type: string
enum:
- BEL
- DEU
- ESP
- FRA
- GUF
- ISL
- MAF
- NLD
- REU
default: FRA
- in: query
name: is_borrower
required: false
schema:
type: boolean
default: true
responses:
'200':
description: ''
content:
'*/*':
schema:
$ref: '#/components/schemas/APIPostBorrower'
security:
- Bearer: []
tags:
- Testing
operationId: get_sandbox-business-generator
summary: /sandbox/business-generator
/sandbox/iban-generator:
get:
description: '
Generate a new IBAN that will produce a given scenario on the sandbox, for example a rejected loan.
Each IBAN can be used as the account of a single counterparty or borrower (a buyer or seller of yours).
So, if you want to test the API for several of your counterparties, you will have to generate several of them.
The BIC associated to these IBANs is FK2FACTO.
Also, if you want to test another scenario on a given business, create a new IBAN and use it in the <code>to_account</code> field of the next invoice and loan that you create for this counterparty.
For more information on the scenarios of the sandbox, please refer to the <a href="https://developers.getdefacto.com/reference/testing-your-integration">Testing Multiple Scenarios & Errors</a> section.
Warning: these IBANs will not work in production.
'
parameters:
- in: query
name: country
required: false
schema:
type: string
enum:
- BEL
- DEU
- ESP
- FRA
- GUF
- ISL
- MAF
- NLD
- REU
default: FRA
- in: query
name: scenario
required: false
schema:
type: string
enum:
- CANCEL
- FAIL
- REJECT
- SUCCESS
- SUCCESS_ONE_DAY_LATER
default: SUCCESS
responses:
'201':
description: ''
content:
'*/*':
schema:
$ref: '#/components/schemas/GenerateIbanResponse'
security:
- Bearer: []
tags:
- Testing
operationId: get_sandbox-iban-generator
summary: /sandbox/iban-generator
/sandbox/business-eligible:
post:
description: '
This endpoint enables you to configure the eligibility of a business.
Pass NOT_ELIGIBLE to make a business non-eligible.
Then, you''ll be able to test how the Defacto API behaves when requesting a loan for a non-eligible business.
You can test multiple scenarios:
(1) when the business is the borrower or
(2) when the business is on the invoice to finance but is not the borrower.
'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BusinessEligibleParams'
responses:
'204':
description: ''
content:
'*/*':
schema: {}
security:
- Bearer: []
tags:
- Testing
operationId: post_sandbox-business-eligible
summary: /sandbox/business-eligible
/sandbox/invoice-generator:
post:
description: '
!!! The documentation website is not able to display the full response of this endpoint. The use of the curl command is recommended. !!!
Generate a fake invoice that will produce a given scenario on the sandbox, for example a rejected loan.
The generation will not add the invoice to the list of your invoices. You must do this via API.
To achieve this, you can copy the invoice_creation_payload into the payload of the invoice creation API.
If you want to test another scenario on a given business, create another fake invoice.
For more information on the scenarios of the sandbox, please refer to the <a href="https://developers.getdefacto.com/reference/testing-your-integration">Testing your integration</a> section.
Warning: these invoices and their IBANs will not work in production.
'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateInvoiceRequest'
responses:
'201':
description: ''
content:
'*/*':
schema:
$ref: '#/components/schemas/GeneratedInvoice'
security:
- Bearer: []
tags:
- Testing
operationId: post_sandbox-invoice-generator
summary: /sandbox/invoice-generator
components:
schemas:
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
APIAccountCreation:
properties:
account_holder:
allOf:
- $ref: '#/components/schemas/APIBusinessIdentifier'
default: null
description: The business owning the account.
account_number:
description: The account identifier. Only IBANs are supported at the moment.
type: string
account_number_type:
default: iban
description: The type of account number (e.g. IBAN).
enum:
- account_number
- iban
- internal_id
type: string
bank_identifier:
default: null
description: The identifier of the bank.
type:
- string
- 'null'
bank_identifier_type:
default: bic
description: The type of bank identifier (e.g. BIC).
enum:
- bic
- name
- routing_number
- undefined
type: string
required:
- account_number
type: object
BirthPlace:
properties:
city:
default: null
description: City where the person was born.
type:
- string
- 'null'
country:
default: null
description: Country where the person was born. Must be a ISO 3166 alpha-3 country code (e.g. FRA).
type:
- string
- 'null'
type: object
APICounterpartyCreation:
properties:
address:
allOf:
- $ref: '#/components/schemas/Address'
default: null
contact:
allOf:
- $ref: '#/components/schemas/APICounterpartyContact'
default: null
identifier:
default: null
description: Legal identifier of the business, such as its SIRET or SIREN in France. Must not contain spaces.
type:
- string
- 'null'
identifier_type:
default: null
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
- null
type:
- string
- 'null'
name:
default: null
description: Legal name of the business.
type:
- string
- 'null'
vat_number:
default: null
description: VatNumber
type:
- string
- 'null'
type: object
APIBusinessIdentifier:
properties:
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
required:
- identifier
- identifier_type
type: object
APICreateOwner:
properties:
birth_date:
default: null
format: date
type:
- string
- 'null'
email:
default: null
format: email
type:
- string
- 'null'
first_name:
type: string
identity_documents:
allOf:
- $ref: '#/components/schemas/APICreateIdentityDocuments'
default: null
description: 'Owner''s identity documents: All documents must be provided as a Base64 encoded string of the document''s content.The front side of the identity document is mandatory. This can include either just the front side or both sides (recto-verso) of the identity document.The back side of the identity document is optional. You only need to provide it if you have already submitted the front side and vice versa.Additional identity documents are optional. You may submit other identity documents that you believe are relevant, such as a document used as proof of address, or one containing your code and signature.'
last_name:
type: string
phone_number:
default: null
description: PhoneNumber
type:
- string
- 'null'
required:
- first_name
- last_name
type: object
Address:
properties:
address_line_1:
type:
- string
- 'null'
address_line_2:
type:
- string
- 'null'
city:
type:
- string
- 'null'
country:
type:
- string
- 'null'
postal_code:
type:
- string
- 'null'
state:
type:
- string
- 'null'
type: object
BusinessEligibleParams:
properties:
business_identifier:
$ref: '#/components/schemas/BusinessIdentifier'
scenario:
enum:
- NOT_ELIGIBLE
- OK
type: string
required:
- business_identifier
- scenario
type: object
GeneratedInvoice:
properties:
invoice_creation_payload:
$ref: '#/components/schemas/APIDraftableInvoiceCreation'
pdf_download_url:
type: string
required:
- invoice_creation_payload
- pdf_download_url
type: object
BusinessIdentifier:
properties:
identifier:
description: Legal identifier of the business, such as its SIRET or SIREN in France. Must not contain spaces.
type: string
identifier_type:
default: null
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
- null
type:
- string
- 'null'
required:
- identifier
type: object
CreateAddress:
properties:
address_line_1:
default: null
type:
- string
- 'null'
address_line_2:
default: null
type:
- string
- 'null'
city:
default: null
type:
- string
- 'null'
country:
default: null
type:
- string
- 'null'
postal_code:
default: null
maxLength: 10
type:
- string
- 'null'
state:
default: null
type:
- string
- 'null'
type: object
APICreateDirector:
properties:
address:
allOf:
- $ref: '#/components/schemas/CreateAddress'
default: null
description: Address of the person.
birth_date:
default: null
description: Birth date of the person. (YYYY-MM-DD)
format: date
type:
- string
- 'null'
birth_place:
allOf:
- $ref: '#/components/schemas/BirthPlace'
default: null
description: Birth place of the person.
business_email:
default: null
format: email
type:
- string
- 'null'
business_phone_number:
default: null
description: PhoneNumber
type:
- string
- 'null'
entity_type:
default: people
enum:
- account
- account_detail_verification
- bill
- borrower
- borrower_financial_product
- business
- business_exposure
- business_financial_product
- contract
- counterparty
- country
- credit_card
- credit_line
- data_request
- deposit
- due_interest
- eligibility_request
- enrollment
- entity_eligibility
- financial_product
- flag
- installment
- invoice
- loan
- loan_log
- mandate
- max_exposure_deployment
- onboarding
- onboarding_financial_product
- payment
- people
- rac
- raw_data
- recollection_document
- revenue_share
- sandbox_invoice
- underwriting_check
type: string
first_name:
default: null
description: The first name of the person.
type:
- string
- 'null'
id:
default: null
identifier:
default: null
description: Legal identifier of the business, such as its SIRET or SIREN in France. Must not contain spaces.
type:
- string
- 'null'
identifier_type:
default: null
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
- null
type:
- string
- 'null'
last_name:
default: null
description: The first name of the person.
type:
- string
- 'null'
legal_name:
default: null
description: Legal name of the business.
type:
- string
- 'null'
nationality:
default: null
description: Nationality of the person. Must be a ISO 3166 alpha-3 country code (e.g. FRA).
type:
- string
- 'null'
role:
default: DIRECTOR
enum:
- DIRECTOR
- NON_DIRECTOR
type: string
siege_address:
allOf:
- $ref: '#/components/schemas/CreateAddress'
default: null
description: Address of the business head quarters.
title:
default: null
description: Title of the person (e.g. M., Dr., etc.)
type:
- string
- 'null'
type: object
APIIdentityDocument:
properties:
description:
default: null
description: An optional string that describes the document.
type:
- string
- 'null'
document_binary_base64:
description: A string that represents the document's binary content encoded in Base64.
type: string
filename:
description: The name of the file, including its extension.
type: string
required:
- document_binary_base64
- filename
type: object
APIPostBorrower:
properties:
account_number:
default: null
description: The account identifier. Only IBANs are supported at the moment.
type:
- string
- 'null'
address:
allOf:
- $ref: '#/components/schemas/BusinessAddress'
default: null
directors:
default: null
items:
$ref: '#/components/schemas/APICreateDirector'
minItems: 1
type:
- array
- 'null'
identifier:
description: Legal identifier of the business, such as its SIRET or SIREN in France. Must not contain spaces.
type: string
identifier_type:
default: null
description: Type of legal business identifier of the business, such as the SIRET in France.
enum:
- belgium_registration_number
- bsn
- cif
- hr_nummer
- kvk
- nif
- siren
- siret
- steuernummer
- vat_number
- null
type:
- string
- 'null'
legal_form:
default: null
description: Legal form of the business.
type:
- string
- 'null'
metadata:
additionalProperties: {}
default: null
description: This object is yours, it enables you to add custom data.
type:
- object
- 'null'
name:
default: null
description: Legal name of the business.
type:
- string
- 'null'
owner:
allOf:
- $ref: '#/components/schemas/APICreateOwner'
default: null
description: The person requesting subscribing to Defacto on behalf of the borrowers. Must be added as a director too
preferred_language:
default: null
description: 'Preferred language of the borrower in format ISO 639-1 (examples: [fr, en, es, de, nl]).'
type:
- string
- 'null'
signed_at:
default: null
description: datetime of the borrower's signature. Usually time the borrower clicked on our T&Cs checkbox
format: date-time
type:
- string
- 'null'
vat_number:
default: null
description: VatNumber
type:
- string
- 'null'
wait_for_ready:
default: false
description: Wait for the borrower to be ready to request a first loan.Many actions have to run in the background (KYC, scoring, contract generation and so on).We recommend you to subscribe to the CreditLine.CREATED webhook in order to be notified in real time when the credit line is available.
type: boolean
required:
- identifier
type: object
GenerateInvoiceRequest:
properties:
buyer:
allOf:
- $ref: '#/components/schemas/APICounterpartyCreation'
default: null
country:
default: FRA
enum:
- BEL
- DEU
- ESP
- FRA
- GUF
- ISL
- MAF
- NLD
- REU
type: string
scenario:
default: SUCCESS
enum:
- CANCEL
- FAIL
- REJECT
- SUCCESS
- SUCCESS_ONE_DAY_LATER
type: string
seller:
allOf:
- $ref: '#/components/schemas/APICounterpartyCreation'
default: null
type: object
BusinessAddress:
properties:
address_line_1:
type: string
address_line_2:
default: null
type:
- string
- 'null'
city:
type: string
country:
type: string
postal_code:
maxLength: 10
type: string
state:
default: null
type:
- string
- 'null'
required:
- address_line_1
- city
- country
- postal_code
type: object
APIDraftableInvoiceCreation:
properties:
buyer:
allOf:
- $ref: '#/components/schemas/APICounterpartyCreation'
default: null
currency:
default: EUR
description: Currency of the invoice. Use ISO 4217 currency code.
enum:
- EUR
- GBP
type:
- string
- 'null'
document:
description: PDF binary (format base64 string)
type: string
due_at:
default: null
format: date-time
type:
- string
- 'null'
invoice_number:
default: null
description: Invoice number as displayed on the invoice
type:
- string
- 'null'
is_draft:
default: false
description: True by default, set to false if you want to create and validate invoice in one API call.
type:
- boolean
- 'null'
issued_at:
default: null
format: date-time
type:
- string
- 'null'
metadata:
additionalProperties: {}
default: null
description: This object is yours, it enables you to add custom data.
type:
- object
- 'null'
net_amount:
default: null
description: Amount before tax, in cents
type:
- integer
- 'null'
seller:
allOf:
- $ref: '#/components/schemas/APICounterpartyCreation'
default: null
tax_amount:
default: null
description: Amount of tax, in cents
type:
- integer
- 'null'
to_account:
allOf:
- $ref: '#/components/schemas/APIAccountCreation'
default: null
description: Beneficiary account as mentioned on the invoice. Note that this does not determine the account where the loan payment will be made.That is done separately when calling the POST /loans endpoint.
to_pay_amount:
default: null
description: Remaining amount due by buyer to seller, in cents. Set at 0 for fully paid invoices.
type:
- integer
- 'null'
total_amount:
default: null
description: Sum of net amount and tax amount, in cents
type:
- integer
- 'null'
required:
- document
type: object
GenerateIbanResponse:
properties:
iban:
type: string
required:
- iban
type: object
APICreateIdentityDocuments:
properties:
custom_identity_documents:
default: null
items:
$ref: '#/components/schemas/APIIdentityDocument'
type:
- array
- 'null'
identity_document_back:
allOf:
- $ref: '#/components/schemas/APIIdentityDocument'
default: null
identity_document_front:
allOf:
- $ref: '#/components/schemas/APIIdentityDocument'
default: null
type: object
securitySchemes:
Bearer:
in: header
name: Authorization
type: apiKey