---
updatedAt: 2025-05-15T21:03:19.000Z
agentTools:
  projectIndex: https://docs.youlend.com/llms.txt
---

# Create a transaction

When a 4xx client error occurs, response body may have schema YL.Domain.Messages.ResultWrapper
and contain more details on the error.<br /><br /><b>Possible values of YL.Domain.Messages.ResultWrapper.ErrorType for this endpoint:</b><br /><br /><b>2</b> - Instant settlement not found<br /><b>4</b> - Attempted to create a transaction on an Instant Settlement for which automatic creation of loans is disabled.<br /><b>5</b> - CurrencyISOCode for the requested transaction does not match the CurrencyISOCode on the Instant Settlement.<br /><b>6</b> - Attempted to create transaction with YL.Web.Api.ThirdParty.Loan.InstantSettlement.Models.CreateInstantSettlementTransactionModel.TotalSettlementAmount equal to 0.<br /><b>7</b> - Attempted to create a transaction that was not from today.<br /><b>8</b> - The size of the requested transaction is too large.<br /><b>9</b> - A transaction with the same transaction reference has already been created recently (within last 50 created transactions).<br /><br />
Sample request:
    POST /api/InstantSettlement/30000001
    {
        "transactionReference": "ref",
        "currencyISOCode": "GBP",
        "totalSettlementAmount": 10000,
        "transactionDate" : "2020-02-16T18:25:43-05:00"
    }

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "YouLend Third Party Instant Settlement API",
    "description": "Through this API you can can create Instant Settlement transactions with YouLend",
    "contact": {
      "name": "Mark Ufland",
      "email": "mark.ufland@youlend.com"
    },
    "version": "v1.0"
  },
  "servers": [
    {
      "url": "https://partners.staging-youlendapi.com/instantsettlement"
    }
  ],
  "paths": {
    "/api/InstantSettlement/{instantSettlementNumber}": {
      "post": {
        "tags": [
          "InstantSettlement"
        ],
        "summary": "Create a transaction",
        "description": "When a 4xx client error occurs, response body may have schema YL.Domain.Messages.ResultWrapper\r\nand contain more details on the error.<br /><br /><b>Possible values of YL.Domain.Messages.ResultWrapper.ErrorType for this endpoint:</b><br /><br /><b>2</b> - Instant settlement not found<br /><b>4</b> - Attempted to create a transaction on an Instant Settlement for which automatic creation of loans is disabled.<br /><b>5</b> - CurrencyISOCode for the requested transaction does not match the CurrencyISOCode on the Instant Settlement.<br /><b>6</b> - Attempted to create transaction with YL.Web.Api.ThirdParty.Loan.InstantSettlement.Models.CreateInstantSettlementTransactionModel.TotalSettlementAmount equal to 0.<br /><b>7</b> - Attempted to create a transaction that was not from today.<br /><b>8</b> - The size of the requested transaction is too large.<br /><b>9</b> - A transaction with the same transaction reference has already been created recently (within last 50 created transactions).<br /><br />\r\nSample request:\r\n    POST /api/InstantSettlement/30000001\r\n    {\r\n        \"transactionReference\": \"ref\",\r\n        \"currencyISOCode\": \"GBP\",\r\n        \"totalSettlementAmount\": 10000,\r\n        \"transactionDate\" : \"2020-02-16T18:25:43-05:00\"\r\n    }",
        "parameters": [
          {
            "name": "instantSettlementNumber",
            "in": "path",
            "description": "Instant settlement number (an integer)<br /><br />\r\nThis parameter can be obtained by calling the api/InstantSettlement GET endpoint which returns details about all instant settlement products available for a lending partner.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "api-version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The YL.Web.Api.ThirdParty.Loan.InstantSettlement.Models.CreateInstantSettlementTransactionModel",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInstantSettlementTransactionModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Instant settlement transaction successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InstantSettlementTransactionDetailsModel"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Something went wrong!",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResultWrapper"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request"
          },
          "403": {
            "description": "Forbidden request"
          },
          "404": {
            "description": "Instant settlement not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResultWrapper"
                }
              }
            }
          },
          "422": {
            "description": "CreateInstantSettlementTransactionModel from request body failed validation"
          },
          "500": {
            "description": "Servers are unavailable"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreateInstantSettlementTransactionModel": {
        "required": [
          "transactionReference"
        ],
        "type": "object",
        "properties": {
          "transactionReference": {
            "maxLength": 35,
            "minLength": 1,
            "type": "string",
            "description": "Gets or sets a transaction reference that will be shown in the account where the funds are transfered.\r\nThis is a string of maximum 35 characters (a-zA-Z0-9/-?:.+ blank/space). It needs to be unique for each transaction request."
          },
          "currencyISOCode": {
            "type": "string",
            "description": "Gets or sets Currency ISO code string",
            "nullable": true
          },
          "totalSettlementAmount": {
            "minimum": 0,
            "type": "number",
            "description": "Gets or sets Total settlement amount",
            "format": "double"
          },
          "transactionDate": {
            "type": "string",
            "description": "Gets or sets transaction date\r\n(needs to be within the settlement cycle length specified for each Instant Settlement)",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Model for creating an instant settlement transaction"
      },
      "InstantSettlementTransactionDetailsModel": {
        "type": "object",
        "properties": {
          "instantSettlementNumber": {
            "type": "integer",
            "description": "Gets or sets the InstantSettlementNumber",
            "format": "int32"
          },
          "instantSettlementTransactionNumber": {
            "type": "integer",
            "description": "Gets or sets transaction number, a unique identifier of the transaction for the corresponding InstantSettlementNumber",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Model for Instant Settlement Transaction Details"
      },
      "ResultWrapper": {
        "type": "object",
        "properties": {
          "errorType": {
            "type": "integer",
            "format": "int32"
          },
          "data": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://youlend-stag.eu.auth0.com/oauth/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```