---
updatedAt: 2026-04-23T13:29:19.000Z
agentTools:
  projectIndex: https://developer.xentral.com/llms.txt
---

# Add journal entry

Add a new journal entry.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Xentral API",
    "version": "v0.1",
    "description": "Xentral is an ERP platform.",
    "contact": {
      "name": "Xentral",
      "url": "https://xentral.com",
      "email": "api@xentral.com"
    }
  },
  "tags": [
    {
      "name": "Point Of Sale",
      "description": "Point Of Sale (POS) endpoints."
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token obtained in POST /tokens endpoint or pregenerated in the system."
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://{xentralId}.xentral.biz",
      "description": "Your Xentral Instance",
      "variables": {
        "xentralId": {
          "default": "xentral"
        }
      }
    },
    {
      "url": "https://{domain}",
      "description": "Xentral at a custom domain",
      "variables": {
        "domain": {
          "default": "xentral.com"
        }
      }
    }
  ],
  "x-readme": {
    "samples-languages": []
  },
  "paths": {
    "/api/v1/posJournals/actions/add": {
      "post": {
        "tags": [
          "Point Of Sale"
        ],
        "operationId": "journal.add",
        "summary": "Add journal entry",
        "description": "Add a new journal entry.",
        "parameters": [],
        "requestBody": {
          "description": "Add journal entry",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "project",
                  "cashier",
                  "transaction",
                  "entry",
                  "payment"
                ],
                "properties": {
                  "project": {
                    "description": "Reference to another resource",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "\\d+",
                        "example": "17",
                        "description": "Resource identifier."
                      }
                    },
                    "example": {
                      "id": "1337"
                    }
                  },
                  "cashier": {
                    "description": "Reference to another resource",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "\\d+",
                        "example": "17",
                        "description": "Resource identifier."
                      }
                    },
                    "example": {
                      "id": "1337"
                    }
                  },
                  "transaction": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "type",
                      "text"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "nullable": false
                      },
                      "text": {
                        "type": "string",
                        "nullable": false
                      }
                    }
                  },
                  "entry": {
                    "oneOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "nullable": false,
                        "required": [
                          "type",
                          "timestamp",
                          "document"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "invoice",
                              "credit_note"
                            ],
                            "nullable": false
                          },
                          "timestamp": {
                            "description": "a atom formatted date time",
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-08-13T14:45:36+02:00"
                          },
                          "document": {
                            "type": "object",
                            "description": "When `entry.type` is `creditNote`, credit note ID will be provided. When `type` is `invoice`the invoice ID will be provided",
                            "additionalProperties": false,
                            "required": [
                              "id"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "\\d+",
                                "example": "17",
                                "description": "Resource identifier."
                              }
                            }
                          },
                          "qrString": {
                            "type": "string",
                            "description": "When `entry.type` is `invoice` or `credit_note` a string representing the QR code will be provided",
                            "additionalProperties": false
                          }
                        }
                      },
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "nullable": false,
                        "required": [
                          "type",
                          "timestamp",
                          "amount"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "cash_in",
                              "cash_out",
                              "cash_difference"
                            ],
                            "nullable": false
                          },
                          "timestamp": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": false
                          },
                          "amount": {
                            "type": "object",
                            "description": "Mandatory field when `entry.type` has one of the values: `cash_in`, `cash_out`, `cash_difference`.",
                            "additionalProperties": false,
                            "required": [
                              "amount",
                              "currency"
                            ],
                            "properties": {
                              "amount": {
                                "type": "string",
                                "format": "float"
                              },
                              "currency": {
                                "type": "string",
                                "pattern": "[A-Z]{3}",
                                "enum": [
                                  "EUR",
                                  "PLN",
                                  "CHF",
                                  "USD",
                                  "GBP"
                                ],
                                "description": "Currency matches one of currency values as specified in ISO-4217."
                              }
                            }
                          }
                        }
                      }
                    ]
                  },
                  "payment": {
                    "type": "object",
                    "additionalProperties": false,
                    "nullable": false,
                    "required": [
                      "type"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "cash",
                          "ec",
                          "credit",
                          "ec_card"
                        ],
                        "nullable": false
                      }
                    }
                  },
                  "fiscalDocumentReference": {
                    "description": "This field represents an object with dynamic structure",
                    "type": "object",
                    "additionalProperties": true,
                    "nullable": true
                  }
                }
              },
              "examples": {
                "Add journal entry": {
                  "value": {
                    "project": {
                      "id": "2"
                    },
                    "cashier": {
                      "id": "4"
                    },
                    "transaction": {
                      "type": "invoice",
                      "text": "Invoice 123"
                    },
                    "entry": {
                      "type": "invoice",
                      "timestamp": "2023-10-01T00:00:00Z",
                      "document": {
                        "id": "1"
                      }
                    },
                    "payment": {
                      "type": "cash"
                    },
                    "fiscalDocumentReference": null
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Resource successfully created response",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "example": "https://example.xentral.biz/api/users/17"
                },
                "description": "URI of the created resource"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "enum": [
                    ""
                  ],
                  "nullable": true
                }
              }
            }
          },
          "400": {
            "description": "IETF RFC 9457 Problem API compliant response",
            "content": {
              "application/problem+json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "violations"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://api.xentral.biz/problems/request-validation"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "example": "Request payload validation failed."
                        },
                        "violations": {
                          "oneOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "example": {
                                  "username": [
                                    "This value should not be blank."
                                  ],
                                  "email": [
                                    "This value is not a valid email address."
                                  ]
                                }
                              },
                              "description": "This field will be a mirrored request payload with only invalid fields and values replaced by error messages."
                            },
                            {
                              "type": "object",
                              "example": {
                                "_": [
                                  "This value should contain at most `9` elements."
                                ]
                              },
                              "description": "This field will be a mirrored request payload with only invalid fields and values replaced by error messages."
                            }
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "messages"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://api.xentral.biz/problems/generic-validation"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "messages"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://api.xentral.biz/problems/conflict"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "items"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://api.xentral.biz/problems/conflictItems"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "id",
                              "title",
                              "messages"
                            ],
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "title": {
                                "type": "string",
                                "minLength": 1
                              },
                              "messages": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "scopes"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://developer.xentral.com/reference/problems#token-scopes"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "messages"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://api.xentral.biz/problems/generic-validation"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "messages": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unable to authenticate the client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message explaining why the request failed.",
                      "example": "Missing required scopes: customer:create."
                    }
                  }
                },
                "example": {
                  "message": "Missing required scopes: customer:create."
                }
              },
              "text/html": {
                "schema": {
                  "type": "string",
                  "example": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Unable to authorize the client"
          },
          "404": {
            "description": "Resource was not found or not enough access privileges"
          },
          "406": {
            "description": "Requested resource representation does not exist."
          },
          "429": {
            "description": "Too many API calls made."
          }
        }
      }
    }
  }
}
```