Transactions API

Use Transactions APIs to manage all your transactions.

Create a transaction

POST /v1/organizations/{{id}}/ledgers/{{id}}/transactions

Use this endpoint to create a transaction.

Headers

Name
Value

idempotencyKey

application/json

tolerance

Bearer <token>

Request body
{
  "transactionTypeCode": "PIX_OUT",
  "variables": {
    "amount": 100,
    "source": "@johndoe",
    "fee": 1
  },
  "metadata": {
    "anyKey": "anyValue",
    "anotherKey": "anotherValue"
  },
  "parentTransactionId": null,
  "description": "My first transaction using Midaz!
}

Response codes

{
  "id": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
  "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
  "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
  "parentTransactionId": null,
  "description": "My first transaction using Midaz!",
  "type": "PIX_OUT",
  "status": "SENT",
  "amount": {
    "amount": 101,
    "scale": 2
  },
  "assetCode": "BRL",
  "chartOfAccountsGroupName": "PIX_OUT_981723817381929172381",
  "source": [
    "@johndoe"
  ],
  "destination": [
    "@fees/pix",
    "@external/BRL"
  ],
  "metadata": {
    "anyKey": "anyValue",
    "anotherKey": "anotherValue"
  },
  "operations": [
    {
      "id": "efe41323-3431-446c-a954-9a756fdea70b",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "DEBIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_debit_amount",
      "amount": {
        "amount": 100,
        "scale": 2
      },
      "balance": {
        "available": 500,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 400,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
      "accountAlias": "@johndoe",
      "portfolioId": "faa1d4c8-4bdc-4163-9ebc-9814cb2daa6d",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "29590e9b-b70a-4b09-bba8-616ce8f37f9b",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "DEBIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_debit_fee",
      "amount": {
        "amount": 1,
        "scale": 2
      },
      "balance": {
        "available": 400,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 399,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
      "accountAlias": "@johndoe",
      "portfolioId": "faa1d4c8-4bdc-4163-9ebc-9814cb2daa6d",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "d4cd4bee-9097-4f07-a8a4-144ee5eee4db",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "CREDIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_credit_fee",
      "amount": {
        "amount": 1,
        "scale": 2
      },
      "balance": {
        "available": 0,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 1,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "e9de9228-7509-49a5-9ef7-3b4b64293bb2",
      "accountAlias": "@fees/PIX_OUT",
      "portfolioId": "965eab51-caae-4172-a01c-24344fa8b1f8",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "f4f22017-9fca-4742-a0f3-a7607017428f",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "CREDIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_credit_amount",
      "amount": {
        "amount": 100,
        "scale": 2
      },
      "balance": {
        "available": 0,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 100,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "ab7e7eee-92fc-4f82-82ff-71efa1a9a7ac",
      "accountAlias": "@external/BRL",
      "portfolioId": "a03d22a4-5afc-4b6f-86f4-ba341b34b152",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    }
  ],
  "createdAt": "2024-01-29T00:12:00+0300",
  "updatedAt": "2024-01-29T00:12:00+0300"
}

Create a Pre-transaction

POST /v1/organizations/{{id}}/ledgers/{{id}}/transactions

Use this endpoint to create a transaction pending statement.

Headers

Name

idempotencyKey

application/json

tolerance

Bearer <token>

Request body
{
  "transactionTypeCode": "PIX_OUT",
  "pending": true,
  "variables": {
    "amount": 100,
    "source": "@johndoe",
    "fee": 1
  },
  "metadata": {
    "anyKey": "anyValue",
    "anotherKey": "anotherValue"
  },
  "parentTransactionId": null,
  "description": "My first transaction using Midaz!"
}

Response codes

{
  "id": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
  "parentTransactionId": null,
  "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
  "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
  "description": "My first transaction using Midaz!",
  "type": "PIX_OUT",
  "status": "PRE_APPROVED",
  "amount": {
    "amount": 101,
    "scale": 2
  },
  "assetCode": "BRL",
  "chartOfAccountsGroupName": "PIX_OUT",
  "source": [
    "@johndoe"
  ],
  "destination": [
    "@fees/pix",
    "@external/BRL"
  ],
  "metadata": {
    "anyKey": "anyValue",
    "anotherKey": "anotherValue"
  },
  "operations": [
    {
      "id": "efe41323-3431-446c-a954-9a756fdea70b",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "DEBIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_debit_amount",
      "amount": {
        "amount": 100,
        "scale": 2
      },
      "balance": {
        "available": 500,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 400,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
      "accountAlias": "@johndoe",
      "portfolioId": "faa1d4c8-4bdc-4163-9ebc-9814cb2daa6d",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "29590e9b-b70a-4b09-bba8-616ce8f37f9b",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "DEBIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_debit_fee",
      "amount": {
        "amount": 1,
        "scale": 2
      },
      "balance": {
        "available": 400,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 399,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
      "accountAlias": "@johndoe",
      "portfolioId": "faa1d4c8-4bdc-4163-9ebc-9814cb2daa6d",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "d4cd4bee-9097-4f07-a8a4-144ee5eee4db",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "CREDIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_credit_fee",
      "amount": {
        "amount": 1,
        "scale": 2
      },
      "balance": {
        "available": 0,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 1,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "e9de9228-7509-49a5-9ef7-3b4b64293bb2",
      "accountAlias": "@fees/PIX_OUT",
      "portfolioId": "965eab51-caae-4172-a01c-24344fa8b1f8",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "f4f22017-9fca-4742-a0f3-a7607017428f",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "CREDIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_credit_amount",
      "amount": {
        "amount": 100,
        "scale": 2
      },
      "balance": {
        "available": 0,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 100,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "ab7e7eee-92fc-4f82-82ff-71efa1a9a7ac",
      "accountAlias": "@external/BRL",
      "portfolioId": "a03d22a4-5afc-4b6f-86f4-ba341b34b152",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    }
  ],
  "createdAt": "2024-01-29T00:12:00+0300",
  "updatedAt": "2024-01-29T00:12:00+0300"
}

Confirm a Pre-transaction

Use this endpoint to confirm a transaction with pending status "true".

POST /v1/organizations/{{id}}/ledgers/{{id}}/transactions/{{id}}/commit

Headers

Name
Value

idempotencyKey

application/json

tolerance

Bearer <token>

{
  "id": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
  "parentTransactionId": null,
  "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
  "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
  "description": "My first transaction using Midaz!",
  "type": "PIX_OUT",
  "status": "SENT",
  "amount": {
    "amount": 101,
    "scale": 2
  },
  "assetCode": "BRL",
  "chartOfAccountsGroupName": "PIX_OUT",
  "source": [
    "@johndoe"
  ],
  "destination": [
    "@fees/pix",
    "@external/BRL"
  ],
  "metadata": {
    "anyKey": "anyValue",
    "anotherKey": "anotherValue"
  },
  "operations": [
    {
      "id": "efe41323-3431-446c-a954-9a756fdea70b",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "DEBIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_debit_amount",
      "amount": {
        "amount": 100,
        "scale": 2
      },
      "balance": {
        "available": 500,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 400,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
      "accountAlias": "@johndoe",
      "portfolioId": "faa1d4c8-4bdc-4163-9ebc-9814cb2daa6d",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "29590e9b-b70a-4b09-bba8-616ce8f37f9b",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "DEBIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_debit_fee",
      "amount": {
        "amount": 1,
        "scale": 2
      },
      "balance": {
        "available": 400,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 399,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
      "accountAlias": "@johndoe",
      "portfolioId": "faa1d4c8-4bdc-4163-9ebc-9814cb2daa6d",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "d4cd4bee-9097-4f07-a8a4-144ee5eee4db",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "CREDIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_credit_fee",
      "amount": {
        "amount": 1,
        "scale": 2
      },
      "balance": {
        "available": 0,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 1,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "e9de9228-7509-49a5-9ef7-3b4b64293bb2",
      "accountAlias": "@fees/PIX_OUT",
      "portfolioId": "965eab51-caae-4172-a01c-24344fa8b1f8",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "f4f22017-9fca-4742-a0f3-a7607017428f",
      "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "CREDIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_credit_amount",
      "amount": {
        "amount": 100,
        "scale": 2
      },
      "balance": {
        "available": 0,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 100,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "ab7e7eee-92fc-4f82-82ff-71efa1a9a7ac",
      "accountAlias": "@external/BRL",
      "portfolioId": "a03d22a4-5afc-4b6f-86f4-ba341b34b152",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    }
  ],
  "createdAt": "2024-01-29T00:12:00+0300",
  "updatedAt": "2024-01-29T00:12:00+0300"
}

Revert a transaction

Use this endpoint to revert a transaction or a pre-transaction.

POST /v1/organizations/{{id}}/ledgers/{{id}}/transactions/{{id}}/revert

Headers

Description

idempotencyKey

application/json

tolerance

Bearer <token>

{
  "id": "6964c0f5-01c9-41fa-9719-6ed9c5433e09",
  "parentTransactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
  "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
  "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
  "description": null,
  "type": "PIX_OUT",
  "status": "SENT",
  "amount": {
    "amount": 101,
    "scale": 2
  },
  "assetCode": "BRL",
  "chartOfAccountsGroupName": "PIX_OUT",
  "source": [
    "@fees/pix",
    "@external/BRL"
  ],
  "destination": [
    "@johndoe"
  ],
  "metadata": {
    "anyKey": "anyValue",
    "anotherKey": "anotherValue"
  },
  "operations": [
    {
      "id": "17ac26a7-5086-42b6-b77d-289a7030639b",
      "transactionId": "6964c0f5-01c9-41fa-9719-6ed9c5433e09",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "CREDIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_debit_amount",
      "amount": {
        "amount": 100,
        "scale": 2
      },
      "balance": {
        "available": 399,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 499,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
      "accountAlias": "@johndoe",
      "portfolioId": "faa1d4c8-4bdc-4163-9ebc-9814cb2daa6d",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "51164e26-823b-42f7-bff4-9385e45b6190",
      "transactionId": "6964c0f5-01c9-41fa-9719-6ed9c5433e09",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "CREDIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_debit_fee",
      "amount": {
        "amount": 1,
        "scale": 2
      },
      "balance": {
        "available": 499,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 500,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
      "accountAlias": "@johndoejohndoe",
      "portfolioId": "faa1d4c8-4bdc-4163-9ebc-9814cb2daa6d",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "654a6f7f-e29f-48ab-8397-d455b41a2eea",
      "transactionId": "6964c0f5-01c9-41fa-9719-6ed9c5433e09",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "DEBIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_credit_fee",
      "amount": {
        "amount": 1,
        "scale": 2
      },
      "balance": {
        "available": 1,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 0,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "e9de9228-7509-49a5-9ef7-3b4b64293bb2",
      "accountAlias": "@fees/PIX_OUT",
      "portfolioId": "965eab51-caae-4172-a01c-24344fa8b1f8",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    },
    {
      "id": "f4f22017-9fca-4742-a0f3-a7607017428f",
      "transactionId": "6964c0f5-01c9-41fa-9719-6ed9c5433e09",
      "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
      "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
      "description": "My first transaction using Midaz!",
      "type": "DEBIT",
      "assetCode": "BRL",
      "chartOfAccounts": "pix_out_credit_amount",
      "amount": {
        "amount": 100,
        "scale": 2
      },
      "balance": {
        "available": 100,
        "onHold": 0,
        "scale": 2
      },
      "balanceAfter": {
        "available": 0,
        "onHold": 0,
        "scale": 2
      },
      "accountId": "ab7e7eee-92fc-4f82-82ff-71efa1a9a7ac",
      "accountAlias": "@external/BRL",
      "portfolioId": "a03d22a4-5afc-4b6f-86f4-ba341b34b152",
      "metadata": {
        "anyKey": "anyValue",
        "anotherKey": "anotherValue"
      },
      "createdAt": "2024-01-29T00:12:00+0300",
      "updatedAt": "2024-01-29T00:12:00+0300"
    }
  ],
  "createdAt": "2024-01-29T00:12:00+0300",
  "updatedAt": "2024-01-29T00:12:00+0300"
}

Retrieve all Transactions

GET /v1/organizations/{{id}}/ledgers/{{id}}/transactions

Use this endpoint to retrieve the information of all transactions.

Headers

Name
Value

Authorization

Bearer <token>

Query parameters

Name
Type
Description

beginDate

endDate

metadata.{{key}}={{value}}

assetCode

status

type

parentTransactionId

Response codes

[
  {
    "id": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
    "parentTransactionId": null,
    "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
    "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
    "description": "My first transaction using Midaz!",
    "type": "PIX_OUT",
    "status": "SENT",
    "amount": {
      "amount": 101,
      "scale": 2
    },
    "assetCode": "BRL",
    "chartOfAccountsGroupName": "PIX_OUT",
    "source": [
      "@johndoe"
    ],
    "destination": [
      "@fees/pix",
      "@external/BRL"
    ],
    "metadata": {
      "anyKey": "anyValue",
      "anotherKey": "anotherValue"
    },
    "operations": [
      {
        "id": "efe41323-3431-446c-a954-9a756fdea70b",
        "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
        "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
        "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
        "description": "My first transaction using Midaz!",
        "type": "DEBIT",
        "assetCode": "BRL",
        "chartOfAccounts": "pix_out_debit_amount",
        "amount": {
          "amount": 100,
          "scale": 2
        },
        "balance": {
          "available": 500,
          "onHold": 0,
          "scale": 2
        },
        "balanceAfter": {
          "available": 400,
          "onHold": 0,
          "scale": 2
        },
        "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
        "accountAlias": "@johndoe",
        "portfolioId": "faa1d4c8-4bdc-4163-9ebc-9814cb2daa6d",
        "metadata": {
          "anyKey": "anyValue",
          "anotherKey": "anotherValue"
        },
        "createdAt": "2024-01-29T00:12:00+0300",
        "updatedAt": "2024-01-29T00:12:00+0300"
      },
      {
        "id": "29590e9b-b70a-4b09-bba8-616ce8f37f9b",
        "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
        "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
        "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
        "description": "My first transaction using Midaz!",
        "type": "DEBIT",
        "assetCode": "BRL",
        "chartOfAccounts": "pix_out_debit_fee",
        "amount": {
          "amount": 1,
          "scale": 2
        },
        "balance": {
          "available": 400,
          "onHold": 0,
          "scale": 2
        },
        "balanceAfter": {
          "available": 399,
          "onHold": 0,
          "scale": 2
        },
        "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
        "accountAlias": "@johndoe",
        "portfolioId": "faa1d4c8-4bdc-4163-9ebc-9814cb2daa6d",
        "metadata": {
          "anyKey": "anyValue",
          "anotherKey": "anotherValue"
        },
        "createdAt": "2024-01-29T00:12:00+0300",
        "updatedAt": "2024-01-29T00:12:00+0300"
      },
      {
        "id": "d4cd4bee-9097-4f07-a8a4-144ee5eee4db",
        "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
        "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
        "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
        "description": "My first transaction using Midaz!",
        "type": "CREDIT",
        "assetCode": "BRL",
        "chartOfAccounts": "pix_out_credit_fee",
        "amount": {
          "amount": 1,
          "scale": 2
        },
        "balance": {
          "available": 0,
          "onHold": 0,
          "scale": 2
        },
        "balanceAfter": {
          "available": 1,
          "onHold": 0,
          "scale": 2
        },
        "accountId": "e9de9228-7509-49a5-9ef7-3b4b64293bb2",
        "accountAlias": "@fees/PIX_OUT",
        "portfolioId": "965eab51-caae-4172-a01c-24344fa8b1f8",
        "metadata": {
          "anyKey": "anyValue",
          "anotherKey": "anotherValue"
        },
        "createdAt": "2024-01-29T00:12:00+0300",
        "updatedAt": "2024-01-29T00:12:00+0300"
      },
      {
        "id": "f4f22017-9fca-4742-a0f3-a7607017428f",
        "transactionId": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
        "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
        "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
        "description": "My first transaction using Midaz!",
        "type": "CREDIT",
        "assetCode": "BRL",
        "chartOfAccounts": "pix_out_credit_amount",
        "amount": {
          "amount": 100,
          "scale": 2
        },
        "balance": {
          "available": 0,
          "onHold": 0,
          "scale": 2
        },
        "balanceAfter": {
          "available": 100,
          "onHold": 0,
          "scale": 2
        },
        "accountId": "ab7e7eee-92fc-4f82-82ff-71efa1a9a7ac",
        "accountAlias": "@external/BRL",
        "portfolioId": "a03d22a4-5afc-4b6f-86f4-ba341b34b152",
        "metadata": {
          "anyKey": "anyValue",
          "anotherKey": "anotherValue"
        },
        "createdAt": "2024-01-29T00:12:00+0300",
        "updatedAt": "2024-01-29T00:12:00+0300"
      }
    ],
    "createdAt": "2024-01-29T00:12:00+0300",
    "updatedAt": "2024-01-29T00:12:00+0300"
  },
  {
    "id": "e5d63d15-29b4-4dcd-8362-6da08f128ba4",
    "parentTransactionId": null,
    "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
    "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
    "description": "My second transaction!",
    "type": "BILL_PAYMENT",
    "status": "CREATED",
    "amount": {
      "amount": 250,
      "scale": 1
    },
    "assetCode": "USD",
    "chartOfAccountsGroupName": "BILL_PAYMENTS_US",
    "source": "@peter",
    "destination": "6dfea811-7273-4ba8-9f5a-642cb2b51c85, fc770f44-5809-4562-b3e6-87a47b2b09ff",