Your Transactions

Open Ledger offers a Transaction API that allows for direct manipulation of transaction data within your application. This setup provides an alternative to third-party integrations like Plaid, offering greater control over how transactions are processed and managed.

Getting Started

Ensure you have the required API credentials, which include client_id and client_secret, necessary for authenticating requests to the API.

Transaction API Endpoints

Utilize the following endpoints to manage transactions for a specific company:

  • POST /company/:id/transactions – Add new transactions for a specified company.
  • GET /company/:id/transactions – Retrieve all transactions for a specified company.
  • GET /company/:id/transactions/{transactionId} – Retrieve details of a specific transaction for a specified company.
  • PUT /company/:id/transactions/{transactionId} – Update an existing transaction for a specified company.
  • DELETE /company/:id/transactions/{transactionId} – Remove a specific transaction for a specified company.

Adding a Transaction

To add a transaction to a specific company, send a POST request with the transaction details:

Request

$POST /api/company/:id/transactions
>Authorization: Bearer {access_token}
>Content-Type: application/json
>
>{
> "date": "2024-01-15",
> "description": "Invoice payment received",
> "amount": 500,
> "currency": "USD",
> "category": "Income",
> "accountId": "acc_123456"
>}

Replace :id with the actual company ID to which the transaction belongs.

Successful Response

1{
2 "success": true,
3 "message": "Transaction added successfully",
4 "data": {
5 "transactionId": "txn_123456",
6 "date": "2024-01-15",
7 "description": "Invoice payment received",
8 "amount": 500,
9 "currency": "USD",
10 "category": "Income",
11 "accountId": "acc_123456"
12 }
13}

Error Response

1{
2 "success": false,
3 "message": "Error adding transaction: [Error Detail]"
4}

Best Practices

Built with