{
  "components": {
    "securitySchemes": {
      "bearer": {
        "description": "> You must put the word `Bearer` or `Token` in the `Authorization` header before your token e.g:\n>```\n>Authorization: Bearer <Your API token>\n>```\n> Examples generated from this schema may be missing the word `Bearer`.\n",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "iwoca Lending API",
    "title": "Lending API",
    "version": "v2.2"
  },
  "openapi": "3.1.0",
  "paths": {
    "/authentication_check/": {
      "get": {
        "description": "Use this endpoint to check that the authorisation header is being set correctly, and that you can successfully hit the iwoca Lending API.\n\nYou should receive a `200: Status OK` response if everything is setup correctly.",
        "operationId": "checkAuthenticated",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "example": {
                    "version": "v2.2"
                  },
                  "properties": {
                    "version": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "version"
                  ],
                  "type": "object"
                }
              }
            },
            "description": ""
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Authentication check for partners",
        "tags": [
          "Authentication Check"
        ]
      }
    },
    "/customers/": {
      "post": {
        "description": "This `POST` request should be used to create an iwoca account for the customer. We'll return a `customer_id` that can be used to identify the customer in all future requests. For more information, see 'Create a customer' in the documentation.",
        "operationId": "createNewCustomer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "description": "The customers endpoint. This holds state information about the customer.",
                "example": {
                  "data": {
                    "company": {
                      "company_number": "01111112",
                      "last_12_months_turnover": {
                        "amount": 700000,
                        "valid_from": "2016-10-12T14:05:51.666Z"
                      },
                      "registered_company_name": "COMPANY NAME",
                      "trading_from_date": "2010-02-01",
                      "type": "limited_liability_company",
                      "vat_status": {
                        "is_vat_registered": false
                      }
                    },
                    "people": [
                      {
                        "date_of_birth": "1980-01-01",
                        "emails": [
                          {
                            "email": "enorton1777+test@iwoca.co.uk",
                            "type": "primary"
                          }
                        ],
                        "first_name": "Ervin",
                        "last_name": "Norton",
                        "phones": [
                          {
                            "number": "07700900370",
                            "type": "primary"
                          }
                        ],
                        "privacy_policy": {
                          "agreed": true,
                          "valid_from": "2016-10-12T14:05:51.666Z"
                        },
                        "residential_addresses": [
                          {
                            "country": "GB",
                            "date_from": "2014-02-03",
                            "house_number": "286",
                            "postcode": "CB62AG",
                            "residential_status": "owner_with_mortgage",
                            "street_line_1": "Idverifier St",
                            "town": "Ely"
                          }
                        ],
                        "roles": [
                          "applicant",
                          "shareholder",
                          "guarantor",
                          "director"
                        ],
                        "title": "mr",
                        "uid": "6cf7319e-f9ec-4038-ba4f-3561a6097484"
                      }
                    ]
                  }
                },
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "company": {
                        "additionalProperties": false,
                        "properties": {
                          "company_number": {
                            "description": "Company number as on Companies House.",
                            "maxLength": 50,
                            "type": "string"
                          },
                          "has_card_based_transactions": {
                            "type": "boolean"
                          },
                          "industry": {
                            "description": "Recommended format is one of: Agriculture, Forestry & Fishing / Architecture & Engineering / Business Support Services (e.g. recruitment or security) / Car Dealers, Garages & Mechanics / Cleaning, Landscaping & Gardening / Construction (e.g. builders, civil engineer or electrician) / Education & Training / Finance & Insurance / Health & Care (e.g. day-care, doctors or care homes) / Hotels, Restaurants & Pubs / IT & Communications/ Leisure / Other Services (e.g. hairdressers or travel agents) / Manufacturing, Food Processing & Printing / Professional Services (e.g. accounting or consulting) / Property & Real Estate / Publishing, Film & Media Production / Retail (online or offline) / Transport & Logistics (e.g. taxis, couriers or storage) / Wholesale / Other.",
                            "type": "string"
                          },
                          "last_12_months_profit": {
                            "additionalProperties": false,
                            "description": "Estimated profit over the last 12 months. For a young business without a full year of trading, the profit to date should be given. A negative value denotes a loss.",
                            "properties": {
                              "amount": {
                                "description": "Pre-tax amount submitted by customer in local currency. Note that this differs from monthly_non_business_income which is post-tax.",
                                "type": "number"
                              },
                              "valid_from": {
                                "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                                "format": "date-time",
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          },
                          "last_12_months_turnover": {
                            "additionalProperties": false,
                            "description": "Estimated revenue over the last 12 months. For a young business without a full year of revenue, revenue to date should be given.",
                            "properties": {
                              "amount": {
                                "description": "Amount submitted by customer in local currency or other estimate.",
                                "type": "number"
                              },
                              "valid_from": {
                                "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                                "format": "date-time",
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          },
                          "number_of_employees": {
                            "type": "integer"
                          },
                          "online_sales_percentage": {
                            "type": "integer"
                          },
                          "overdraft_status": {
                            "additionalProperties": false,
                            "properties": {
                              "has_overdraft": {
                                "description": "Specifies whether the user claims their company has a business overdraft.",
                                "type": "boolean"
                              },
                              "total_overdraft_limit": {
                                "description": "User declaration for total overdraft limit available to the company. If the company has multiple overdrafts, the sum of the limits should be used.",
                                "type": "number"
                              }
                            },
                            "required": [],
                            "type": "object"
                          },
                          "registered_address": {
                            "additionalProperties": false,
                            "properties": {
                              "building_number": {
                                "description": "Where possible, please put the building number in this field instead of including it in street_line_1",
                                "maxLength": 250,
                                "type": "string"
                              },
                              "country": {
                                "enum": [
                                  "GB",
                                  "DE",
                                  "OTHER"
                                ],
                                "maxLength": 5,
                                "type": "string"
                              },
                              "postcode": {
                                "maxLength": 250,
                                "type": "string"
                              },
                              "street_line_1": {
                                "description": "The first line of the company's address. Where possible, please use the separate building_number field instead of including the building number in street_line_1.",
                                "maxLength": 250,
                                "type": "string"
                              },
                              "street_line_2": {
                                "maxLength": 250,
                                "type": "string"
                              },
                              "town": {
                                "maxLength": 250,
                                "type": "string"
                              }
                            },
                            "required": [],
                            "title": "company_address",
                            "type": "object"
                          },
                          "registered_company_name": {
                            "description": "Registered company name for a registered business such as a limited company, as on Companies House.",
                            "maxLength": 200,
                            "type": "string"
                          },
                          "third_party_providers": {
                            "description": "Details of third-party providers used by the business such as Xero, eBay, PayPal or others.",
                            "items": {
                              "additionalProperties": false,
                              "properties": {
                                "name": {
                                  "maxLength": 200,
                                  "type": "string"
                                },
                                "type": {
                                  "enum": [
                                    "ecommerce",
                                    "software",
                                    "bank"
                                  ],
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "type"
                              ],
                              "type": "object"
                            },
                            "type": "array"
                          },
                          "trading_address": {
                            "additionalProperties": false,
                            "properties": {
                              "building_number": {
                                "description": "Where possible, please put the building number in this field instead of including it in street_line_1",
                                "maxLength": 250,
                                "type": "string"
                              },
                              "country": {
                                "enum": [
                                  "GB",
                                  "DE",
                                  "OTHER"
                                ],
                                "maxLength": 5,
                                "type": "string"
                              },
                              "postcode": {
                                "maxLength": 250,
                                "type": "string"
                              },
                              "street_line_1": {
                                "description": "The first line of the company's address. Where possible, please use the separate building_number field instead of including the building number in street_line_1.",
                                "maxLength": 250,
                                "type": "string"
                              },
                              "street_line_2": {
                                "maxLength": 250,
                                "type": "string"
                              },
                              "town": {
                                "maxLength": 250,
                                "type": "string"
                              }
                            },
                            "required": [],
                            "title": "company_address",
                            "type": "object"
                          },
                          "trading_from_date": {
                            "description": "Date when company started trading, with expected ISO 8601 format.",
                            "format": "date",
                            "type": "string"
                          },
                          "trading_name": {
                            "maxLength": 200,
                            "type": "string"
                          },
                          "type": {
                            "enum": [
                              "limited_liability_company",
                              "sole_trader",
                              "ordinary_partnership",
                              "limited_liability_partnership",
                              "public_limited_company",
                              "other"
                            ],
                            "type": "string"
                          },
                          "vat_status": {
                            "additionalProperties": false,
                            "description": "Information on the company's VAT registration status.",
                            "properties": {
                              "is_vat_registered": {
                                "type": "boolean"
                              },
                              "registered_over_3_months": {
                                "type": "boolean"
                              },
                              "vat_number": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          },
                          "website": {
                            "description": "Company website.",
                            "maxLength": 200,
                            "type": "string"
                          }
                        },
                        "required": [],
                        "title": "company",
                        "type": "object"
                      },
                      "correlation_id": {
                        "description": "If you have previously pre-qualified this customer using the `/prequalification_data` endpoint, please submit the ID you used when prequalifying the customer in either the `external_customer_id` field (if it is unique), the `correlation_id` field (if it is a UUID) or both, so that iwoca can match up the prequalification result with the customer",
                        "format": "uuid",
                        "type": "string"
                      },
                      "external_customer_id": {
                        "description": "If you have a unique identifier for the customer in your system, you can send it in this field.\nThis field accepts any string, so it does not matter what format you use for customer IDs.\nThe `external_customer_id` value will be used in the following ways:\n1. If you make a second `POST /customers` request with the same `external_customer_id`, you will get a HTTP 409 response and the response body will contain the iwoca `customer_id` of the customer you previously created for this `external_customer_id`. This is one way to avoid submitting the same customer twice if you are unable to track that on your side.\n2. If you have previously pre-qualified this customer using the `/prequalification_data` endpoint, please submit the ID you used when prequalifying the customer in either the `external_customer_id` field (if it is unique), the `correlation_id` field (if it is a UUID) or both, so that iwoca can match up the prequalification result with the customer.\n3. Some webhooks send the `external_customer_id` in addition to the iwoca `customer_id`, for convenience.",
                        "type": "string"
                      },
                      "people": {
                        "description": "People associated with the company including the applicant and any other directors, shareholders or loan guarantors you wish to submit. For every customer there should be exactly one person with the role of 'applicant' that is also a 'director' and 'guarantor'.",
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "date_of_birth": {
                              "description": "Date with expected ISO 8601 format.",
                              "format": "date",
                              "type": "string"
                            },
                            "emails": {
                              "items": {
                                "additionalProperties": false,
                                "properties": {
                                  "email": {
                                    "description": "Contact email address with format user@example.com (ideally not a generic address such as info@...).",
                                    "format": "email",
                                    "maxLength": 254,
                                    "type": "string"
                                  },
                                  "marketing_opt_in": {
                                    "additionalProperties": false,
                                    "properties": {
                                      "agreed": {
                                        "description": "Specify if user has opted in to receive marketing emails from iwoca.",
                                        "type": "boolean"
                                      },
                                      "valid_from": {
                                        "description": "Datetime when they opted in or out of marketing emails, with expected ISO 8601 format.",
                                        "format": "date-time",
                                        "type": "string"
                                      }
                                    },
                                    "required": [],
                                    "title": "marketing_opt_in",
                                    "type": "object"
                                  },
                                  "type": {
                                    "enum": [
                                      "primary",
                                      "secondary"
                                    ],
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "email"
                                ],
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "first_name": {
                              "description": "Middle name is not required.",
                              "maxLength": 100,
                              "type": "string"
                            },
                            "how_did_you_find_us": {
                              "additionalProperties": false,
                              "properties": {
                                "answer": {
                                  "description": "Enum denoting where the customer heard about us.",
                                  "enum": [
                                    "letter",
                                    "search_engine",
                                    "friend_or_press",
                                    "advisor",
                                    "email",
                                    "online_advert",
                                    "phone_call",
                                    "no_answer",
                                    "train_or_bus_ad",
                                    "radio"
                                  ],
                                  "type": "string"
                                },
                                "details": {
                                  "description": "Additional Details.",
                                  "maxLength": 50,
                                  "type": "string"
                                }
                              },
                              "required": [],
                              "type": "object"
                            },
                            "last_name": {
                              "maxLength": 100,
                              "type": "string"
                            },
                            "monthly_business_income": {
                              "additionalProperties": false,
                              "description": "The person's personal income or takings from the business per month.",
                              "properties": {
                                "amount": {
                                  "description": "Post-tax amount submitted by customer in local currency.",
                                  "type": "number"
                                },
                                "valid_from": {
                                  "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                                  "format": "date-time",
                                  "type": "string"
                                }
                              },
                              "required": [],
                              "type": "object"
                            },
                            "monthly_non_business_income": {
                              "additionalProperties": false,
                              "description": "No longer required",
                              "properties": {
                                "amount": {
                                  "description": "Post-tax amount submitted by customer in local currency.",
                                  "type": "number"
                                },
                                "valid_from": {
                                  "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                                  "format": "date-time",
                                  "type": "string"
                                }
                              },
                              "required": [],
                              "type": "object"
                            },
                            "monthly_non_housing_expenses": {
                              "additionalProperties": false,
                              "description": "No longer needed",
                              "properties": {
                                "amount": {
                                  "description": "Amount submitted by customer in local currency.",
                                  "type": "number"
                                },
                                "valid_from": {
                                  "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                                  "format": "date-time",
                                  "type": "string"
                                }
                              },
                              "required": [],
                              "type": "object"
                            },
                            "monthly_other_household_income": {
                              "additionalProperties": false,
                              "description": "Total income from other members of the applicant's household such as their wife or husband. Does not include their own income.",
                              "properties": {
                                "amount": {
                                  "type": "number"
                                },
                                "valid_from": {
                                  "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                                  "format": "date-time",
                                  "type": "string"
                                }
                              },
                              "required": [],
                              "type": "object"
                            },
                            "number_of_dependents": {
                              "additionalProperties": false,
                              "description": "Number of people that are financially dependent on the person (such as children or people in their care).",
                              "properties": {
                                "count": {
                                  "type": "integer"
                                },
                                "valid_from": {
                                  "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                                  "format": "date-time",
                                  "type": "string"
                                }
                              },
                              "required": [],
                              "type": "object"
                            },
                            "phones": {
                              "items": {
                                "additionalProperties": false,
                                "description": "Contact phone numbers. It's preferable to have both a primary and secondary phone number for the applicant if available.",
                                "properties": {
                                  "number": {
                                    "description": "Quite flexible, can handle with/without country code, e.g. +447778473883 / 07778473883.",
                                    "maxLength": 20,
                                    "type": "string"
                                  },
                                  "type": {
                                    "description": "The applicant must have at least one primary number.",
                                    "enum": [
                                      "primary",
                                      "secondary"
                                    ]
                                  }
                                },
                                "required": [
                                  "number"
                                ],
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "privacy_policy": {
                              "additionalProperties": false,
                              "description": "Required to retrieve an automated decision. This field denotes both that the customer agrees to the iwoca privacy policy AND that they have received reasonable, visible notice that iwoca will perform a soft credit check.",
                              "properties": {
                                "agreed": {
                                  "description": "Specify whether the user has agreed to the iwoca privacy policy.",
                                  "type": "boolean"
                                },
                                "valid_from": {
                                  "description": "Datetime when they agreed or disagreed with the iwoca privacy policy, with expected ISO 8601 format.",
                                  "format": "date-time",
                                  "type": "string"
                                }
                              },
                              "required": [],
                              "type": "object"
                            },
                            "residential_addresses": {
                              "items": {
                                "additionalProperties": false,
                                "properties": {
                                  "country": {
                                    "enum": [
                                      "GB",
                                      "DE",
                                      "OTHER"
                                    ],
                                    "maxLength": 5,
                                    "type": "string"
                                  },
                                  "date_from": {
                                    "description": "Optionally specify the date when they moved to this address. This date can be an estimate.",
                                    "example": "2016-10-23",
                                    "format": "date",
                                    "type": "string"
                                  },
                                  "equifax_token": {
                                    "description": "Equifax's PTCABS token. If you have access to this, providing it here could help us retrieve credit information more consistently.",
                                    "maxLength": 250,
                                    "type": "string"
                                  },
                                  "flat_number": {
                                    "description": "Where possible, please put the flat number in this field instead of including it in street_line_1",
                                    "maxLength": 250,
                                    "type": "string"
                                  },
                                  "house_name": {
                                    "description": "Where possible, please put the house name in this field instead of including it in street_line_1",
                                    "maxLength": 250,
                                    "type": "string"
                                  },
                                  "house_number": {
                                    "description": "Where possible, please put the house number in this field instead of including it in street_line_1",
                                    "maxLength": 250,
                                    "type": "string"
                                  },
                                  "monthly_housing_expenses": {
                                    "additionalProperties": false,
                                    "description": "No longer needed",
                                    "properties": {
                                      "amount": {
                                        "type": "number"
                                      },
                                      "valid_from": {
                                        "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                                        "format": "date-time",
                                        "type": "string"
                                      }
                                    },
                                    "required": [],
                                    "type": "object"
                                  },
                                  "postcode": {
                                    "maxLength": 250,
                                    "type": "string"
                                  },
                                  "property_value": {
                                    "additionalProperties": false,
                                    "description": "No longer needed",
                                    "properties": {
                                      "amount": {
                                        "description": "Amount in local currency.",
                                        "type": "number"
                                      },
                                      "valid_from": {
                                        "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                                        "format": "date-time",
                                        "type": "string"
                                      }
                                    },
                                    "required": [],
                                    "type": "object"
                                  },
                                  "residential_status": {
                                    "description": "No longer needed",
                                    "enum": [
                                      "tenant",
                                      "owner_with_mortgage",
                                      "owner_no_mortgage",
                                      "rent_free"
                                    ],
                                    "type": "string"
                                  },
                                  "street_line_1": {
                                    "description": "The first line of the customer's address. Usually the street name, but can include the building name or number. Where possible, please use the separate house_number, house_name and/or flat_number fields instead of including the house name/number in street_line_1.",
                                    "maxLength": 250,
                                    "type": "string"
                                  },
                                  "street_line_2": {
                                    "description": "The second line of the customer's address, between street_line_1 and town.",
                                    "maxLength": 250,
                                    "type": "string"
                                  },
                                  "town": {
                                    "maxLength": 250,
                                    "type": "string"
                                  }
                                },
                                "required": [],
                                "title": "address",
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "roles": {
                              "description": "There should only be one applicant but there may be multiple people with the other roles.",
                              "items": {
                                "enum": [
                                  "shareholder",
                                  "applicant",
                                  "director",
                                  "guarantor",
                                  "partner",
                                  "other",
                                  "beneficial_owner"
                                ],
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "title": {
                              "enum": [
                                "mr",
                                "ms",
                                "mrs",
                                "miss",
                                "doctor",
                                "professor",
                                "sir",
                                "lord",
                                "lady",
                                "baron",
                                "baroness",
                                "rev",
                                "other"
                              ],
                              "type": "string"
                            },
                            "uid": {
                              "description": "Unique identifier created and stored by the partner which will allow you to retrieve/update this data in the future.",
                              "format": "uuid",
                              "type": "string"
                            }
                          },
                          "required": [
                            "uid"
                          ],
                          "title": "person",
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "required": [],
                    "type": "object"
                  }
                },
                "required": [],
                "title": "customer_payload",
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "description": "Present only if the request went fine.",
                      "properties": {
                        "customer_id": {
                          "format": "uuid",
                          "type": "string"
                        }
                      },
                      "required": [
                        "customer_id"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Customer UID correctly received."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Create an iwoca account for a new customer",
        "tags": [
          "Customer"
        ]
      }
    },
    "/customers/{customer_id}/applications/": {
      "parameters": [
        {
          "description": "The unique customer_id used to represent a customer.",
          "in": "path",
          "name": "customer_id",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        }
      ],
      "post": {
        "description": "Creates an Application for the customer. If a valid `introducer_id` (a UUID) is provided, the Application will be assigned to that introducer. For more information, see 'Make an application' in the documentation.",
        "operationId": "createApplicationForCustomer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "data": {
                    "requests": [
                      {
                        "amount": 15000,
                        "duration": {
                          "amount": 12,
                          "unit": "months"
                        }
                      }
                    ]
                  }
                },
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "introducer": {
                        "additionalProperties": false,
                        "properties": {
                          "entity_to_contact": {
                            "enum": [
                              "introducer",
                              "customer",
                              "no_one"
                            ],
                            "type": "string"
                          },
                          "introducer_id": {
                            "description": "The unique id of the introducer this application should be assigned to. This id is generated by iwoca when the introducer signs up for an iwoca portal account at https://www.iwoca.co.uk/introducer/ and can be retrieved from the /introducers/ endpoint.",
                            "format": "uuid",
                            "type": "string"
                          }
                        },
                        "required": [],
                        "type": "object"
                      },
                      "last_12_months_turnover": {
                        "additionalProperties": false,
                        "description": "Estimated revenue over the last 12 months. For a young business without a full year of revenue, revenue to date should be given.",
                        "properties": {
                          "amount": {
                            "description": "Amount submitted by customer in local currency or other estimate.",
                            "type": "number"
                          },
                          "valid_from": {
                            "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                            "format": "date-time",
                            "type": "string"
                          }
                        },
                        "required": [
                          "amount",
                          "valid_from"
                        ],
                        "type": "object"
                      },
                      "requests": {
                        "items": {
                          "additionalProperties": false,
                          "description": "",
                          "properties": {
                            "amount": {
                              "format": "float",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "detailed_purpose": {
                              "description": "detailed_purpose is usually submitted if a purpose of other has been set.",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "duration": {
                              "additionalProperties": false,
                              "properties": {
                                "amount": {
                                  "format": "float",
                                  "type": "number"
                                },
                                "unit": {
                                  "enum": [
                                    "days",
                                    "months",
                                    "years"
                                  ],
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "unit"
                              ],
                              "type": [
                                "object",
                                "null"
                              ]
                            },
                            "purpose": {
                              "description": "A purpose may not be submitted if the customer is simply looking to get approved for the future, rather than a specific need.",
                              "enum": [
                                "stock_purchase",
                                "bridging_loan",
                                "marketing",
                                "equipment_purchase",
                                "pay_bill",
                                "pay_staff",
                                "refinancing_debt",
                                "financing_client_order",
                                "pay_tax_bill",
                                "other",
                                "acquisition",
                                "expansion",
                                "shareholder_buyout",
                                "property_renovations",
                                "property_purchase",
                                null
                              ],
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "urgency": {
                              "description": "Describes whether the customer needs the funding immediately (asap), over the next few weeks (weeks) or is simply looking to get approved for future use (future).",
                              "enum": [
                                "asap",
                                "weeks",
                                "future_use",
                                null
                              ],
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "amount"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "requests"
                    ]
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "application_id": {
                          "description": "uid of application (uuid4)",
                          "format": "uuid",
                          "type": "string"
                        }
                      },
                      "required": [
                        "application_id"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Create user application",
        "tags": [
          "Application"
        ]
      },
      "put": {
        "description": "Creates or updates an Application for the customer. If an open application exists, it will be updated. Otherwise, a new application will be created.",
        "operationId": "createOrUpdateApplicationForCustomer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "data": {
                    "requests": [
                      {
                        "amount": 15000,
                        "duration": {
                          "amount": 12,
                          "unit": "months"
                        }
                      }
                    ]
                  }
                },
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "introducer": {
                        "additionalProperties": false,
                        "properties": {
                          "entity_to_contact": {
                            "enum": [
                              "introducer",
                              "customer",
                              "no_one"
                            ],
                            "type": "string"
                          },
                          "introducer_id": {
                            "description": "The unique id of the introducer this application should be assigned to. This id is generated by iwoca when the introducer signs up for an iwoca portal account at https://www.iwoca.co.uk/introducer/ and can be retrieved from the /introducers/ endpoint.",
                            "format": "uuid",
                            "type": "string"
                          }
                        },
                        "required": [],
                        "type": "object"
                      },
                      "last_12_months_turnover": {
                        "additionalProperties": false,
                        "description": "Estimated revenue over the last 12 months. For a young business without a full year of revenue, revenue to date should be given.",
                        "properties": {
                          "amount": {
                            "description": "Amount submitted by customer in local currency or other estimate.",
                            "type": "number"
                          },
                          "valid_from": {
                            "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                            "format": "date-time",
                            "type": "string"
                          }
                        },
                        "required": [
                          "amount",
                          "valid_from"
                        ],
                        "type": "object"
                      },
                      "requests": {
                        "items": {
                          "additionalProperties": false,
                          "description": "",
                          "properties": {
                            "amount": {
                              "format": "float",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "detailed_purpose": {
                              "description": "detailed_purpose is usually submitted if a purpose of other has been set.",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "duration": {
                              "additionalProperties": false,
                              "properties": {
                                "amount": {
                                  "format": "float",
                                  "type": "number"
                                },
                                "unit": {
                                  "enum": [
                                    "days",
                                    "months",
                                    "years"
                                  ],
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "unit"
                              ],
                              "type": [
                                "object",
                                "null"
                              ]
                            },
                            "purpose": {
                              "description": "A purpose may not be submitted if the customer is simply looking to get approved for the future, rather than a specific need.",
                              "enum": [
                                "stock_purchase",
                                "bridging_loan",
                                "marketing",
                                "equipment_purchase",
                                "pay_bill",
                                "pay_staff",
                                "refinancing_debt",
                                "financing_client_order",
                                "pay_tax_bill",
                                "other",
                                "acquisition",
                                "expansion",
                                "shareholder_buyout",
                                "property_renovations",
                                "property_purchase",
                                null
                              ],
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "urgency": {
                              "description": "Describes whether the customer needs the funding immediately (asap), over the next few weeks (weeks) or is simply looking to get approved for future use (future).",
                              "enum": [
                                "asap",
                                "weeks",
                                "future_use",
                                null
                              ],
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "amount"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "requests"
                    ]
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "application_id": {
                          "description": "uid of application (uuid4)",
                          "format": "uuid",
                          "type": "string"
                        }
                      },
                      "required": [
                        "application_id"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Create or update user application",
        "tags": [
          "Application"
        ]
      }
    },
    "/customers/{customer_id}/applications/latest/": {
      "get": {
        "description": "Returns user's latest application information",
        "operationId": "getLatestApplicationForCustomer",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "example": {
                    "data": {
                      "application_id": "48ac72d0-a829-4896-a067-dcb1c2b0f30c",
                      "decline_reasons": [
                        {
                          "reason": "Approval requirement decline",
                          "reason_detail": "complete_personal_credit_check"
                        }
                      ],
                      "is_closed": true,
                      "last_12_months_turnover": {
                        "amount": 500000,
                        "valid_from": "2019-08-24T14:15:22Z"
                      },
                      "requests": [
                        {
                          "amount": 55000,
                          "detailed_purpose": "string",
                          "duration": {
                            "amount": 365,
                            "unit": "days"
                          },
                          "is_topup": false,
                          "purpose": "stock_purchase",
                          "suggested_product": {
                            "amount": 50000,
                            "duration": {
                              "amount": 365,
                              "unit": "days"
                            }
                          },
                          "urgency": "asap"
                        }
                      ],
                      "status": "declined"
                    }
                  },
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "application_id": {
                          "description": "uid of application (uuid4)",
                          "format": "uuid",
                          "type": "string"
                        },
                        "decline_reasons": {
                          "description": "When an application has been declined, this field will describe the reasons for the decline.",
                          "items": {
                            "additionalProperties": false,
                            "properties": {
                              "reason": {
                                "enum": [
                                  "Approval requirement decline",
                                  "Credit assessment decline",
                                  "Auto-reject assessment decline",
                                  "Resource decline",
                                  "Ineligibility decline",
                                  "Unknown",
                                  "Other"
                                ],
                                "example": "Credit assessment decline",
                                "type": "string"
                              },
                              "reason_detail": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "reason"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "is_closed": {
                          "description": "Has the application been closed",
                          "type": "boolean"
                        },
                        "last_12_months_turnover": {
                          "additionalProperties": false,
                          "description": "Estimated revenue over the last 12 months. For a young business without a full year of revenue, revenue to date should be given.",
                          "properties": {
                            "amount": {
                              "description": "Amount submitted by customer in local currency or other estimate.",
                              "type": "number"
                            },
                            "valid_from": {
                              "description": "Datetime when user submitted data, with expected ISO 8601 format.",
                              "format": "date-time",
                              "type": "string"
                            }
                          },
                          "required": [
                            "amount"
                          ],
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "requests": {
                          "items": {
                            "additionalProperties": false,
                            "description": "",
                            "properties": {
                              "amount": {
                                "format": "float",
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "detailed_purpose": {
                                "description": "detailed_purpose is usually submitted if a purpose of other has been set.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "duration": {
                                "additionalProperties": false,
                                "properties": {
                                  "amount": {
                                    "format": "float",
                                    "type": "number"
                                  },
                                  "unit": {
                                    "enum": [
                                      "days",
                                      "months",
                                      "years"
                                    ],
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "unit"
                                ],
                                "type": [
                                  "object",
                                  "null"
                                ]
                              },
                              "is_topup": {
                                "description": "Whether this request is a top-up on an existing loan.",
                                "type": "boolean"
                              },
                              "purpose": {
                                "description": "A purpose may not be submitted if the customer is simply looking to get approved for the future, rather than a specific need.",
                                "enum": [
                                  "stock_purchase",
                                  "bridging_loan",
                                  "marketing",
                                  "equipment_purchase",
                                  "pay_bill",
                                  "pay_staff",
                                  "refinancing_debt",
                                  "financing_client_order",
                                  "pay_tax_bill",
                                  "other",
                                  null
                                ],
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "suggested_product": {
                                "additionalProperties": false,
                                "properties": {
                                  "amount": {
                                    "format": "float",
                                    "type": "number"
                                  },
                                  "duration": {
                                    "additionalProperties": false,
                                    "properties": {
                                      "amount": {
                                        "format": "float",
                                        "type": "number"
                                      },
                                      "unit": {
                                        "enum": [
                                          "days",
                                          "months",
                                          "years"
                                        ],
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "amount",
                                      "unit"
                                    ],
                                    "type": "object"
                                  }
                                },
                                "required": [
                                  "duration",
                                  "amount"
                                ],
                                "type": "object"
                              },
                              "urgency": {
                                "description": "Describes whether the customer needs the funding immediately (asap), over the next few weeks (weeks) or is simply looking to get approved for future use (future).",
                                "enum": [
                                  "asap",
                                  "weeks",
                                  "future_use",
                                  null
                                ],
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "amount",
                              "duration",
                              "purpose",
                              "detailed_purpose",
                              "urgency",
                              "is_topup",
                              "suggested_product"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "status": {
                          "description": "The current status of the user's latest application",
                          "enum": [
                            "funded",
                            "expired",
                            "talking_to_customer",
                            "offered",
                            "declined",
                            "deferred",
                            "in_underwriting",
                            "awaiting_underwriter",
                            "open",
                            "action_required",
                            "offer_revoked",
                            "customer_to_link_open_banking",
                            "conditional_offer",
                            "conditional_offer_criteria_met"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "status",
                        "is_closed",
                        "application_id",
                        "requests",
                        "last_12_months_turnover"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": ""
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Get user latest application",
        "tags": [
          "Application"
        ]
      },
      "parameters": [
        {
          "description": "The unique customer_id used to represent a customer.",
          "in": "path",
          "name": "customer_id",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        }
      ],
      "patch": {
        "description": "Update user application",
        "operationId": "updateLatestApplicationForCustomer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "data": {
                    "introducer": {
                      "entity_to_contact": "customer"
                    }
                  }
                },
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "introducer": {
                        "additionalProperties": false,
                        "properties": {
                          "entity_to_contact": {
                            "enum": [
                              "introducer",
                              "customer"
                            ],
                            "type": "string"
                          },
                          "introducer_id": {
                            "description": "The unique id of the introducer this application should be assigned to. This id is generated by iwoca when the introducer signs up for an iwoca portal account at https://www.iwoca.co.uk/introducer/ and can be retrieved from the /introducers/ endpoint.",
                            "format": "uuid",
                            "type": "string"
                          }
                        },
                        "required": [],
                        "type": "object"
                      },
                      "requests": {
                        "items": {
                          "additionalProperties": false,
                          "description": "",
                          "properties": {
                            "amount": {
                              "format": "float",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "detailed_purpose": {
                              "description": "detailed_purpose is usually submitted if a purpose of other has been set.",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "duration": {
                              "additionalProperties": false,
                              "properties": {
                                "amount": {
                                  "format": "float",
                                  "type": "number"
                                },
                                "unit": {
                                  "enum": [
                                    "days",
                                    "months",
                                    "years"
                                  ],
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "unit"
                              ],
                              "type": [
                                "object",
                                "null"
                              ]
                            },
                            "purpose": {
                              "description": "A purpose may not be submitted if the customer is simply looking to get approved for the future, rather than a specific need.",
                              "enum": [
                                "stock_purchase",
                                "bridging_loan",
                                "marketing",
                                "equipment_purchase",
                                "pay_bill",
                                "pay_staff",
                                "refinancing_debt",
                                "financing_client_order",
                                "pay_tax_bill",
                                "other",
                                "acquisition",
                                "expansion",
                                "shareholder_buyout",
                                "property_renovations",
                                "property_purchase",
                                null
                              ],
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "urgency": {
                              "description": "Describes whether the customer needs the funding immediately (asap), over the next few weeks (weeks) or is simply looking to get approved for future use (future).",
                              "enum": [
                                "asap",
                                "weeks",
                                "future_use",
                                null
                              ],
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "amount"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "required": []
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Update user application",
        "tags": [
          "Application"
        ]
      }
    },
    "/customers/{customer_id}/login_link/": {
      "get": {
        "description": "Returns a link which the customer can follow to log in to their iwoca account and progress their application. Before you can generate a login link, you must have created an application for the customer (using the applications endpoint) and the contact entity must be set to customer. For more information, see 'Retrieve a login link' in the documentation. If you are testing your integration in our sandbox and want to follow the login link yourself, we recommend opening it in an 'Incognito' tab as you may already be signed in to our website via our Developer Portal.",
        "operationId": "getLoginLinkForCustomer",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "login_link": {
                          "format": "uri",
                          "type": "string"
                        }
                      },
                      "required": [
                        "login_link"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Get a login link for a customer from a given customer_id"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Get a login link for a customer",
        "tags": [
          "Login Link"
        ]
      },
      "parameters": [
        {
          "description": "The unique customer_id used to represent a customer.",
          "in": "path",
          "name": "customer_id",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        },
        {
          "description": "The offer you're linking the customer to.",
          "in": "query",
          "name": "offer_id",
          "required": false,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        }
      ]
    },
    "/applications/{application_id}/offers/": {
      "get": {
        "description": "Generates offers for an application.",
        "operationId": "generateOffersForApplication",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "example": {
                    "data": {
                      "offer_creation_status": "offers_available",
                      "offers": [
                        {
                          "data_requirements": [
                            {
                              "actions": [
                                {
                                  "name": "upload_bank_statement",
                                  "quantifier": {
                                    "unit": "months",
                                    "value": 6
                                  }
                                }
                              ],
                              "category": "documents"
                            },
                            {
                              "actions": [
                                {
                                  "name": "outstanding_cbils_or_bbl"
                                }
                              ],
                              "category": "company_data"
                            }
                          ],
                          "duration": {
                            "amount": 365,
                            "unit": "days"
                          },
                          "interest_rate": 2.8,
                          "is_suggested": true,
                          "max_amount": 48000,
                          "offer_id": "2c2155b5-1c68-4479-95ca-ae93d7501f9c",
                          "offer_type": "indicative",
                          "probability_of_offer": "high",
                          "timeout": "2022-08-01T00:00:00+0000"
                        },
                        {
                          "approximate_apr": 39.95,
                          "duration": {
                            "amount": 365,
                            "unit": "days"
                          },
                          "interest_rate": 2.8,
                          "is_suggested": false,
                          "max_amount": 15000,
                          "offer_id": "0873268f-4930-411c-8f28-4c298089730f",
                          "offer_type": "confirmed",
                          "payment_interval": "1m",
                          "personal_guarantee_proportion": 100,
                          "timeout": "2022-08-01T00:00:00+0000"
                        }
                      ]
                    }
                  },
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "decline_reasons": {
                          "description": "When an application has been declined, this field will describe the reasons for the decline.",
                          "items": {
                            "additionalProperties": false,
                            "properties": {
                              "reason": {
                                "enum": [
                                  "Approval requirement decline",
                                  "Credit assessment decline",
                                  "Auto-reject assessment decline",
                                  "Resource decline",
                                  "Ineligibility decline",
                                  "Unknown",
                                  "Other"
                                ],
                                "example": "Credit assessment decline",
                                "type": "string"
                              },
                              "reason_detail": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "reason"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "offer_creation_status": {
                          "description": "The offer creation status indicates if offers are available, and if not what the reason is (a defer, a decline or other). The applications endpoint should be used to get more detailed information about the application status",
                          "enum": [
                            "offers_available",
                            "declined",
                            "deferred",
                            "other"
                          ],
                          "example": "offers_available",
                          "type": "string"
                        },
                        "offers": {
                          "items": {
                            "additionalProperties": false,
                            "properties": {
                              "approximate_apr": {
                                "description": "Approximate Annual Percentage Rate",
                                "example": 39.95,
                                "format": "float",
                                "type": "number"
                              },
                              "average_interest_only_repayment_amount": {
                                "description": "The average amount of each repayment during the interest only period at the beginning of the loan. (The exact amount of each interest-only repayment is slightly different). Only included if interest_only_repayments is greater than zero. Only included in response data for offers that are confirmed and unfunded; indicative and sample offers cannot be interest-only.",
                                "example": 300,
                                "format": "float",
                                "type": "number"
                              },
                              "data_requirements": {
                                "description": "Use this field to determine next steps for your customer if the offer is not of type 'confirmed'.",
                                "items": {
                                  "additionalProperties": false,
                                  "properties": {
                                    "actions": {
                                      "items": {
                                        "additionalProperties": false,
                                        "properties": {
                                          "name": {
                                            "example": "upload_bank_statement",
                                            "type": "string"
                                          },
                                          "quantifier": {
                                            "additionalProperties": false,
                                            "description": "If an action is of category 'documents', it will have a 'quantifier' field specifying a number of documents or a number of months or years.",
                                            "properties": {
                                              "unit": {
                                                "description": "If the value represents a number of months or years, this field will specify what the unit is.",
                                                "enum": [
                                                  "months",
                                                  "years"
                                                ],
                                                "example": "months",
                                                "type": "string"
                                              },
                                              "value": {
                                                "example": 6,
                                                "type": "number"
                                              }
                                            },
                                            "required": [
                                              "value"
                                            ],
                                            "type": "object"
                                          }
                                        },
                                        "required": [
                                          "name"
                                        ],
                                        "type": "object"
                                      },
                                      "type": "array"
                                    },
                                    "category": {
                                      "enum": [
                                        "contractual",
                                        "credit_rules",
                                        "id_checks",
                                        "contact_details",
                                        "payments",
                                        "enhanced_security_check",
                                        "documents",
                                        "company_data",
                                        "personal_data",
                                        "trading_history",
                                        "know_your_customer"
                                      ],
                                      "example": "documents",
                                      "type": "string"
                                    }
                                  },
                                  "required": [],
                                  "type": "object"
                                },
                                "type": "array"
                              },
                              "duration": {
                                "additionalProperties": false,
                                "properties": {
                                  "amount": {
                                    "example": 365,
                                    "format": "float",
                                    "type": "number"
                                  },
                                  "unit": {
                                    "example": "days",
                                    "enum": [
                                      "days",
                                      "months",
                                      "years"
                                    ],
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "unit"
                                ],
                                "type": "object"
                              },
                              "fee_percentage": {
                                "description": "What percentage of the amount borrowed will be added to the loan as a fee when the customer takes the money",
                                "example": 3,
                                "format": "float",
                                "maximum": 100,
                                "minimum": 0,
                                "type": "number"
                              },
                              "interest_only_repayments": {
                                "description": "Some offers have an interest-only period. For example if the `payment_interval` is `1m` and `interest_only_repayments` is `3`, the first three months of the loan are interest-only which means the first three repayments due will be lower than the normal repayments",
                                "example": 3,
                                "format": "integer",
                                "type": "number"
                              },
                              "interest_rate": {
                                "description": "Monthly interest rate percentage",
                                "example": 2.95,
                                "format": "float",
                                "type": "number"
                              },
                              "is_conditional": {
                                "description": "Some fully credit assessed (`confirmed`) offers are conditional on data requirements being fulfilled before the customer can draw down. For example, needing to upload VAT returns.",
                                "example": false,
                                "type": "boolean"
                              },
                              "is_suggested": {
                                "description": "Whether in iwoca's opinion this offer is the one which best matches the parameters requested in the application",
                                "example": false,
                                "type": "boolean"
                              },
                              "is_topup": {
                                "description": "Whether this offer is a top-up offer for a customer with an existing loan.",
                                "example": false,
                                "type": "boolean"
                              },
                              "max_amount": {
                                "example": 50000,
                                "format": "float",
                                "type": "number"
                              },
                              "normal_repayment_amount": {
                                "description": "The amount of each repayment (assuming the customer borrows the max_amount and does not make any overpayments) after any interest-only period has ended. Included in response data for offers that are indicative, sample, or confirmed and unfunded.",
                                "example": 400,
                                "format": "float",
                                "type": "number"
                              },
                              "offer_id": {
                                "format": "uuid",
                                "type": "string"
                              },
                              "offer_type": {
                                "enum": [
                                  "sample",
                                  "indicative",
                                  "confirmed"
                                ],
                                "example": "confirmed",
                                "type": "string"
                              },
                              "payment_interval": {
                                "enum": [
                                  "30d",
                                  "14d",
                                  "7d",
                                  "1m",
                                  "1d"
                                ],
                                "example": "1m",
                                "type": "string"
                              },
                              "personal_guarantee_proportion": {
                                "description": "What percentage of the loan will be covered by a personal guarantee. For example, 100 for a normal loan or 0 for a loan with no PG required",
                                "example": 10,
                                "format": "float",
                                "maximum": 100,
                                "minimum": 0,
                                "type": "number"
                              },
                              "probability_of_offer": {
                                "description": "When the `offer_type` is `indicative`, this field indicates how likely it is that the customer will get a confirmed offer should they complete the document requirements",
                                "enum": [
                                  "very_low",
                                  "low",
                                  "medium",
                                  "high",
                                  "very_high"
                                ],
                                "example": "high",
                                "type": "string"
                              },
                              "revoked_at": {
                                "description": "Only present if the offer has been revoked. Shows the date and time at which it was revoked.",
                                "example": "2024-08-13T09:33:08+0000",
                                "type": "string"
                              },
                              "timeout": {
                                "description": "The date and time at which the offer expires",
                                "example": "2022-08-01T00:00:00+0000",
                                "type": "string"
                              },
                              "total_repayable": {
                                "description": "The total amount repayable (principal + fees + interest) assuming the customer borrows the max_amount for the full duration of the loan. Included in response data for offers that are indicative, sample, or confirmed and unfunded.",
                                "example": 1000,
                                "format": "float",
                                "type": "number"
                              }
                            },
                            "required": [
                              "offer_id",
                              "max_amount",
                              "timeout",
                              "duration"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "offer_creation_status",
                        "offers"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Generate offers",
        "tags": [
          "Offers"
        ]
      },
      "parameters": [
        {
          "in": "path",
          "name": "application_id",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        }
      ]
    },
    "/offers/{offer_id}/repayment_schedule/": {
      "get": {
        "description": "Generates a repayment schedule for a given confirmed offer id. Will return a PDF if the Content-Type header is set to application/pdf.",
        "operationId": "getRepaymentScheduleForOffer",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "example": {
                    "data": {
                      "amount_borrowed": 10000,
                      "amount_saved_by_repaying_early": 602.98,
                      "fee_percentage": 0,
                      "monthly_interest_percentage": 1.5,
                      "repayments": [
                        {
                          "amount": 917.72,
                          "breakdown": {
                            "fees": 0,
                            "interest": 140,
                            "principal": 777.72
                          },
                          "date": "2025-03-25"
                        },
                        {
                          "amount": 917.72,
                          "breakdown": {
                            "fees": 0,
                            "interest": 142.95,
                            "principal": 774.77
                          },
                          "date": "2025-04-25"
                        },
                        {
                          "amount": 8574.22,
                          "breakdown": {
                            "fees": 0,
                            "interest": 126.71,
                            "principal": 8447.51
                          },
                          "date": "2025-05-25"
                        }
                      ],
                      "total_payable": 10409.66,
                      "total_payable_breakdown": {
                        "total_fees": 0,
                        "total_interest": 409.66,
                        "total_principal": 10000
                      }
                    }
                  },
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "amount_borrowed": {
                          "description": "The amount borrowed.",
                          "example": 10000,
                          "format": "float",
                          "type": "number"
                        },
                        "amount_saved_by_repaying_early": {
                          "description": "This field is only included when when the 'pay_off_early_on' query parameter is specified. It indicates how much money the customer would save by paying off the loan on that date.",
                          "example": 602.98,
                          "format": "float",
                          "type": "number"
                        },
                        "fee_percentage": {
                          "description": "What percentage of the amount borrowed will be added to the loan as a fee when the customer takes the money",
                          "example": 0,
                          "format": "float",
                          "type": "number"
                        },
                        "monthly_interest_percentage": {
                          "description": "Monthly interest in %.",
                          "example": 1.5,
                          "format": "float",
                          "type": "number"
                        },
                        "repayments": {
                          "description": "Repayment schedule.",
                          "items": {
                            "additionalProperties": false,
                            "description": "Repayment.",
                            "properties": {
                              "amount": {
                                "example": 917.72,
                                "format": "float",
                                "type": "number"
                              },
                              "breakdown": {
                                "additionalProperties": false,
                                "description": "Repayment breakdown.",
                                "properties": {
                                  "fees": {
                                    "example": 0,
                                    "format": "float",
                                    "type": "number"
                                  },
                                  "interest": {
                                    "example": 140,
                                    "format": "float",
                                    "type": "number"
                                  },
                                  "principal": {
                                    "example": 777.72,
                                    "format": "float",
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "principal",
                                  "interest",
                                  "fees"
                                ],
                                "type": "object"
                              },
                              "date": {
                                "example": "2025-03-25",
                                "type": "string"
                              }
                            },
                            "required": [
                              "date",
                              "amount",
                              "breakdown"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "total_payable": {
                          "example": 10409.66,
                          "format": "float",
                          "type": "number"
                        },
                        "total_payable_breakdown": {
                          "additionalProperties": false,
                          "properties": {
                            "total_fees": {
                              "example": 0,
                              "format": "float",
                              "type": "number"
                            },
                            "total_interest": {
                              "example": 409.66,
                              "format": "float",
                              "type": "number"
                            },
                            "total_principal": {
                              "example": 10000,
                              "format": "float",
                              "type": "number"
                            }
                          },
                          "required": [
                            "total_principal",
                            "total_interest",
                            "total_fees"
                          ],
                          "type": "object"
                        }
                      },
                      "required": [
                        "amount_borrowed",
                        "monthly_interest_percentage",
                        "fee_percentage",
                        "repayments",
                        "total_payable",
                        "total_payable_breakdown"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              },
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Get repayment schedule for an offer",
        "tags": [
          "Repayment Schedule"
        ]
      },
      "parameters": [
        {
          "in": "path",
          "name": "offer_id",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        },
        {
          "description": "Option to simulate early repayment, given in the format YYYY-MM-DD. When included in the request, the resulting repayment schedule simulates the customer making the normal minimum payments up until the specified date and then paying off the whole remaining amount on that date",
          "in": "query",
          "name": "pay_off_early_on",
          "required": false,
          "schema": {
            "format": "date",
            "type": "string"
          }
        },
        {
          "description": "The amount of money the customer will draw down. If not included in the request this defaults to the max_amount of the offer.",
          "in": "query",
          "name": "amount",
          "required": false,
          "schema": {
            "type": "number"
          }
        }
      ]
    },
    "/document_upload/{customer_id}/": {
      "get": {
        "description": "Returns information about supporting documents previously uploaded for this customer. For some types of document this may include the document's acceptance status or certain information extracted from it. For more information, see 'Upload customer documents' in the documentation.",
        "operationId": "getUploadedDocumentMetadata",
        "parameters": [
          {
            "description": "When provided, fetches documents only for the corresponding types, else fetches all",
            "explode": true,
            "in": "query",
            "name": "document_types",
            "schema": {
              "items": {
                "enum": [
                  "bank statement",
                  "business accounts",
                  "vat return",
                  "invoices",
                  "personal id",
                  "customer broker consent",
                  "balance sheet",
                  "profit and loss",
                  "company bylaws",
                  "nif card",
                  "modelo",
                  "management accounts",
                  "aged debtor report",
                  "business plan",
                  "self assessment tax return",
                  "personal bank statement",
                  "other",
                  "cash register",
                  "cashflow forecast",
                  "outstanding debt information",
                  "list of shareholders",
                  "cbils questionnaire"
                ],
                "type": "string"
              },
              "type": "array"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "description": "List of uploaded documents",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "attributes": {
                            "additionalProperties": false,
                            "properties": {
                              "company_name": {
                                "description": "This field is only shown for VAT return and company accounts documents and is available only when status=\"complete\"",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "coverage": {
                                "description": "This field is only shown for VAT return and company accounts documents and is available only when status=\"complete\"",
                                "items": {
                                  "additionalProperties": false,
                                  "properties": {
                                    "end_date": {
                                      "format": "date",
                                      "type": "string"
                                    },
                                    "start_date": {
                                      "format": "date",
                                      "type": "string"
                                    }
                                  },
                                  "required": [],
                                  "type": "object"
                                },
                                "type": [
                                  "array",
                                  "null"
                                ]
                              },
                              "document_name": {
                                "maxLength": 255,
                                "type": "string"
                              },
                              "document_type": {
                                "enum": [
                                  "bank statement",
                                  "business accounts",
                                  "vat return",
                                  "invoices",
                                  "personal id",
                                  "customer broker consent",
                                  "balance sheet",
                                  "profit and loss",
                                  "company bylaws",
                                  "nif card",
                                  "modelo",
                                  "management accounts",
                                  "aged debtor report",
                                  "business plan",
                                  "self assessment tax return",
                                  "personal bank statement",
                                  "other",
                                  "cash register",
                                  "cashflow forecast",
                                  "outstanding debt information",
                                  "list of shareholders",
                                  "cbils questionnaire"
                                ],
                                "type": "string"
                              },
                              "end_date": {
                                "description": "This field is only shown for bank statements and only when status=\"complete\"",
                                "format": "date",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "is_verified": {
                                "description": "Whether the data processed has been verified or not. This field is applicable to bank statements, VAT returns and company accounts documents.",
                                "type": "boolean"
                              },
                              "registration_number": {
                                "description": "This field is only shown for VAT return documents and is available only when status=\"complete\"",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reject_reason": {
                                "description": "This field is applicable to bank statements, VAT returns and company accounts documents. It is available only when status=\"rejected\". Available codes: \n\n| Code | Short Description | Comment |\n| ------- | --------| --------|\n| ILLEGIBLE   | illegible   | When file is too blurry and text is not visible   |\n| PASSWORD_PROTECTED   | password not available   | File is password protected, and the password isn't available   |\n| MISSING_TRANSACTIONS   | missing transactions   | When transactions data is missing (any transaction or even full pages are missing)   |\n| MISSING_ACCOUNT_DETAILS   | missing account details   | When bank account details are missing, example, when a pdf is uploaded after removing the 1st page which contains account details   |\n| MISSING_BALANCES   | balance figures missing   | When there is not a single balance value printed anywhere in the pdf   |\n| INCOMPLETE_REFERENCES   | references missing   | when transaction references arent printed   |\n| OTHER   | other   | Any other reason   |\n| DUPLICATE   | duplicate data   | duplicate transactions or duplicate vat returns / management accounts (i.e same date range)   |\n| UNSUPPORTED_EXTENSION   | invalid extension   | file extension is csv / excel / text / html / zip or any other format which is not pdf / images   |\n| UNSUPPORTED_FORMAT   | invalid document format   |         - Screenshots<br>        - Transferwise Bank statements<br>        - Bank statements with multiple accounts mixed together, example, account score<br>        - Directly downloaded from Bank website (with active Links)<br>           |\n| NO_RELEVANT_DATA   | relevant data not found   | file uploaded as bank statement, but there is no bank statement data in the file <br>        (may be it is vat return etc)   |\n| OUTDATED_INFORMATION   | outdated information   | Example, bank statements with data from 2 years ago   |\n| OVERVIEW_UPLOADED   | overview uploaded   | vat overview has been uploaded. we require full details   |\n| MISSING_VAT_FIGURES   | missing vat value figures   | VAT return doesn’t have the 9 VAT value boxes   |\n| MISSING_COMPANY_NAME   | company name missing   | return doesn't have company name on it   |\n| DRAFT_ACCOUNTS_UPLOADED   | draft accounts uploaded   |    |\n| DETAILED_PNL_SECTION_MISSING   | detailed profit and loss section missing   |    |\n| COMPANIES_HOUSE_OVERDUE   | accounts overdue on companies house   |    |\n| MICRO_ENTITY_ACCOUNTS_UPLOADED   | micro entity accounts uploaded   |    |\n| ABRIDGED_ACCOUNTS_UPLOADED   | abridged accounts uploaded   |    |\n| MANAGEMENT_ACCOUNTS_UPLOADED   | management accounts uploaded   |    |\n| AMENDED_ACCOUNTS_UPLOADED   | amended accounts uploaded   |    |\n| FILLETTED_ACCOUNTS_UPLOADED   | filletted accounts uploaded   |    |\n| MISSING_INCOME_STATEMENT   | income statement missing   |    |\n| MISSING_BALANCE_SHEET   | balance sheet missing   |    |\n| MISSING_COMPANY_DETAILS   | company details missing   |    |\n| COMPANY_NAME_MISMATCH   | company details on document do not match companies house   |    |\n",
                                "enum": [
                                  "ILLEGIBLE",
                                  "PASSWORD_PROTECTED",
                                  "MISSING_TRANSACTIONS",
                                  "MISSING_ACCOUNT_DETAILS",
                                  "MISSING_BALANCES",
                                  "INCOMPLETE_REFERENCES",
                                  "OTHER",
                                  "DUPLICATE",
                                  "UNSUPPORTED_EXTENSION",
                                  "UNSUPPORTED_FORMAT",
                                  "NO_RELEVANT_DATA",
                                  "OUTDATED_INFORMATION",
                                  "OVERVIEW_UPLOADED",
                                  "MISSING_VAT_FIGURES",
                                  "MISSING_COMPANY_NAME",
                                  "DRAFT_ACCOUNTS_UPLOADED",
                                  "DETAILED_PNL_SECTION_MISSING",
                                  "COMPANIES_HOUSE_OVERDUE",
                                  "MICRO_ENTITY_ACCOUNTS_UPLOADED",
                                  "ABRIDGED_ACCOUNTS_UPLOADED",
                                  "MANAGEMENT_ACCOUNTS_UPLOADED",
                                  "AMENDED_ACCOUNTS_UPLOADED",
                                  "FILLETTED_ACCOUNTS_UPLOADED",
                                  "MISSING_INCOME_STATEMENT",
                                  "MISSING_BALANCE_SHEET",
                                  "MISSING_COMPANY_DETAILS",
                                  "COMPANY_NAME_MISMATCH"
                                ],
                                "type": "string"
                              },
                              "start_date": {
                                "description": "This field is only shown for bank statements and only when status=\"complete\"",
                                "format": "date",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "status": {
                                "description": "Status of uploaded document with the following possible values:\n\n* __complete__ i.e the document processing completed successfully\n* __pending__ i.e the document processing is still pending\n* __rejected__ i.e the document was rejected. This status is accompanied by the corresponding \"*reject_reason*\" attribute\n* __under_review__ i.e the document is under review\n\n            This field is applicable to bank statements, VAT returns and company accounts documents.",
                                "enum": [
                                  "complete",
                                  "rejected",
                                  "pending",
                                  "under_review"
                                ],
                                "type": "string"
                              },
                              "uploaded_at": {
                                "description": "Date the document was uploaded",
                                "format": "date-time",
                                "type": "string"
                              }
                            },
                            "required": [
                              "document_name",
                              "uploaded_at",
                              "document_type"
                            ],
                            "type": "object"
                          },
                          "id": {
                            "description": "Unique identifier for an uploaded document.",
                            "format": "hash",
                            "type": "string"
                          },
                          "relationships": {
                            "additionalProperties": false,
                            "description": "This field may be found on bank statement documents. It indicates there is an item in the `included` array with more information related to this document.",
                            "properties": {
                              "bank_account": {
                                "additionalProperties": false,
                                "properties": {
                                  "data": {
                                    "additionalProperties": false,
                                    "properties": {
                                      "id": {
                                        "description": "`id` of corresponding bank_account object in `included` array",
                                        "format": "hash",
                                        "type": "string"
                                      },
                                      "type": {
                                        "description": "`type` of corresponding object in `included` array",
                                        "enum": [
                                          "bank_account"
                                        ],
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "type"
                                    ],
                                    "type": "object"
                                  }
                                },
                                "required": [
                                  "data"
                                ],
                                "type": "object"
                              }
                            },
                            "required": [
                              "bank_account"
                            ],
                            "type": "object"
                          },
                          "type": {
                            "enum": [
                              "bank_statement",
                              "business_accounts",
                              "vat_return",
                              "invoices",
                              "personal_id",
                              "customer_broker_consent",
                              "balance_sheet",
                              "profit_and_loss",
                              "company_bylaws",
                              "nif_card",
                              "modelo",
                              "management_accounts",
                              "aged_debtor_report",
                              "business_plan",
                              "self_assessment_tax_return",
                              "personal_bank_statement",
                              "other",
                              "cash_register",
                              "cashflow_forecast",
                              "outstanding_debt_information",
                              "list_of_shareholders",
                              "cbils_questionnaire"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "id",
                          "attributes"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "included": {
                      "description": "List of objects containing additional metadata about certain documents in the `data` list",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "attributes": {
                            "additionalProperties": false,
                            "properties": {
                              "account_name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "account_number": {
                                "type": "string"
                              },
                              "bank_name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "coverage": {
                                "items": {
                                  "additionalProperties": false,
                                  "properties": {
                                    "end_date": {
                                      "format": "date",
                                      "type": "string"
                                    },
                                    "start_date": {
                                      "format": "date",
                                      "type": "string"
                                    }
                                  },
                                  "required": [],
                                  "type": "object"
                                },
                                "type": "array"
                              },
                              "currency": {
                                "type": "string"
                              },
                              "sort_code": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "bank_name",
                              "account_number",
                              "account_name",
                              "currency",
                              "coverage",
                              "sort_code"
                            ],
                            "type": "object"
                          },
                          "id": {
                            "description": "Unique identifier for the bank account.",
                            "format": "hash",
                            "type": "string"
                          },
                          "type": {
                            "enum": [
                              "bank_account"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "attributes"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "List of documents uploaded for the customer."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Conflict"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Get list of documents uploaded",
        "tags": [
          "Documents"
        ]
      },
      "parameters": [
        {
          "description": "The unique customer_id used to represent a customer.",
          "in": "path",
          "name": "customer_id",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        }
      ],
      "post": {
        "description": "Upload a customer document. For best results, all documents should be in PDF format.\n\nBank statement data collected via Open Banking can be sent as a JSON file.\nTo send multiple bank statements as JSON, make a separate request for each statement.\n(Do not combine multiple statements into one file).\nSee the `bank_statements` endpoint description for how the bank statement JSON can be formatted.\n\n## Request example\n\nThis endpoint requires a HTTP multipart form data POST request.\nThe `document_type` part indicates what kind of document is being uploaded (e.g. bank statement or VAT return).\nThe `document` part contains the file itself.\n\nThis is what the HTTP request body looks like when uploading a short text file called `profit-and-loss.txt`\nfor the customer id `823de4e0-c741-4fbe-b926-c6c04f5a7c35` using the v2.1 Lending API in the\n`stage.iwoca-dev.co.uk` environment:\n\n```\nPOST /api/lending/v2.1/document_upload/823de4e0-c741-4fbe-b926-c6c04f5a7c35/ HTTP/1.1\nAuthorization: Bearer 0000000000000000000000000000000000000000\nAccept: */*\nCache-Control: no-cache\nHost: stage.iwoca-dev.co.uk\nAccept-Encoding: gzip, deflate, br\nContent-Type: multipart/form-data; boundary=--------------------------630838601337119842678298\nContent-Length: 373\n\n----------------------------630838601337119842678298\nContent-Disposition: form-data; name=\"document_type\"\nContent-Type: text/plain\n\nprofit and loss\n----------------------------630838601337119842678298\nContent-Disposition: form-data; name=\"document\"; filename=\"profit-and-loss.txt\"\nContent-Type: text/plain\n\nThis is the Profit And Loss Statement for Example Company.\nThis year, we made...\n\n----------------------------630838601337119842678298--\n```\n\nIt is uploading the file as the document type 'profit and loss'. To send a PDF bank statement you would:\n- In the `document_type` part, replace `profit and loss` with `bank statement`\n- In the `document` part, change the `Content-Type` to `application/pdf`\n\nAnd don't forget to:\n- Change the customer ID in the URL to the appropriate customer ID\n- Set the headers as appropriate (with the correct `Authorization`, `Content-Length`, `Host` etc.)\n\n## curl example\n\n```bash\ncurl --request POST \\\n  --url https://stage.iwoca-dev.co.uk/api/lending/v2.1/document_upload/823de4e0-c741-4fbe-b926-c6c04f5a7c35/ \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer 0000000000000000000000000000000000000000' \\\n  --header 'Content-Type: multipart/form-data' \\\n  --form document=@profit-and-loss.txt \\\n  --form 'document_type=profit and loss'\n```\n\n## python3 example\n\n```python\n#!/usr/bin/python3\n\nimport requests\n\napi_token = \"0000000000000000000000000000000000000000\"\ncustomer_id = \"823de4e0-c741-4fbe-b926-c6c04f5a7c35\"\nfilename = \"profit-and-loss.txt\"\n\nurl = f\"https://stage.iwoca-dev.co.uk/api/lending/v2.1/document_upload/{customer_id}/\"\nheaders = {\"Authorization\": f\"Bearer {api_token}\"}\n\nwith open(filename, \"rb\") as opened_file:\n    files_dict = {\"document\": (filename, opened_file)}\n    form_dict = {\"document_type\": \"profit and loss\"}\n\n    response = requests.post(url, files=files_dict, data=form_dict, headers=headers)\n\n    assert response.status_code == 201, response.content.decode()\n```\n",
        "operationId": "uploadDocumentForCustomer",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "document": {
                    "format": "binary",
                    "type": "string"
                  },
                  "document_type": {
                    "description": "Type of uploaded document.\n\n| File type | Value |\n| ------- | --------|\n| Bank statement   | bank statement   |\n| Company Accounts   | business accounts   |\n| VAT Return   | vat return   |\n| Invoices   | invoices   |\n| Personal ID   | personal id   |\n| Customer's broker consent   | customer broker consent   |\n| Balance Sheet   | balance sheet   |\n| Profit and Loss   | profit and loss   |\n| Company Bylaws   | company bylaws   |\n| NIF Card   | nif card   |\n| Modelo   | modelo   |\n| Management Accounts   | management accounts   |\n| Aged Debtor Report   | aged debtor report   |\n| Business Plan   | business plan   |\n| Self Assessment Tax Return   | self assessment tax return   |\n| Personal Bank Statement   | personal bank statement   |\n| Other   | other   |\n| Cash Register   | cash register   |\n| Cashflow Forecast   | cashflow forecast   |\n| Outstanding debt information   | outstanding debt information   |\n| List of shareholders   | list of shareholders   |\n| Cbils Questionnaire   | cbils questionnaire   |\n",
                    "enum": [
                      "bank statement",
                      "business accounts",
                      "vat return",
                      "invoices",
                      "personal id",
                      "customer broker consent",
                      "balance sheet",
                      "profit and loss",
                      "company bylaws",
                      "nif card",
                      "modelo",
                      "management accounts",
                      "aged debtor report",
                      "business plan",
                      "self assessment tax return",
                      "personal bank statement",
                      "other",
                      "cash register",
                      "cashflow forecast",
                      "outstanding debt information",
                      "list of shareholders",
                      "cbils questionnaire"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "document",
                  "document_type"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "document_id": {
                          "description": "Unique identifier for an uploaded document.",
                          "format": "hash",
                          "type": "string"
                        },
                        "document_name": {
                          "maxLength": 255,
                          "type": "string"
                        },
                        "document_type": {
                          "description": "Type of uploaded document.\n\n| File type | Value |\n| ------- | --------|\n| Bank statement   | bank statement   |\n| Company Accounts   | business accounts   |\n| VAT Return   | vat return   |\n| Invoices   | invoices   |\n| Personal ID   | personal id   |\n| Customer's broker consent   | customer broker consent   |\n| Balance Sheet   | balance sheet   |\n| Profit and Loss   | profit and loss   |\n| Company Bylaws   | company bylaws   |\n| NIF Card   | nif card   |\n| Modelo   | modelo   |\n| Management Accounts   | management accounts   |\n| Aged Debtor Report   | aged debtor report   |\n| Business Plan   | business plan   |\n| Self Assessment Tax Return   | self assessment tax return   |\n| Personal Bank Statement   | personal bank statement   |\n| Other   | other   |\n| Cash Register   | cash register   |\n| Cashflow Forecast   | cashflow forecast   |\n| Outstanding debt information   | outstanding debt information   |\n| List of shareholders   | list of shareholders   |\n| Cbils Questionnaire   | cbils questionnaire   |\n",
                          "enum": [
                            "bank statement",
                            "business accounts",
                            "vat return",
                            "invoices",
                            "personal id",
                            "customer broker consent",
                            "balance sheet",
                            "profit and loss",
                            "company bylaws",
                            "nif card",
                            "modelo",
                            "management accounts",
                            "aged debtor report",
                            "business plan",
                            "self assessment tax return",
                            "personal bank statement",
                            "other",
                            "cash register",
                            "cashflow forecast",
                            "outstanding debt information",
                            "list of shareholders",
                            "cbils questionnaire"
                          ],
                          "maxLength": 40,
                          "type": "string"
                        },
                        "upload_date": {
                          "description": "Date the document was uploaded",
                          "format": "date-time",
                          "type": "string"
                        }
                      },
                      "required": [
                        "document_id",
                        "document_name",
                        "document_type",
                        "upload_date"
                      ],
                      "title": "customer_uploaded_document"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Conflict"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unsupported Media Type"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Upload a document",
        "tags": [
          "Documents"
        ]
      }
    },
    "/bank_statements/{customer_id}/": {
      "parameters": [
        {
          "description": "The unique customer_id used to represent a customer.",
          "in": "path",
          "name": "customer_id",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        }
      ],
      "post": {
        "description": "\nUpload a business or personal bank statement in JSON format.\nIf you collect bank statement data for the customer via Open Banking,\nyou can use this endpoint as instead of uploading their statements as a PDF.\n\nThe format of the JSON statement is your choice, but must contain certain information.\nPlease inform your Partnership Manager of your desired format in advance.\n\nFor each statement, the following information is required:\n- Account number\n- Sort code\n- Account holder name\n- Currency\n- Bank name\nThe following data points are not required, but are recommended:\n- Account type (business or personal)\n- Period (date of earliest and latest transaction)\n\nFor each transaction in a statement, the following information is required:\n- Date\n- Reference\n- Amount\n- Running balance*\n*or you can provide a starting balance and closing balance for\nthe statement instead of a running balance on each transaction.\n\nYou can only send one statement at a time, so to send multiple statements you must make multiple requests.\n",
        "operationId": "addBankStatementForCustomer",
        "parameters": [
          {
            "in": "query",
            "name": "bank_statement_type",
            "required": false,
            "schema": {
              "default": "business",
              "enum": [
                "business",
                "personal"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "example": {
                  "data": {
                    "accountInfo": {
                      "accountHolder": "ABC business",
                      "accountId": "account0",
                      "accountName": "xyz",
                      "accountNumber": "12345678",
                      "accountType": "sole",
                      "availableBalance": 161.16,
                      "bankName": "ABCBank",
                      "currency": "GBP",
                      "currentBalance": 161.16,
                      "iban": "123",
                      "numberOfTransactions": 1,
                      "sortCode": "123456",
                      "subType": "EMoney",
                      "type": "Business"
                    },
                    "transactions": [
                      {
                        "accountId": "account0",
                        "amount": -100,
                        "currencyCode": "GBP",
                        "description": "Transfer to Main account. Internal transfer out",
                        "primaryCategoryDescription": "Transfers / Other",
                        "runningBalance": 161.16,
                        "subCategoryDescription": "Bank Transfer",
                        "transactionDate": "2023-03-21T00:00:00+00:00",
                        "transactionId": 12345676789
                      }
                    ]
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "bank_statement_id": {
                          "description": "Unique identifier for an uploaded bank statement.",
                          "format": "hash",
                          "type": "string"
                        },
                        "bank_statement_type": {
                          "enum": [
                            "business",
                            "personal"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "bank_statement_id",
                        "bank_statement_type"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Upload a JSON bank statement",
        "tags": [
          "Documents"
        ]
      }
    },
    "/offers/{offer_id}/select/": {
      "parameters": [
        {
          "in": "path",
          "name": "offer_id",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        }
      ],
      "post": {
        "description": "Select an offer that the customer would like to proceed with. For more information, see 'Select an offer' in the documentation.",
        "operationId": "selectOffer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "entity_to_contact": {
                        "enum": [
                          "customer",
                          "introducer"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [],
                    "type": "object"
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "login_link": {
                          "format": "uri",
                          "type": "string"
                        }
                      },
                      "required": [],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Offer selected and updated entity to contact. Returns a login_link only if the entity_to_contact is set to customer"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Select user offer and update entity to contact",
        "tags": [
          "Select"
        ]
      }
    },
    "/customers/{customer_id}/fundings/": {
      "get": {
        "operationId": "listFundingsForCustomer",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "count": {
                          "description": "The total number of fundings for this customer. (May be more than appear in the items list due to pagination).",
                          "format": "integer",
                          "type": "number"
                        },
                        "items": {
                          "items": {
                            "properties": {
                              "application_id": {
                                "description": "Identifies the application this funding resulted from",
                                "example": "48ac72d0-a829-4896-a067-dcb1c2b0f30c",
                                "format": "uuid",
                                "type": "string"
                              },
                              "funding_amount": {
                                "description": "The amount transferred to the customer",
                                "example": 1000,
                                "format": "float",
                                "type": "number"
                              },
                              "funding_created_at": {
                                "description": "The time at which the customer initiated the sending of the funds. This is usually when the funds were sent, except in cases where there was a delay.",
                                "example": "2019-08-24T14:15:22Z",
                                "format": "date-time",
                                "type": "string"
                              },
                              "funding_fee_amount": {
                                "description": "The amount added on to the loan as a fee for this funding. This corresponds to the funding_amount and offer_fee_percentage.",
                                "example": 50,
                                "format": "float",
                                "type": "number"
                              },
                              "funding_id": {
                                "description": "A unique identifier for this funding",
                                "example": "37301ec7-fce0-4953-a34c-83756823b32d",
                                "format": "uuid",
                                "type": "string"
                              },
                              "offer_duration_in_days": {
                                "description": "The duration of the loan. The end date of the loan is this many days from the first funding. (Later fundings from the same offer will show the same offer_duration_in_days, but are due to be repaid by the same time as the original funding).",
                                "example": 730,
                                "format": "integer",
                                "type": "number"
                              },
                              "offer_fee_percentage": {
                                "description": "What percentage of the amount borrowed was added to the loan as a fee when the customer took the money",
                                "example": 3,
                                "format": "float",
                                "maximum": 100,
                                "minimum": 0,
                                "type": "number"
                              },
                              "offer_id": {
                                "description": "Identifies the formal offer that the customer accepted. The fields offer_max_amount, offer_monthly_interest_percentage, offer_fee_percentage and offer_duration_in_days will be the same for fundings that have the same offer_id, because these are properties of the offer. They correspond to fields in the /offers endpoint and are duplicated here for convenience.",
                                "example": "d5a7a5b7-a4a3-49e7-9c69-b44d2cbe15cf",
                                "format": "uuid",
                                "type": "string"
                              },
                              "offer_max_amount": {
                                "description": "The maximum funding the customer can take from this offer.",
                                "example": 2000,
                                "format": "float",
                                "type": "number"
                              },
                              "offer_monthly_interest_percentage": {
                                "description": "Monthly interest rate as a percentage (e.g. 3.0 means 3% per month)",
                                "example": 3,
                                "format": "float",
                                "type": "number"
                              }
                            },
                            "required": [
                              "funding_id",
                              "funding_created_at",
                              "funding_amount",
                              "funding_fee_amount",
                              "offer_id",
                              "offer_max_amount",
                              "offer_monthly_interest_percentage",
                              "offer_fee_percentage",
                              "offer_duration_in_days"
                            ],
                            "title": "Funding",
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "items",
                        "count"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "List funds the customer has taken",
        "tags": [
          "Fundings"
        ]
      },
      "parameters": [
        {
          "description": "The unique customer_id used to represent a customer.",
          "in": "path",
          "name": "customer_id",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        },
        {
          "in": "query",
          "name": "limit",
          "required": true,
          "schema": {
            "format": "integer",
            "maximum": 50,
            "minimum": 1,
            "type": "number"
          }
        },
        {
          "in": "query",
          "name": "offset",
          "required": true,
          "schema": {
            "format": "integer",
            "minimum": 0,
            "type": "number"
          }
        }
      ]
    },
    "/funding_account_details/{customer_id}/": {
      "parameters": [
        {
          "description": "The unique customer_id used to represent a customer.",
          "in": "path",
          "name": "customer_id",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        }
      ],
      "post": {
        "description": "Creates a record of bank account details for funding a customer. Before you can set their funding details, you must have created an application for the customer (using the applications endpoint).",
        "operationId": "addFundingAccountDetailsForCustomer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "account_number": {
                        "description": "The bank account number for funding",
                        "example": "12345678",
                        "type": "string"
                      },
                      "sort_code": {
                        "description": "The sort code for the bank account. Can be provided with or without dashes.",
                        "example": "12-34-56",
                        "type": "string"
                      }
                    },
                    "required": [
                      "account_number",
                      "sort_code"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "funding_method_id": {
                          "description": "uid of funding method (uuid4)",
                          "format": "uuid",
                          "type": "string"
                        }
                      },
                      "required": [
                        "funding_method_id"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Create funding account details for user",
        "tags": [
          "Funding Account Details"
        ]
      }
    },
    "/introducers/": {
      "get": {
        "description": "Returns a list of all introducers, including default one, associated with a partner. The introducer will show up in this list if they have registered under your company at our introducer portal at https://www.iwoca.co.uk/introducer/.",
        "operationId": "getIntroducers",
        "parameters": [
          {
            "description": "Email address to filter results by.",
            "in": "query",
            "name": "email",
            "required": false,
            "schema": {
              "format": "email",
              "type": "string"
            }
          },
          {
            "description": "Filter by introducer_id (UUID format)",
            "example": "8a3f4d2e-1c5b-4a9d-9e7f-2b6d8c1a4f3e",
            "in": "query",
            "name": "uid",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Company UUID to filter results by. This is only relevant if you're managing introducers from multiple companies via your API integration.",
            "example": "1d7c4f9a-3e8b-42c1-b6d9-7a5f0e2c8b91",
            "in": "query",
            "name": "company_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "introducers": {
                          "items": {
                            "additionalProperties": false,
                            "properties": {
                              "company_id": {
                                "description": "UUID of the company the introducer is part of.",
                                "format": "uuid",
                                "type": "string"
                              },
                              "company_name": {
                                "description": "Name of the company the introducer is part of.",
                                "type": "string"
                              },
                              "email": {
                                "format": "email",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "first_name": {
                                "type": "string"
                              },
                              "last_name": {
                                "type": "string"
                              },
                              "uuid": {
                                "format": "uuid",
                                "type": "string"
                              }
                            },
                            "required": [
                              "first_name",
                              "last_name",
                              "email",
                              "uuid",
                              "company_name",
                              "company_id"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "introducers"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "List of partner introducers"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Get introducers associated with a partner",
        "tags": [
          "Introducers"
        ]
      },
      "post": {
        "description": "For more information, see 'Create an introducer' in the documentation.",
        "operationId": "createIntroducer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "data": {
                    "company_id": "9169681b-0479-445a-a389-ade25591859c",
                    "email": "test@example.co.uk",
                    "first_name": "test",
                    "last_name": "partner",
                    "phone_number": "07777777777",
                    "title": "mr"
                  }
                },
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "company_id": {
                        "description": "The uuid of the company where the new introducer should be assigned, not required for most integrations.",
                        "format": "uuid",
                        "type": "string"
                      },
                      "email": {
                        "description": "This email address must be unique for each introducer. This email address will be used to login to the iwoca introducer portal and to send referral information emails to the broker.",
                        "format": "email",
                        "maxLength": 254,
                        "type": "string"
                      },
                      "first_name": {
                        "description": "Middle name is not required.",
                        "maxLength": 100,
                        "type": "string"
                      },
                      "last_name": {
                        "maxLength": 100,
                        "type": "string"
                      },
                      "phone_number": {
                        "maxLength": 20,
                        "type": "string"
                      },
                      "title": {
                        "enum": [
                          "mr",
                          "ms",
                          "mrs",
                          "miss",
                          "doctor",
                          "professor",
                          "sir",
                          "lord",
                          "lady",
                          "baron",
                          "baroness",
                          "rev",
                          "other"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "first_name",
                      "last_name",
                      "email"
                    ]
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "introducer_id": {
                          "format": "uuid",
                          "type": "string"
                        }
                      },
                      "required": [
                        "introducer_id"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Create introducer associated with a partner",
        "tags": [
          "Introducers"
        ]
      }
    },
    "/partner_developer_invite/": {
      "post": {
        "description": "Grant your developers access to the developer portal. Sends an email to the provided address, containing a link inviting the recipient to create an account under your organisation on the iwoca developer portal, where they can manage your API integration. They will be able to see your API token, so you must not invite untrusted email addresses.",
        "operationId": "inviteDeveloper",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "email": {
                        "format": "email",
                        "type": "string"
                      }
                    },
                    "required": [
                      "email"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Invite partner developer",
        "tags": [
          "Developer Portal"
        ]
      }
    },
    "/prequalification_data/": {
      "get": {
        "operationId": "listPrequalificationQuotesForPartner",
        "parameters": [
          {
            "description": "The external_customer_id given by the partner in the csv file uploaded via POST /prequalification_data",
            "in": "query",
            "name": "external_customer_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The prequalification_data_id (uploaded file name) sent to the partner in the response payload after a successful POST /prequalification_data",
            "in": "query",
            "name": "prequalification_data_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "format": "integer",
              "maximum": 1000,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": true,
            "schema": {
              "format": "integer",
              "minimum": 0,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "count": {
                          "description": "The total number of prequalification quotes for this partner based on the inclusion or exclusion of query parameters. (May be more than appear in the items list due to pagination).",
                          "format": "integer",
                          "type": "number"
                        },
                        "items": {
                          "items": {
                            "properties": {
                              "external_customer_id": {
                                "description": "The customer id provided by the partner in the uploaded csv file.",
                                "type": "string"
                              },
                              "is_prequalified": {
                                "description": "Whether or not we were able to make a prequalification.",
                                "type": "boolean"
                              },
                              "marketing_type": {
                                "description": "How the prequalification quote should be marketed to the customer.",
                                "type": "string"
                              },
                              "prequalified_amount": {
                                "description": "The amount we think we could offer the customer.",
                                "format": "float",
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "quote_id": {
                                "format": "uuid",
                                "type": "string"
                              }
                            },
                            "required": [
                              "quote_id",
                              "external_customer_id",
                              "is_prequalified"
                            ],
                            "title": "Prequalification Quotes",
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "items",
                        "count"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "List prequalification quotes generated for a partner.",
        "tags": [
          "Prequalification"
        ]
      },
      "post": {
        "description": "Endpoint for uploading prequalification data as a .csv file",
        "operationId": "uploadPrequalificationData",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "document": {
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "document"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "properties": {
                        "prequalification_data_id": {
                          "description": "Id of uploaded prequalification data file.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "prequalification_data_id"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Conflict"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unsupported Media Type"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Pre-qualify customers",
        "tags": [
          "Prequalification"
        ]
      }
    },
    "/webhooks/configuration/": {
      "get": {
        "operationId": "getWebhookConfiguration",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "encryption_method": {
                          "description": "The hash algorithm iwoca uses to sign webhook payloads.",
                          "example": "sha256",
                          "type": "string"
                        },
                        "webhook_secret_token": {
                          "description": "The shared secret iwoca uses to sign outgoing webhooks in the X-IW-Signature header.",
                          "example": "0123456789abcdef0123456789abcdef01234567",
                          "type": "string"
                        },
                        "webhook_url": {
                          "description": "The base URL iwoca will POST to when sending webhooks. Must be HTTPS.",
                          "example": "https://partner.example.com/iwoca-webhook/",
                          "type": "string"
                        }
                      },
                      "required": [
                        "webhook_url",
                        "webhook_secret_token",
                        "encryption_method"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current webhook configuration"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Get current webhook configuration",
        "tags": [
          "Webhook Management"
        ]
      },
      "put": {
        "operationId": "updateWebhookConfiguration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "regenerate_webhook_secret_token": {
                        "description": "When `true`, generates a new secret token (used to sign webhook payloads) and replaces the existing one. Existing webhook deliveries will be signed with the new token from this point forward. Defaults to `false`.",
                        "example": false,
                        "type": "boolean"
                      },
                      "webhook_url": {
                        "description": "The base URL iwoca will POST to when sending webhooks. Must be HTTPS.",
                        "example": "https://partner.example.com/iwoca-webhook/",
                        "type": "string"
                      }
                    },
                    "required": [
                      "webhook_url"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Webhook url and token successfully configured"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Configure webhook url and token",
        "tags": [
          "Webhook Management"
        ]
      }
    },
    "/webhooks/subscriptions/": {
      "delete": {
        "operationId": "unsubscribeFromWebhooks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "webhook_event_types": {
                        "items": {
                          "description": "The name of the webhook, such as: customer_funded, application_offered, application_declined, application_deferred, application_status_changed, application_attributed, indicative_offer_created, prequalification_202505, prequalification_data_file_processed_202510, funding_created_202607",
                          "example": "application_offered",
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "webhook_event_types"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Unsubscribed from webhooks"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Unsubscribe from webhooks",
        "tags": [
          "Webhook Management"
        ]
      },
      "get": {
        "operationId": "getWebhookSubscriptions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "subscriptions": {
                          "items": {
                            "additionalProperties": false,
                            "properties": {
                              "subscribed": {
                                "description": "Whether you are subscribed to this webhook event type.",
                                "example": true,
                                "type": "boolean"
                              },
                              "url": {
                                "description": "Override URL for this event type, if one was set when subscribing. Null means iwoca POSTs to your base webhook URL for this event.",
                                "example": "https://partner.example.com/iwoca-webhook/application-offered/",
                                "format": "uri",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "webhook_event_type": {
                                "description": "The name of the webhook, such as: customer_funded, application_offered, application_declined, application_deferred, application_status_changed, application_attributed, indicative_offer_created, prequalification_202505, prequalification_data_file_processed_202510, funding_created_202607",
                                "example": "application_offered",
                                "type": "string"
                              }
                            },
                            "required": [
                              "webhook_event_type",
                              "url",
                              "subscribed"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "subscriptions"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current webhook subscriptions"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Get webhook subscriptions",
        "tags": [
          "Webhook Management"
        ]
      },
      "post": {
        "operationId": "subscribeToWebhooks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "data": {
                    "additionalProperties": false,
                    "properties": {
                      "subscriptions": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "url": {
                              "description": "Optional override URL for this specific event type. When set, webhooks of this type POST here instead of your base webhook URL. Leave null to use the base URL.",
                              "example": "https://partner.example.com/iwoca-webhook/application-offered/",
                              "format": "uri",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "webhook_event_type": {
                              "description": "The name of the webhook, such as: customer_funded, application_offered, application_declined, application_deferred, application_status_changed, application_attributed, indicative_offer_created, prequalification_202505, prequalification_data_file_processed_202510, funding_created_202607",
                              "example": "application_offered",
                              "type": "string"
                            }
                          },
                          "required": [
                            "webhook_event_type"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "subscriptions"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Subscribed to webhooks"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "NotFound"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Found"
          },
          "406": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Not Acceptable"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Subscribe to webhooks",
        "tags": [
          "Webhook Management"
        ]
      }
    },
    "/webhooks/event_types/": {
      "get": {
        "operationId": "getWebhookEventTypes",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "webhook_event_types": {
                          "items": {
                            "description": "The name of the webhook, such as: customer_funded, application_offered, application_declined, application_deferred, application_status_changed, application_attributed, indicative_offer_created, prequalification_202505, prequalification_data_file_processed_202510, funding_created_202607",
                            "example": "application_offered",
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "webhook_event_types"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Available webhook event types"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          },
                          "source": {
                            "additionalProperties": false,
                            "properties": {
                              "parameter": {
                                "type": "string"
                              },
                              "pointer": {
                                "type": "string"
                              }
                            },
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "AuthenticationFailed",
                              "NotAuthenticated"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "enum": [
                              "PermissionDenied"
                            ],
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Permission Denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "errors": {
                      "items": {
                        "additionalProperties": false,
                        "description": "",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "meta": {
                            "additionalProperties": true,
                            "properties": {},
                            "required": [],
                            "type": "object"
                          }
                        },
                        "required": [
                          "code",
                          "detail"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Unexpected Error"
          }
        },
        "summary": "Get available webhook event types",
        "tags": [
          "Webhook Management"
        ]
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "servers": [
    {
      "url": "https://www.iwoca.co.uk/api/lending/v2.2"
    },
    {
      "url": "https://stage.iwoca-dev.co.uk/api/lending/v2.2"
    },
    {
      "url": "/api/lending/v2.2"
    }
  ],
  "tags": [
    {
      "description": "Webhook events that iwoca sends to partner-hosted endpoints. Each webhook below documents the JSON body iwoca will POST when the corresponding event happens.",
      "name": "Webhooks"
    },
    {
      "description": "Endpoints for partners to configure their webhook receiver and subscribe to or unsubscribe from individual webhook event types.",
      "name": "Webhook Management"
    }
  ],
  "webhooks": {
    "application_attributed": {
      "post": {
        "description": "Sent when an application is created for a customer and attributed to you. This covers applications created:\n\n1. By you, over the API.\n2. By your team, via the iwoca Introducer Portal.\n3. By iwoca staff, and attributed to you.\n4. By the customer themselves — for example through your affiliate signup flow — and attributed to you.\n\n### When an application is moved to another customer\n\nIf you submit an application for a customer who already exists in iwoca's system under a different `customer_id`, iwoca staff close your application and create a replacement on the existing customer. Your original application ends up with the status `deferred`.\n\nYou will receive this webhook with:\n\n1. `previous_customer_id` and `previous_application_id` — the IDs you originally submitted.\n2. `current_customer_id` — the customer the replacement application was created on.\n3. `current_application_id` — the replacement application itself.\n\n**Use `current_customer_id` and `current_application_id` from then on.** The previous pair no longer points at a live application.",
        "operationId": "webhook_application_attributed",
        "parameters": [
          {
            "description": "UUID of the webhook event. Webhooks which do not deliver successfully are retried. This will be the same across retry attempts for the same webhook.",
            "in": "header",
            "name": "X-IW-Event-ID",
            "required": true,
            "schema": {
              "example": "d562dbff-8989-4ea7-809c-e2ada5b13fa8",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The type of webhook being delivered — matches the `webhook_event_type` values from `GET /webhooks/event_types/`.",
            "in": "header",
            "name": "X-IW-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC-SHA256 signature of the request body, base64-encoded and prefixed with `sha256=`. The HMAC key is your webhook secret token (not your API token), which you can fetch from the iwoca Notifications API or the Developer Portal. Verify this header to confirm the webhook is genuinely from iwoca and to mitigate replay attacks (by also checking that `X-IW-Timestamp` is recent). Retried deliveries get a fresh timestamp and therefore a fresh signature.\n\n```\nmessage   = \"{X-IW-Timestamp}.{raw_request_body}\"\nsignature = \"sha256=\" + base64(hmac_sha256(secret, message))\n```",
            "in": "header",
            "name": "X-IW-Signature",
            "required": true,
            "schema": {
              "example": "sha256=YoSHTwbVZnuLY8kPusTeHoqcyQ9g1IeVHKpIFLJjp4k=",
              "type": "string"
            }
          },
          {
            "description": "Unix timestamp (seconds) at which the delivery was initiated. If this delivery is a retry of an earlier failed delivery, the timestamp is of the current attempt, not the original delivery.",
            "in": "header",
            "name": "X-IW-Timestamp",
            "required": true,
            "schema": {
              "example": "1699443602",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "data": {
                    "properties": {
                      "current_application_id": {
                        "description": "application_id of the application which was just created or assigned to you",
                        "example": "a5c3f20f-0912-4b3b-a15a-3b711e9ced58",
                        "format": "uuid",
                        "type": "string"
                      },
                      "current_customer_id": {
                        "description": "customer_id on which the current_application_id exists",
                        "example": "a7fe5409-8ce8-4551-9c37-d8e52fccbd0a",
                        "format": "uuid",
                        "type": "string"
                      },
                      "previous_application_id": {
                        "description": "application_id of the application this replaces, if any",
                        "example": "86665004-f599-4312-baf6-f11a4f4f7596",
                        "format": "uuid",
                        "type": "string"
                      },
                      "previous_customer_id": {
                        "description": "customer_id on which previous_application_id existed",
                        "example": "64c0d004-3526-43d4-a86b-0527fbd656e8",
                        "format": "uuid",
                        "type": "string"
                      }
                    },
                    "required": [
                      "current_application_id",
                      "current_customer_id"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return status code 200 or 201 to acknowledge receipt of the webhook. Any non-2XX response code will result in iwoca retrying the delivery."
          }
        },
        "security": [],
        "summary": "application_attributed webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "application_declined": {
      "post": {
        "description": "Sent when a customer's application is declined",
        "operationId": "webhook_application_declined",
        "parameters": [
          {
            "description": "UUID of the webhook event. Webhooks which do not deliver successfully are retried. This will be the same across retry attempts for the same webhook.",
            "in": "header",
            "name": "X-IW-Event-ID",
            "required": true,
            "schema": {
              "example": "d562dbff-8989-4ea7-809c-e2ada5b13fa8",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The type of webhook being delivered — matches the `webhook_event_type` values from `GET /webhooks/event_types/`.",
            "in": "header",
            "name": "X-IW-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC-SHA256 signature of the request body, base64-encoded and prefixed with `sha256=`. The HMAC key is your webhook secret token (not your API token), which you can fetch from the iwoca Notifications API or the Developer Portal. Verify this header to confirm the webhook is genuinely from iwoca and to mitigate replay attacks (by also checking that `X-IW-Timestamp` is recent). Retried deliveries get a fresh timestamp and therefore a fresh signature.\n\n```\nmessage   = \"{X-IW-Timestamp}.{raw_request_body}\"\nsignature = \"sha256=\" + base64(hmac_sha256(secret, message))\n```",
            "in": "header",
            "name": "X-IW-Signature",
            "required": true,
            "schema": {
              "example": "sha256=YoSHTwbVZnuLY8kPusTeHoqcyQ9g1IeVHKpIFLJjp4k=",
              "type": "string"
            }
          },
          {
            "description": "Unix timestamp (seconds) at which the delivery was initiated. If this delivery is a retry of an earlier failed delivery, the timestamp is of the current attempt, not the original delivery.",
            "in": "header",
            "name": "X-IW-Timestamp",
            "required": true,
            "schema": {
              "example": "1699443602",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "data": {
                    "properties": {
                      "application_id": {
                        "example": "d89a90dc-2ad5-49df-981e-67ee666c5447",
                        "format": "uuid",
                        "type": "string"
                      },
                      "customer_id": {
                        "example": "e7591608-289d-4fa0-8aa9-446826e90189",
                        "format": "uuid",
                        "type": "string"
                      },
                      "external_customer_id": {
                        "description": "The optional external_customer_id you sent in the POST /customers request when creating the customer",
                        "example": "12345",
                        "type": "string"
                      },
                      "is_closed": {
                        "description": "Always true, because declining means the application is closed",
                        "example": true,
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "customer_id",
                      "application_id",
                      "is_closed"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return status code 200 or 201 to acknowledge receipt of the webhook. Any non-2XX response code will result in iwoca retrying the delivery."
          }
        },
        "security": [],
        "summary": "application_declined webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "application_deferred": {
      "post": {
        "description": "Sent when a customer's application is deferred (closed without reaching an approval or decline decision)",
        "operationId": "webhook_application_deferred",
        "parameters": [
          {
            "description": "UUID of the webhook event. Webhooks which do not deliver successfully are retried. This will be the same across retry attempts for the same webhook.",
            "in": "header",
            "name": "X-IW-Event-ID",
            "required": true,
            "schema": {
              "example": "d562dbff-8989-4ea7-809c-e2ada5b13fa8",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The type of webhook being delivered — matches the `webhook_event_type` values from `GET /webhooks/event_types/`.",
            "in": "header",
            "name": "X-IW-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC-SHA256 signature of the request body, base64-encoded and prefixed with `sha256=`. The HMAC key is your webhook secret token (not your API token), which you can fetch from the iwoca Notifications API or the Developer Portal. Verify this header to confirm the webhook is genuinely from iwoca and to mitigate replay attacks (by also checking that `X-IW-Timestamp` is recent). Retried deliveries get a fresh timestamp and therefore a fresh signature.\n\n```\nmessage   = \"{X-IW-Timestamp}.{raw_request_body}\"\nsignature = \"sha256=\" + base64(hmac_sha256(secret, message))\n```",
            "in": "header",
            "name": "X-IW-Signature",
            "required": true,
            "schema": {
              "example": "sha256=YoSHTwbVZnuLY8kPusTeHoqcyQ9g1IeVHKpIFLJjp4k=",
              "type": "string"
            }
          },
          {
            "description": "Unix timestamp (seconds) at which the delivery was initiated. If this delivery is a retry of an earlier failed delivery, the timestamp is of the current attempt, not the original delivery.",
            "in": "header",
            "name": "X-IW-Timestamp",
            "required": true,
            "schema": {
              "example": "1699443602",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "data": {
                    "properties": {
                      "application_id": {
                        "example": "39d8b197-ff32-4aa4-a733-e14e1deee544",
                        "format": "uuid",
                        "type": "string"
                      },
                      "customer_id": {
                        "example": "39205a1f-1ef5-42b0-a381-ee752e9f43bf",
                        "format": "uuid",
                        "type": "string"
                      },
                      "external_customer_id": {
                        "description": "The optional external_customer_id you sent in the POST /customers request when creating the customer",
                        "example": "12345",
                        "type": "string"
                      },
                      "is_closed": {
                        "description": "Always true, because deferring means closing the application",
                        "example": true,
                        "type": "boolean"
                      },
                      "reason": {
                        "enum": [
                          "iwoca",
                          "partner",
                          "timeout"
                        ],
                        "example": "timeout",
                        "type": "string",
                        "x-enumDescriptions": {
                          "iwoca": "iwoca staff manually closed the application",
                          "partner": "unused",
                          "timeout": "The application was automatically closed because no decision was reached after 30 days"
                        }
                      }
                    },
                    "required": [
                      "customer_id",
                      "application_id",
                      "is_closed",
                      "reason"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return status code 200 or 201 to acknowledge receipt of the webhook. Any non-2XX response code will result in iwoca retrying the delivery."
          }
        },
        "security": [],
        "summary": "application_deferred webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "application_offered": {
      "post": {
        "description": "Sent when the customer receives a confirmed offer",
        "operationId": "webhook_application_offered",
        "parameters": [
          {
            "description": "UUID of the webhook event. Webhooks which do not deliver successfully are retried. This will be the same across retry attempts for the same webhook.",
            "in": "header",
            "name": "X-IW-Event-ID",
            "required": true,
            "schema": {
              "example": "d562dbff-8989-4ea7-809c-e2ada5b13fa8",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The type of webhook being delivered — matches the `webhook_event_type` values from `GET /webhooks/event_types/`.",
            "in": "header",
            "name": "X-IW-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC-SHA256 signature of the request body, base64-encoded and prefixed with `sha256=`. The HMAC key is your webhook secret token (not your API token), which you can fetch from the iwoca Notifications API or the Developer Portal. Verify this header to confirm the webhook is genuinely from iwoca and to mitigate replay attacks (by also checking that `X-IW-Timestamp` is recent). Retried deliveries get a fresh timestamp and therefore a fresh signature.\n\n```\nmessage   = \"{X-IW-Timestamp}.{raw_request_body}\"\nsignature = \"sha256=\" + base64(hmac_sha256(secret, message))\n```",
            "in": "header",
            "name": "X-IW-Signature",
            "required": true,
            "schema": {
              "example": "sha256=YoSHTwbVZnuLY8kPusTeHoqcyQ9g1IeVHKpIFLJjp4k=",
              "type": "string"
            }
          },
          {
            "description": "Unix timestamp (seconds) at which the delivery was initiated. If this delivery is a retry of an earlier failed delivery, the timestamp is of the current attempt, not the original delivery.",
            "in": "header",
            "name": "X-IW-Timestamp",
            "required": true,
            "schema": {
              "example": "1699443602",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "data": {
                    "properties": {
                      "application_id": {
                        "example": "b71ffccf-cdf3-4218-9a4f-f0a7238f1769",
                        "format": "uuid",
                        "type": "string"
                      },
                      "approximate_apr": {
                        "description": "Approximate Annual Percentage Rate as a decimal. For example, 0.3995 means 39.95%. Note that this may differ to how this field is presented in the /offers endpoint, depending on which version you're using.",
                        "example": 0.842513,
                        "format": "float",
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "customer_id": {
                        "example": "07cd75a9-95dc-4123-ade9-b09ad0165d39",
                        "format": "uuid",
                        "type": "string"
                      },
                      "duration": {
                        "properties": {
                          "amount": {
                            "example": 730,
                            "type": "number"
                          },
                          "unit": {
                            "description": "In practice, always days",
                            "enum": [
                              "days",
                              "months",
                              "years"
                            ],
                            "example": "days",
                            "type": "string"
                          }
                        },
                        "required": [
                          "unit",
                          "amount"
                        ],
                        "type": "object"
                      },
                      "expiry_date": {
                        "description": "The date on which the offer expires",
                        "example": "2026-06-25",
                        "format": "date",
                        "type": "string"
                      },
                      "external_customer_id": {
                        "description": "The optional external_customer_id you sent in the POST /customers request when creating the customer",
                        "example": "12345",
                        "type": "string"
                      },
                      "fee_percentage": {
                        "description": "What percentage of the amount borrowed will be added to the loan as a fee when the customer takes the money",
                        "example": 5,
                        "format": "float",
                        "maximum": 100,
                        "minimum": 0,
                        "type": "number"
                      },
                      "interest_only_repayments": {
                        "description": "Some offers have an interest-only period. For example if the `payment_interval` is `1m` and `interest_only_repayments` is `3`, the first three months of the loan are interest-only which means the first three repayments due will be lower than the normal repayments",
                        "example": 0,
                        "type": "integer"
                      },
                      "interest_rates": {
                        "description": "Interest rate of the offer. Returned as a list but in practice there will be one item.",
                        "items": {
                          "properties": {
                            "as_of": {
                              "description": "Unused",
                              "example": 0,
                              "type": "integer"
                            },
                            "rate": {
                              "description": "Interest rate as a decimal. For example, 0.028 means the interest rate is 2.8%. Note that this may differ to how this field is presented in the /offers endpoint, depending on which version you're using.",
                              "example": 0.0515,
                              "format": "float",
                              "maximum": 1,
                              "minimum": 0,
                              "type": "number"
                            }
                          },
                          "required": [
                            "as_of",
                            "rate"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "is_closed": {
                        "description": "Whether the application is closed. Usually, receiving a confirmed offer closes the application. Sometimes iwoca returns a confirmed offer for a smaller amount alongside an indicative offer for a larger amount, and the application remains open.",
                        "example": true,
                        "type": "boolean"
                      },
                      "max_amount": {
                        "example": 18000,
                        "format": "float",
                        "type": "number"
                      },
                      "offer_id": {
                        "example": "a8fa3eca-3e49-4e31-8ceb-0491e7096475",
                        "format": "uuid",
                        "type": "string"
                      },
                      "payment_interval": {
                        "description": "How often repayments are due. (In practice, monthly).",
                        "example": "1m",
                        "type": "string"
                      },
                      "personal_guarantee_proportion": {
                        "description": "What percentage of the loan will be covered by a personal guarantee. For example, 100 for a normal loan or 0 for a loan with no PG required",
                        "example": 100,
                        "format": "float",
                        "maximum": 100,
                        "minimum": 0,
                        "type": "number"
                      },
                      "product_type": {
                        "description": "iwoca product name",
                        "enum": [
                          "flexi_loan",
                          "business_loan",
                          "iwocapay",
                          "cbils",
                          "flexi24",
                          "recovery_loan",
                          "revenue_based_loan"
                        ],
                        "type": "string"
                      },
                      "promotions": {
                        "description": "Unused",
                        "example": [],
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "revoked_at": {
                        "description": "If the offer has been revoked, shows the date and time at which it was revoked. Otherwise null.",
                        "format": "date-time",
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "customer_id",
                      "application_id",
                      "is_closed",
                      "offer_id",
                      "expiry_date",
                      "revoked_at",
                      "product_type",
                      "duration",
                      "max_amount",
                      "approximate_apr",
                      "personal_guarantee_proportion",
                      "payment_interval",
                      "interest_rates",
                      "promotions",
                      "interest_only_repayments"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return status code 200 or 201 to acknowledge receipt of the webhook. Any non-2XX response code will result in iwoca retrying the delivery."
          }
        },
        "security": [],
        "summary": "application_offered webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "application_status_changed": {
      "post": {
        "description": "Sent when the status of an application changes",
        "operationId": "webhook_application_status_changed",
        "parameters": [
          {
            "description": "UUID of the webhook event. Webhooks which do not deliver successfully are retried. This will be the same across retry attempts for the same webhook.",
            "in": "header",
            "name": "X-IW-Event-ID",
            "required": true,
            "schema": {
              "example": "d562dbff-8989-4ea7-809c-e2ada5b13fa8",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The type of webhook being delivered — matches the `webhook_event_type` values from `GET /webhooks/event_types/`.",
            "in": "header",
            "name": "X-IW-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC-SHA256 signature of the request body, base64-encoded and prefixed with `sha256=`. The HMAC key is your webhook secret token (not your API token), which you can fetch from the iwoca Notifications API or the Developer Portal. Verify this header to confirm the webhook is genuinely from iwoca and to mitigate replay attacks (by also checking that `X-IW-Timestamp` is recent). Retried deliveries get a fresh timestamp and therefore a fresh signature.\n\n```\nmessage   = \"{X-IW-Timestamp}.{raw_request_body}\"\nsignature = \"sha256=\" + base64(hmac_sha256(secret, message))\n```",
            "in": "header",
            "name": "X-IW-Signature",
            "required": true,
            "schema": {
              "example": "sha256=YoSHTwbVZnuLY8kPusTeHoqcyQ9g1IeVHKpIFLJjp4k=",
              "type": "string"
            }
          },
          {
            "description": "Unix timestamp (seconds) at which the delivery was initiated. If this delivery is a retry of an earlier failed delivery, the timestamp is of the current attempt, not the original delivery.",
            "in": "header",
            "name": "X-IW-Timestamp",
            "required": true,
            "schema": {
              "example": "1699443602",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "data": {
                    "properties": {
                      "application_id": {
                        "example": "bb65d62c-b6bd-4a2e-8f61-7c79c3c80eaf",
                        "format": "uuid",
                        "type": "string"
                      },
                      "customer_id": {
                        "example": "07072be0-a15a-4070-bc88-baf6b866b359",
                        "format": "uuid",
                        "type": "string"
                      },
                      "external_customer_id": {
                        "description": "The optional external_customer_id you sent in the POST /customers request when creating the customer",
                        "example": "12345",
                        "type": "string"
                      },
                      "is_closed": {
                        "description": "Whether the application is closed",
                        "example": false,
                        "type": "boolean"
                      },
                      "status": {
                        "enum": [
                          "funded",
                          "expired",
                          "talking_to_customer",
                          "offered",
                          "declined",
                          "deferred",
                          "in_underwriting",
                          "awaiting_underwriter",
                          "open",
                          "action_required",
                          "offer_revoked",
                          "customer_to_link_open_banking",
                          "conditional_offer"
                        ],
                        "example": "in_underwriting",
                        "type": "string"
                      }
                    },
                    "required": [
                      "customer_id",
                      "application_id",
                      "is_closed",
                      "status"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return status code 200 or 201 to acknowledge receipt of the webhook. Any non-2XX response code will result in iwoca retrying the delivery."
          }
        },
        "security": [],
        "summary": "application_status_changed webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "customer_funded": {
      "post": {
        "description": "Sent when a customer draws down funds from an offer which originated from an application you introduced.\nThis can happen multiple times. For example, if the customer initially draws down part of the offer amount, and later draws down the rest.",
        "operationId": "webhook_customer_funded",
        "parameters": [
          {
            "description": "UUID of the webhook event. Webhooks which do not deliver successfully are retried. This will be the same across retry attempts for the same webhook.",
            "in": "header",
            "name": "X-IW-Event-ID",
            "required": true,
            "schema": {
              "example": "d562dbff-8989-4ea7-809c-e2ada5b13fa8",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The type of webhook being delivered — matches the `webhook_event_type` values from `GET /webhooks/event_types/`.",
            "in": "header",
            "name": "X-IW-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC-SHA256 signature of the request body, base64-encoded and prefixed with `sha256=`. The HMAC key is your webhook secret token (not your API token), which you can fetch from the iwoca Notifications API or the Developer Portal. Verify this header to confirm the webhook is genuinely from iwoca and to mitigate replay attacks (by also checking that `X-IW-Timestamp` is recent). Retried deliveries get a fresh timestamp and therefore a fresh signature.\n\n```\nmessage   = \"{X-IW-Timestamp}.{raw_request_body}\"\nsignature = \"sha256=\" + base64(hmac_sha256(secret, message))\n```",
            "in": "header",
            "name": "X-IW-Signature",
            "required": true,
            "schema": {
              "example": "sha256=YoSHTwbVZnuLY8kPusTeHoqcyQ9g1IeVHKpIFLJjp4k=",
              "type": "string"
            }
          },
          {
            "description": "Unix timestamp (seconds) at which the delivery was initiated. If this delivery is a retry of an earlier failed delivery, the timestamp is of the current attempt, not the original delivery.",
            "in": "header",
            "name": "X-IW-Timestamp",
            "required": true,
            "schema": {
              "example": "1699443602",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "data": {
                    "properties": {
                      "amount_funded": {
                        "example": 10000,
                        "type": "number"
                      },
                      "funded_datetime": {
                        "example": "2026-06-11T20:10:00Z",
                        "format": "date-time",
                        "type": "string"
                      },
                      "loan_id": {
                        "example": "K44OXEI0BQY59",
                        "type": "string"
                      },
                      "state_key": {
                        "description": "customer_id",
                        "example": "55422f06-cb7e-41a3-8389-b2b4f03577c6",
                        "format": "uuid",
                        "type": "string"
                      }
                    },
                    "required": [
                      "state_key",
                      "amount_funded",
                      "loan_id",
                      "funded_datetime"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return status code 200 or 201 to acknowledge receipt of the webhook. Any non-2XX response code will result in iwoca retrying the delivery."
          }
        },
        "security": [],
        "summary": "customer_funded webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "funding_created_202607": {
      "post": {
        "description": "Sent when funds are sent to a customer. If the funding originated from an application, `application_id` is populated.",
        "operationId": "webhook_funding_created202607",
        "parameters": [
          {
            "description": "UUID of the webhook event. Webhooks which do not deliver successfully are retried. This will be the same across retry attempts for the same webhook.",
            "in": "header",
            "name": "X-IW-Event-ID",
            "required": true,
            "schema": {
              "example": "d562dbff-8989-4ea7-809c-e2ada5b13fa8",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The type of webhook being delivered — matches the `webhook_event_type` values from `GET /webhooks/event_types/`.",
            "in": "header",
            "name": "X-IW-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC-SHA256 signature of the request body, base64-encoded and prefixed with `sha256=`. The HMAC key is your webhook secret token (not your API token), which you can fetch from the iwoca Notifications API or the Developer Portal. Verify this header to confirm the webhook is genuinely from iwoca and to mitigate replay attacks (by also checking that `X-IW-Timestamp` is recent). Retried deliveries get a fresh timestamp and therefore a fresh signature.\n\n```\nmessage   = \"{X-IW-Timestamp}.{raw_request_body}\"\nsignature = \"sha256=\" + base64(hmac_sha256(secret, message))\n```",
            "in": "header",
            "name": "X-IW-Signature",
            "required": true,
            "schema": {
              "example": "sha256=YoSHTwbVZnuLY8kPusTeHoqcyQ9g1IeVHKpIFLJjp4k=",
              "type": "string"
            }
          },
          {
            "description": "Unix timestamp (seconds) at which the delivery was initiated. If this delivery is a retry of an earlier failed delivery, the timestamp is of the current attempt, not the original delivery.",
            "in": "header",
            "name": "X-IW-Timestamp",
            "required": true,
            "schema": {
              "example": "1699443602",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "data": {
                    "properties": {
                      "application_id": {
                        "description": "Identifies the application this funding resulted from, if any. Omitted for fundings not associated with an application (e.g. pre-approval drawdowns).",
                        "example": "48ac72d0-a829-4896-a067-dcb1c2b0f30c",
                        "format": "uuid",
                        "type": "string"
                      },
                      "customer_id": {
                        "example": "07072be0-a15a-4070-bc88-baf6b866b359",
                        "format": "uuid",
                        "type": "string"
                      },
                      "external_customer_id": {
                        "description": "The optional external_customer_id you sent in the POST /customers request when creating the customer",
                        "example": "12345",
                        "type": "string"
                      },
                      "funding_amount": {
                        "description": "The amount transferred to the customer",
                        "example": 1000,
                        "type": "number"
                      },
                      "funding_created_at": {
                        "description": "The time at which the customer initiated the sending of the funds. This is usually when the funds were sent, except in cases where there was a delay.",
                        "example": "2019-08-24T14:15:22Z",
                        "format": "date-time",
                        "type": "string"
                      },
                      "funding_fee_amount": {
                        "description": "The amount added on to the loan as a fee for this funding. This corresponds to the funding_amount and offer_fee_percentage.",
                        "example": 50,
                        "type": "number"
                      },
                      "funding_id": {
                        "description": "A unique identifier for this funding",
                        "example": "37301ec7-fce0-4953-a34c-83756823b32d",
                        "format": "uuid",
                        "type": "string"
                      },
                      "offer_duration_in_days": {
                        "description": "The duration of the loan. The end date of the loan is this many days from the first funding. (Later fundings from the same offer will show the same offer_duration_in_days, but are due to be repaid by the same time as the original funding).",
                        "example": 730,
                        "type": "integer"
                      },
                      "offer_fee_percentage": {
                        "description": "What percentage of the amount borrowed was added to the loan as a fee when the customer took the money",
                        "example": 3,
                        "maximum": 100,
                        "minimum": 0,
                        "type": "number"
                      },
                      "offer_id": {
                        "description": "Identifies the formal offer that the customer accepted. The fields offer_max_amount, offer_monthly_interest_percentage, offer_fee_percentage and offer_duration_in_days will be the same for fundings that have the same offer_id, because these are properties of the offer. They correspond to fields in the /offers endpoint and are duplicated here for convenience.",
                        "example": "d5a7a5b7-a4a3-49e7-9c69-b44d2cbe15cf",
                        "format": "uuid",
                        "type": "string"
                      },
                      "offer_max_amount": {
                        "description": "The maximum funding the customer can take from this offer.",
                        "example": 2000,
                        "type": "number"
                      },
                      "offer_monthly_interest_percentage": {
                        "description": "Monthly interest rate as a percentage (e.g. 3.0 means 3% per month)",
                        "example": 3,
                        "type": "number"
                      }
                    },
                    "required": [
                      "customer_id",
                      "funding_amount",
                      "funding_created_at",
                      "funding_fee_amount",
                      "funding_id",
                      "offer_duration_in_days",
                      "offer_fee_percentage",
                      "offer_id",
                      "offer_max_amount",
                      "offer_monthly_interest_percentage"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return status code 200 or 201 to acknowledge receipt of the webhook. Any non-2XX response code will result in iwoca retrying the delivery."
          }
        },
        "security": [],
        "summary": "funding_created_202607 webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "indicative_offer_created": {
      "post": {
        "description": "Sent when an indicative offer is created",
        "operationId": "webhook_indicative_offer_created",
        "parameters": [
          {
            "description": "UUID of the webhook event. Webhooks which do not deliver successfully are retried. This will be the same across retry attempts for the same webhook.",
            "in": "header",
            "name": "X-IW-Event-ID",
            "required": true,
            "schema": {
              "example": "d562dbff-8989-4ea7-809c-e2ada5b13fa8",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The type of webhook being delivered — matches the `webhook_event_type` values from `GET /webhooks/event_types/`.",
            "in": "header",
            "name": "X-IW-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC-SHA256 signature of the request body, base64-encoded and prefixed with `sha256=`. The HMAC key is your webhook secret token (not your API token), which you can fetch from the iwoca Notifications API or the Developer Portal. Verify this header to confirm the webhook is genuinely from iwoca and to mitigate replay attacks (by also checking that `X-IW-Timestamp` is recent). Retried deliveries get a fresh timestamp and therefore a fresh signature.\n\n```\nmessage   = \"{X-IW-Timestamp}.{raw_request_body}\"\nsignature = \"sha256=\" + base64(hmac_sha256(secret, message))\n```",
            "in": "header",
            "name": "X-IW-Signature",
            "required": true,
            "schema": {
              "example": "sha256=YoSHTwbVZnuLY8kPusTeHoqcyQ9g1IeVHKpIFLJjp4k=",
              "type": "string"
            }
          },
          {
            "description": "Unix timestamp (seconds) at which the delivery was initiated. If this delivery is a retry of an earlier failed delivery, the timestamp is of the current attempt, not the original delivery.",
            "in": "header",
            "name": "X-IW-Timestamp",
            "required": true,
            "schema": {
              "example": "1699443602",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "data": {
                    "properties": {
                      "application_id": {
                        "example": "2e1637d0-2403-4f57-b3fa-cb04f650683d",
                        "format": "uuid",
                        "type": "string"
                      },
                      "customer_id": {
                        "example": "b493d64d-c785-471e-9972-bed4fc91b359",
                        "format": "uuid",
                        "type": "string"
                      },
                      "data_requirements": {
                        "description": "Use this field to determine next steps for your customer if the offer is not of type 'confirmed'.",
                        "items": {
                          "properties": {
                            "actions": {
                              "items": {
                                "additionalProperties": false,
                                "properties": {
                                  "name": {
                                    "example": "upload_bank_statement",
                                    "type": "string"
                                  },
                                  "quantifier": {
                                    "description": "If an action is of category 'documents', it will have a 'quantifier' field specifying a number of documents or a number of months or years.",
                                    "properties": {
                                      "unit": {
                                        "description": "If the value represents a number of months or years, this field will specify what the unit is.",
                                        "enum": [
                                          "months",
                                          "years"
                                        ],
                                        "example": "months",
                                        "type": "string"
                                      },
                                      "value": {
                                        "example": 6,
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "value"
                                    ],
                                    "type": "object"
                                  }
                                },
                                "required": [
                                  "name"
                                ],
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "category": {
                              "enum": [
                                "contractual",
                                "credit_rules",
                                "id_checks",
                                "contact_details",
                                "payments",
                                "enhanced_security_check",
                                "documents",
                                "company_data",
                                "personal_data",
                                "trading_history"
                              ],
                              "example": "documents",
                              "type": "string"
                            }
                          },
                          "required": [],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "duration": {
                        "additionalProperties": false,
                        "properties": {
                          "amount": {
                            "example": 365,
                            "format": "float",
                            "type": "number"
                          },
                          "unit": {
                            "description": "In practice, always days",
                            "enum": [
                              "days",
                              "months",
                              "years"
                            ],
                            "example": "days",
                            "type": "string"
                          }
                        },
                        "required": [
                          "amount",
                          "unit"
                        ],
                        "type": "object"
                      },
                      "external_customer_id": {
                        "description": "The optional external_customer_id you sent in the POST /customers request when creating the customer",
                        "example": "12345",
                        "type": "string"
                      },
                      "interest_rate": {
                        "description": "Interest rate as a decimal. For example, 0.028 means the interest rate is 2.8%. Note that this may differ to how this field is presented in the /offers endpoint, depending on which version you're using.",
                        "example": 0.0265,
                        "format": "float",
                        "type": "number"
                      },
                      "is_suggested": {
                        "description": "Whether in iwoca's opinion this offer is the one which best matches the parameters requested in the application",
                        "example": true,
                        "type": "boolean"
                      },
                      "max_amount": {
                        "example": 50000,
                        "format": "float",
                        "type": "number"
                      },
                      "offer_id": {
                        "example": "3394ca6a-30e7-4e74-8b94-3c93fa1dcd85",
                        "format": "uuid",
                        "type": "string"
                      },
                      "probability_of_offer": {
                        "enum": [
                          "low_probability_of_offer",
                          "medium_probability_of_offer",
                          "high_probability_of_offer"
                        ],
                        "example": "medium_probability_of_offer",
                        "type": "string"
                      },
                      "product_type": {
                        "enum": [
                          "flexi_loan",
                          "business_loan",
                          "iwocapay",
                          "cbils",
                          "flexi24",
                          "recovery_loan",
                          "revenue_based_loan"
                        ],
                        "example": "flexi_loan",
                        "type": "string"
                      },
                      "timeout": {
                        "description": "Expiry datetime of the indicative offer",
                        "example": "2026-06-25T00:00:00+0000",
                        "type": "string"
                      }
                    },
                    "required": [
                      "customer_id",
                      "application_id",
                      "offer_id",
                      "product_type",
                      "max_amount",
                      "duration",
                      "is_suggested",
                      "timeout"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return status code 200 or 201 to acknowledge receipt of the webhook. Any non-2XX response code will result in iwoca retrying the delivery."
          }
        },
        "security": [],
        "summary": "indicative_offer_created webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "prequalification_202505": {
      "post": {
        "description": "Sent when a file uploaded to the POST /prequalification_data endpoint has been processed.\nContains a quote for each business in the input file.\nYou can also retrieve the quotes from the GET /prequalification_data endpoint.\nInstead of using this webhook, we recommend listening for the prequalification_data_file_processed_202510\nwebhook and calling the GET endpoint when you receive it.",
        "operationId": "webhook_prequalification202505",
        "parameters": [
          {
            "description": "UUID of the webhook event. Webhooks which do not deliver successfully are retried. This will be the same across retry attempts for the same webhook.",
            "in": "header",
            "name": "X-IW-Event-ID",
            "required": true,
            "schema": {
              "example": "d562dbff-8989-4ea7-809c-e2ada5b13fa8",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The type of webhook being delivered — matches the `webhook_event_type` values from `GET /webhooks/event_types/`.",
            "in": "header",
            "name": "X-IW-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC-SHA256 signature of the request body, base64-encoded and prefixed with `sha256=`. The HMAC key is your webhook secret token (not your API token), which you can fetch from the iwoca Notifications API or the Developer Portal. Verify this header to confirm the webhook is genuinely from iwoca and to mitigate replay attacks (by also checking that `X-IW-Timestamp` is recent). Retried deliveries get a fresh timestamp and therefore a fresh signature.\n\n```\nmessage   = \"{X-IW-Timestamp}.{raw_request_body}\"\nsignature = \"sha256=\" + base64(hmac_sha256(secret, message))\n```",
            "in": "header",
            "name": "X-IW-Signature",
            "required": true,
            "schema": {
              "example": "sha256=YoSHTwbVZnuLY8kPusTeHoqcyQ9g1IeVHKpIFLJjp4k=",
              "type": "string"
            }
          },
          {
            "description": "Unix timestamp (seconds) at which the delivery was initiated. If this delivery is a retry of an earlier failed delivery, the timestamp is of the current attempt, not the original delivery.",
            "in": "header",
            "name": "X-IW-Timestamp",
            "required": true,
            "schema": {
              "example": "1699443602",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "data": [
                  {
                    "quote_id": "1c6e2a6f-41ed-490e-8d05-87e34e756f7a",
                    "external_customer_id": "16aa735d-9890-479d-8cce-89d5c1c1df3d",
                    "prequalification_data_id": "prequal_partner-20260611000000000000.csv",
                    "is_prequalified": true,
                    "prequalified_amount": 10000,
                    "marketing_type": "prequalified_marketing"
                  },
                  {
                    "quote_id": "97976169-e0ff-4b60-afd0-869133a49828",
                    "external_customer_id": "c21a167f-7aef-47f1-aeb6-c4d2c3d7799d",
                    "prequalification_data_id": "prequal_partner-20260611000000000000.csv",
                    "is_prequalified": false,
                    "prequalified_amount": null,
                    "marketing_type": "generic_marketing"
                  },
                  {
                    "quote_id": "8cccd62c-1a50-4ae1-854b-a6a021a2ac32",
                    "external_customer_id": "1af8db98-bfff-4e5d-ad88-66dae61882ed",
                    "prequalification_data_id": "prequal_partner-20260611000000000000.csv",
                    "is_prequalified": false,
                    "prequalified_amount": null,
                    "marketing_type": "no_marketing"
                  }
                ]
              },
              "schema": {
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "click_out_url": {
                          "description": "If the customer should be marketed a credit card, they can click on this link to apply",
                          "format": "string",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "external_customer_id": {
                          "description": "The ID you used for this customer/business in the prequalification data file. We recommend sending this in the external_customer_id field of the POST /customers request if this customer subsequently signs up.",
                          "type": "string"
                        },
                        "is_prequalified": {
                          "description": "Deprecated: See the marketing_type field instead",
                          "example": true,
                          "type": "boolean"
                        },
                        "marketing_type": {
                          "description": "`no_marketing` means the product should not be marketed to this customer (for example, because they are ineligible). `generic_marketing` means iwoca did not generate a prequalified amount for this customer. The product can still be marketed to them, but without a prequalified amount. `prequalified_marketing` means the quote has a prequalified_amount which can be shown to the customer",
                          "example": "prequalified_marketing",
                          "type": "string"
                        },
                        "prequalification_data_id": {
                          "description": "ID of the file uploaded to POST /prequalification_data. Can be used to retrieve the quotes from GET /prequalification_data.",
                          "example": "prequal_partner-20260611000000000000.csv",
                          "type": "string"
                        },
                        "prequalified_amount": {
                          "example": 50000,
                          "format": "float",
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "product": {
                          "description": "Indicates whether this quote is for a Flexi-Loan or Credit Card",
                          "example": "flexi_loan",
                          "format": "string",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quote_id": {
                          "example": "4f9db950-2b6d-424e-96e1-7910c878375e",
                          "format": "uuid",
                          "type": "string"
                        }
                      },
                      "required": [
                        "quote_id",
                        "external_customer_id",
                        "is_prequalified",
                        "prequalification_data_id",
                        "marketing_type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return status code 200 or 201 to acknowledge receipt of the webhook. Any non-2XX response code will result in iwoca retrying the delivery."
          }
        },
        "security": [],
        "summary": "prequalification_202505 webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "prequalification_data_file_processed_202510": {
      "post": {
        "description": "Sent when a file that was uploaded to the POST /prequalification_data endpoint has finished processing\nand the results are ready to fetch from the GET /prequalification_data endpoint",
        "operationId": "webhook_prequalification_data_file_processed202510",
        "parameters": [
          {
            "description": "UUID of the webhook event. Webhooks which do not deliver successfully are retried. This will be the same across retry attempts for the same webhook.",
            "in": "header",
            "name": "X-IW-Event-ID",
            "required": true,
            "schema": {
              "example": "d562dbff-8989-4ea7-809c-e2ada5b13fa8",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The type of webhook being delivered — matches the `webhook_event_type` values from `GET /webhooks/event_types/`.",
            "in": "header",
            "name": "X-IW-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "HMAC-SHA256 signature of the request body, base64-encoded and prefixed with `sha256=`. The HMAC key is your webhook secret token (not your API token), which you can fetch from the iwoca Notifications API or the Developer Portal. Verify this header to confirm the webhook is genuinely from iwoca and to mitigate replay attacks (by also checking that `X-IW-Timestamp` is recent). Retried deliveries get a fresh timestamp and therefore a fresh signature.\n\n```\nmessage   = \"{X-IW-Timestamp}.{raw_request_body}\"\nsignature = \"sha256=\" + base64(hmac_sha256(secret, message))\n```",
            "in": "header",
            "name": "X-IW-Signature",
            "required": true,
            "schema": {
              "example": "sha256=YoSHTwbVZnuLY8kPusTeHoqcyQ9g1IeVHKpIFLJjp4k=",
              "type": "string"
            }
          },
          {
            "description": "Unix timestamp (seconds) at which the delivery was initiated. If this delivery is a retry of an earlier failed delivery, the timestamp is of the current attempt, not the original delivery.",
            "in": "header",
            "name": "X-IW-Timestamp",
            "required": true,
            "schema": {
              "example": "1699443602",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "data": {
                    "properties": {
                      "prequalification_data_id": {
                        "description": "Use this ID when making a request to GET /prequalification_data to fetch the results for this batch",
                        "example": "prequal_partner-20260611000000000000.csv",
                        "type": "string"
                      }
                    },
                    "required": [
                      "prequalification_data_id"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return status code 200 or 201 to acknowledge receipt of the webhook. Any non-2XX response code will result in iwoca retrying the delivery."
          }
        },
        "security": [],
        "summary": "prequalification_data_file_processed_202510 webhook",
        "tags": [
          "Webhooks"
        ]
      }
    }
  },
  "externalDocs": {
    "url": "https://lending-api-docs.iwoca.co.uk",
    "description": "iwoca Lending API guides and reference"
  }
}
