---
updatedAt: 2026-05-27T09:29:13.000Z
agentTools:
  projectIndex: https://pennylane.readme.io/llms.txt
---

# Create a transaction

Create a banking transaction

> ℹ️
> This endpoint requires the following scope: `transactions:all`

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Company V2",
    "description": "Automate your accounting with the Pennylane API. [Documentation](https://pennylane.readme.io/)",
    "contact": {
      "email": "tech@pennylane.com"
    },
    "version": "2.0"
  },
  "x-readme": {
    "samples-languages": [
      "curl",
      "node",
      "ruby",
      "php",
      "python",
      "java"
    ]
  },
  "servers": [
    {
      "url": "https://app.pennylane.com"
    }
  ],
  "paths": {
    "/api/external/v2/transactions": {
      "post": {
        "operationId": "createTransaction",
        "summary": "Create a transaction",
        "description": "Create a banking transaction\n\n> ℹ️\n> This endpoint requires the following scope: `transactions:all`",
        "tags": [
          "Transactions"
        ],
        "security": [
          {
            "oauth2": [
              "transactions:all"
            ]
          }
        ],
        "parameters": [
          {
            "name": "X-Company-Id",
            "description": "Numeric ID of the company to act on. Required when authenticating with a firm token. Ignored when the token is already bound to a company.",
            "in": "header",
            "schema": {
              "type": "string",
              "example": "12345"
            },
            "required": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "bank_account_id": {
                    "type": "integer",
                    "format": "int64",
                    "description": "The bank account where the transaction is registered",
                    "example": 42
                  },
                  "label": {
                    "description": "Transaction label",
                    "type": "string",
                    "example": "test label"
                  },
                  "date": {
                    "description": "Transaction date",
                    "type": "string",
                    "format": "date",
                    "example": "2025-07-30"
                  },
                  "amount": {
                    "description": "Transaction amount",
                    "type": "string",
                    "example": "120.00"
                  },
                  "fee": {
                    "description": "Transaction fee",
                    "type": "string",
                    "example": "12.00"
                  }
                },
                "required": [
                  "bank_account_id",
                  "label",
                  "date",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Transaction created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "description": "Transaction identifier",
                      "type": "integer",
                      "format": "int64",
                      "example": 42
                    },
                    "label": {
                      "type": "string",
                      "nullable": true,
                      "example": "VIR SEPA MY SUPPLIER SAS"
                    },
                    "attachment_required": {
                      "description": "When `true`, the transaction need to be justified and matched with an invoice",
                      "type": "boolean",
                      "example": true
                    },
                    "date": {
                      "type": "string",
                      "format": "date",
                      "example": "2023-08-30"
                    },
                    "outstanding_balance": {
                      "description": "This is the balance of the transaction after it has been\nprocessed.\n",
                      "type": "string",
                      "nullable": true,
                      "example": "49.3"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2023-08-30T10:08:08.146343Z"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2023-08-30T10:08:08.146343Z"
                    },
                    "archived_at": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true,
                      "example": "2023-08-30T10:08:08.146343Z"
                    },
                    "currency": {
                      "oneOf": [
                        {
                          "type": "string",
                          "default": "EUR",
                          "enum": [
                            "EUR",
                            "USD",
                            "GBP",
                            "AED",
                            "AFN",
                            "ALL",
                            "AMD",
                            "ANG",
                            "AOA",
                            "ARS",
                            "AUD",
                            "AWG",
                            "AZN",
                            "BAM",
                            "BBD",
                            "BDT",
                            "BGN",
                            "BHD",
                            "BIF",
                            "BMD",
                            "BND",
                            "BOB",
                            "BRL",
                            "BSD",
                            "BTN",
                            "BWP",
                            "BYN",
                            "BYR",
                            "BZD",
                            "CAD",
                            "CDF",
                            "CHE",
                            "CHF",
                            "CLF",
                            "CLP",
                            "CNY",
                            "COP",
                            "CRC",
                            "CUC",
                            "CUP",
                            "CVE",
                            "CZK",
                            "DJF",
                            "DKK",
                            "DOP",
                            "DZD",
                            "EGP",
                            "ERN",
                            "ETB",
                            "FJD",
                            "FKP",
                            "GEL",
                            "GGP",
                            "GHS",
                            "GIP",
                            "GMD",
                            "GNF",
                            "GTQ",
                            "GYD",
                            "HKD",
                            "HNL",
                            "HRK",
                            "HTG",
                            "HUF",
                            "IDR",
                            "ILS",
                            "IMP",
                            "INR",
                            "IQD",
                            "IRR",
                            "ISK",
                            "JEP",
                            "JMD",
                            "JOD",
                            "JPY",
                            "KES",
                            "KGS",
                            "KHR",
                            "KMF",
                            "KPW",
                            "KRW",
                            "KWD",
                            "KYD",
                            "KZT",
                            "LAK",
                            "LBP",
                            "LKR",
                            "LRD",
                            "LSL",
                            "LTL",
                            "LVL",
                            "LYD",
                            "MAD",
                            "MDL",
                            "MGA",
                            "MKD",
                            "MMK",
                            "MNT",
                            "MOP",
                            "MRO",
                            "MRU",
                            "MUR",
                            "MVR",
                            "MWK",
                            "MXN",
                            "MYR",
                            "MZN",
                            "NAD",
                            "NGN",
                            "NIO",
                            "NOK",
                            "NPR",
                            "NZD",
                            "OMR",
                            "PAB",
                            "PEN",
                            "PGK",
                            "PHP",
                            "PKR",
                            "PLN",
                            "PYG",
                            "QAR",
                            "RON",
                            "RSD",
                            "RUB",
                            "RWF",
                            "SAR",
                            "SBD",
                            "SCR",
                            "SDG",
                            "SEK",
                            "SGD",
                            "SHP",
                            "SLL",
                            "SLE",
                            "SOS",
                            "SRD",
                            "STD",
                            "SVC",
                            "SYP",
                            "SZL",
                            "THB",
                            "TJS",
                            "TMT",
                            "TND",
                            "TOP",
                            "TRY",
                            "TTD",
                            "TWD",
                            "TZS",
                            "UAH",
                            "UGX",
                            "UYU",
                            "UZS",
                            "VEF",
                            "VES",
                            "VND",
                            "VUV",
                            "WST",
                            "XAF",
                            "XCD",
                            "XDR",
                            "XOF",
                            "XPF",
                            "YER",
                            "ZAR",
                            "ZMK",
                            "ZMW",
                            "ZWL"
                          ]
                        },
                        {
                          "type": "string",
                          "nullable": true,
                          "enum": [
                            null
                          ]
                        }
                      ]
                    },
                    "currency_amount": {
                      "description": "Amount in the currency of the transaction.",
                      "type": "string",
                      "example": "120.00"
                    },
                    "amount": {
                      "description": "Transaction amount in euros. If the currency is euro, `currency_amount` and `amount` are identical.",
                      "type": "string",
                      "example": "120.00"
                    },
                    "currency_fee": {
                      "description": "Fee in the currency of the transaction.",
                      "type": "string",
                      "nullable": true,
                      "example": "120.00"
                    },
                    "fee": {
                      "description": "Transaction fee in euros. If the currency is euro, `currency_fee` and `fee`\nare identical.\n",
                      "type": "string",
                      "nullable": true,
                      "example": "120.00"
                    },
                    "journal": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "integer",
                          "format": "int64",
                          "example": 234
                        },
                        "url": {
                          "type": "string",
                          "example": "https://app.pennylane.com/api/external/v2/journals/67"
                        }
                      },
                      "required": [
                        "id",
                        "url"
                      ]
                    },
                    "bank_account": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "integer",
                          "format": "int64",
                          "example": 53
                        },
                        "url": {
                          "type": "string",
                          "example": "https://app.pennylane.com/api/external/v2/bank_accounts/53"
                        }
                      },
                      "required": [
                        "id",
                        "url"
                      ]
                    },
                    "pro_account_expense": {
                      "type": "object",
                      "nullable": true,
                      "additionalProperties": false,
                      "properties": {
                        "employee": {
                          "type": "object",
                          "nullable": true,
                          "additionalProperties": false,
                          "properties": {
                            "id": {
                              "type": "integer",
                              "format": "int64",
                              "example": 42
                            },
                            "first_name": {
                              "type": "string",
                              "example": "John"
                            },
                            "last_name": {
                              "type": "string",
                              "example": "Doe"
                            }
                          },
                          "required": [
                            "id",
                            "first_name",
                            "last_name"
                          ]
                        },
                        "card_masked_number": {
                          "type": "string",
                          "example": "123456XXXXXX7890"
                        }
                      },
                      "required": [
                        "employee",
                        "card_masked_number"
                      ]
                    },
                    "customer": {
                      "type": "object",
                      "nullable": true,
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "integer",
                          "format": "int64",
                          "example": 42
                        },
                        "url": {
                          "type": "string",
                          "example": "https://app.pennylane.com/api/external/v2/customers/42"
                        }
                      },
                      "required": [
                        "id",
                        "url"
                      ]
                    },
                    "supplier": {
                      "type": "object",
                      "nullable": true,
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "integer",
                          "format": "int64",
                          "example": 42
                        },
                        "url": {
                          "type": "string",
                          "example": "https://app.pennylane.com/api/external/v2/supplier/42"
                        }
                      },
                      "required": [
                        "id",
                        "url"
                      ]
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "id": {
                            "type": "integer",
                            "format": "int64",
                            "example": 421
                          },
                          "label": {
                            "type": "string",
                            "example": "HR - Salaries"
                          },
                          "weight": {
                            "type": "string",
                            "example": "0.25"
                          },
                          "category_group": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "id": {
                                "type": "integer",
                                "format": "int64",
                                "example": 229
                              }
                            },
                            "required": [
                              "id"
                            ]
                          },
                          "analytical_code": {
                            "type": "string",
                            "nullable": true,
                            "example": "CODE123"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-08-30T10:08:08.146343Z"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-08-30T10:08:08.146343Z"
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "weight",
                          "category_group",
                          "analytical_code",
                          "created_at",
                          "updated_at"
                        ]
                      }
                    },
                    "matched_invoices": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "url": {
                          "type": "string",
                          "example": "https://app.pennylane.com/api/external/v2/transactions/42/matched_invoices"
                        }
                      },
                      "required": [
                        "url"
                      ]
                    },
                    "interbank_code": {
                      "type": "string",
                      "nullable": true,
                      "example": "B1D"
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "attachment_required",
                    "date",
                    "outstanding_balance",
                    "created_at",
                    "updated_at",
                    "archived_at",
                    "currency",
                    "currency_amount",
                    "amount",
                    "currency_fee",
                    "fee",
                    "journal",
                    "bank_account",
                    "pro_account_expense",
                    "customer",
                    "supplier",
                    "categories",
                    "matched_invoices",
                    "interbank_code"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "error": {
                          "type": "string"
                        },
                        "status": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "error",
                        "status"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "InvalidDateFormat",
                            "InvalidDateTimeFormat",
                            "InvalidEmailFormat",
                            "InvalidPattern",
                            "InvalidUUIDFormat",
                            "LessThanExclusiveMinimum",
                            "LessThanMinimum",
                            "LessThanMinItems",
                            "LessThanMinLength",
                            "MoreThanExclusiveMaximum",
                            "MoreThanMaximum",
                            "MoreThanMaxItems",
                            "MoreThanMaxLength",
                            "NotAMultipartFile",
                            "NotAnyOf",
                            "NotEnumInclude",
                            "NotExistContentTypeDefinition",
                            "NotExistDiscriminatorMappedSchema",
                            "NotExistDiscriminatorPropertyName",
                            "NotExistPropertyDefinition",
                            "NotExistRequiredKey",
                            "NotExistStatusCodeDefinition",
                            "NotNullError",
                            "NotOneOf",
                            "ValidateError"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "code"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "InvalidDateFormat",
                            "InvalidDateTimeFormat",
                            "InvalidEmailFormat",
                            "InvalidPattern",
                            "InvalidUUIDFormat",
                            "LessThanExclusiveMinimum",
                            "LessThanMinimum",
                            "LessThanMinItems",
                            "LessThanMinLength",
                            "MoreThanExclusiveMaximum",
                            "MoreThanMaximum",
                            "MoreThanMaxItems",
                            "MoreThanMaxLength",
                            "NotAMultipartFile",
                            "NotAnyOf",
                            "NotEnumInclude",
                            "NotExistContentTypeDefinition",
                            "NotExistDiscriminatorMappedSchema",
                            "NotExistDiscriminatorPropertyName",
                            "NotExistPropertyDefinition",
                            "NotExistRequiredKey",
                            "NotExistStatusCodeDefinition",
                            "NotNullError",
                            "NotOneOf",
                            "ValidateError"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "field",
                        "code"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "payload": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "InvalidDateFormat",
                            "InvalidDateTimeFormat",
                            "InvalidEmailFormat",
                            "InvalidPattern",
                            "InvalidUUIDFormat",
                            "LessThanExclusiveMinimum",
                            "LessThanMinimum",
                            "LessThanMinItems",
                            "LessThanMinLength",
                            "MoreThanExclusiveMaximum",
                            "MoreThanMaximum",
                            "MoreThanMaxItems",
                            "MoreThanMaxLength",
                            "NotAMultipartFile",
                            "NotAnyOf",
                            "NotEnumInclude",
                            "NotExistContentTypeDefinition",
                            "NotExistDiscriminatorMappedSchema",
                            "NotExistDiscriminatorPropertyName",
                            "NotExistPropertyDefinition",
                            "NotExistRequiredKey",
                            "NotExistStatusCodeDefinition",
                            "NotNullError",
                            "NotOneOf",
                            "ValidateError"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "payload",
                        "code"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "message": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "payload": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "InvalidDateFormat",
                            "InvalidDateTimeFormat",
                            "InvalidEmailFormat",
                            "InvalidPattern",
                            "InvalidUUIDFormat",
                            "LessThanExclusiveMinimum",
                            "LessThanMinimum",
                            "LessThanMinItems",
                            "LessThanMinLength",
                            "MoreThanExclusiveMaximum",
                            "MoreThanMaximum",
                            "MoreThanMaxItems",
                            "MoreThanMaxLength",
                            "NotAMultipartFile",
                            "NotAnyOf",
                            "NotEnumInclude",
                            "NotExistContentTypeDefinition",
                            "NotExistDiscriminatorMappedSchema",
                            "NotExistDiscriminatorPropertyName",
                            "NotExistPropertyDefinition",
                            "NotExistRequiredKey",
                            "NotExistStatusCodeDefinition",
                            "NotNullError",
                            "NotOneOf",
                            "ValidateError"
                          ]
                        }
                      },
                      "required": [
                        "message",
                        "field",
                        "payload",
                        "code"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Access token is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "The access token is invalid"
                    },
                    "status": {
                      "type": "integer",
                      "example": 401
                    }
                  },
                  "required": [
                    "error",
                    "status"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Access to this resource forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Access to this resource requires scope \"ledger\"."
                    },
                    "status": {
                      "type": "integer",
                      "example": 403
                    }
                  },
                  "required": [
                    "error",
                    "status"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Not Found"
                    },
                    "status": {
                      "type": "integer",
                      "example": 404
                    }
                  },
                  "required": [
                    "error",
                    "status"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Entry lines are not balanced"
                    },
                    "status": {
                      "type": "integer",
                      "example": 422
                    }
                  },
                  "required": [
                    "error",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://app.pennylane.com/oauth/authorize",
            "tokenUrl": "https://app.pennylane.com/oauth/oauth/token",
            "refreshUrl": "https://app.pennylane.com/oauth/oauth/token",
            "scopes": {
              "ledger": "Grant create, update and read access to Ledger Entries and its related resources"
            }
          }
        }
      }
    }
  }
}
```