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

NameValue

idempotencyKey

application/json

tolerance

Bearer <token>

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

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
  },
  "instrumentCode": "BRL",
  "chartOfAccountsGroupName": "PIX_OUT_981723817381929172381",
  "source": [
    "@gabriel"
  ],
  "destination": [
    "@fees/pix",
    "@external/BRL"
  ],
  "inheritMetadata": true,
  "inheritDescription": true,
  "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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",
      "instrumentCode": "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": "@gabriel",
    "fee": 1
  },
  "metadata": {
    "anyKey": "anyValue",
    "anotherKey": "anotherValue"
  },
  "parentTransactionId": null,
  "description": "My first transaction using Midaz!",
  "inheritMetadata": false,
  "inheritDescription": false
}

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
  },
  "instrumentCode": "BRL",
  "chartOfAccountsGroupName": "PIX_OUT",
  "source": [
    "@gabriel"
  ],
  "destination": [
    "@fees/pix",
    "@external/BRL"
  ],
  "inheritMetadata": true,
  "inheritDescription": true,
  "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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",
      "instrumentCode": "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

NameValue

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
  },
  "instrumentCode": "BRL",
  "chartOfAccountsGroupName": "PIX_OUT",
  "source": [
    "@gabriel"
  ],
  "destination": [
    "@fees/pix",
    "@external/BRL"
  ],
  "inheritMetadata": true,
  "inheritDescription": true,
  "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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",
      "instrumentCode": "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
  },
  "instrumentCode": "BRL",
  "chartOfAccountsGroupName": "PIX_OUT",
  "source": [
    "@fees/pix",
    "@external/BRL"
  ],
  "destination": [
    "@gabriel"
  ],
  "inheritMetadata": true,
  "inheritDescription": true,
  "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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",
      "instrumentCode": "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

NameValue

Authorization

Bearer <token>

Query parameters

NameTypeDescription

beginDate

endDate

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

instrumentCode

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
    },
    "instrumentCode": "BRL",
    "chartOfAccountsGroupName": "PIX_OUT",
    "source": [
      "@gabriel"
    ],
    "destination": [
      "@fees/pix",
      "@external/BRL"
    ],
    "inheritMetadata": true,
    "inheritDescription": true,
    "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",
        "instrumentCode": "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": "@gabriel",
        "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",
        "instrumentCode": "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": "@gabriel",
        "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",
        "instrumentCode": "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",
        "instrumentCode": "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
    },
    "instrumentCode": "USD",
    "chartOfAccountsGroupName": "BILL_PAYMENTS_US",
    "source": "@peter",
    "destination": "6dfea811-7273-4ba8-9f5a-642cb2b51c85, fc770f44-5809-4562-b3e6-87a47b2b09ff",
    "metadata": {
      "barcode": "12345667784243242432423432423413123123123"
    },
    "operations": [
      {
        "id": "db88408f-88fd-4d38-bda4-4e99d33449aa",
        "transactionId": "e5d63d15-29b4-4dcd-8362-6da08f128ba4",
        "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
        "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
        "description": "My second transaction!",
        "type": "DEBIT",
        "instrumentCode": "USD",
        "chartOfAccounts": "BILL_PAYMENT_DEBIT_AMOUNT",
        "amount": {
          "amount": 250,
          "scale": 1
        },
        "balance": {
          "available": 300,
          "onHold": 0,
          "scale": 1
        },
        "balanceAfter": {
          "available": 50,
          "onHold": 0,
          "scale": 1
        },
        "accountId": "232e1327-d9fd-45e5-bd12-b4cc0b8a322b",
        "accountAlias": "@gabriel",
        "portfolioId": "7f0b27b5-c835-427c-9e12-e30961393a62",
        "metadata": {
          "barcode": "12345667784243242432423432423413123123123"
        },
        "createdAt": "2024-01-29T00:12:00+0300",
        "updatedAt": "2024-01-29T00:12:00+0300"
      },
      {
        "id": "f6ebcd0f-07d0-4eed-83ac-c0ae616b0fe4",
        "transactionId": "e5d63d15-29b4-4dcd-8362-6da08f128ba4",
        "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
        "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
        "description": "My second transaction!",
        "type": "CREDIT",
        "instrumentCode": "USD",
        "chartOfAccounts": "BILL_PAYMENT_CREDIT_AMOUNT",
        "amount": {
          "amount": 250,
          "scale": 1
        },
        "balance": {
          "available": 0,
          "onHold": 0,
          "scale": 1
        },
        "balanceAfter": {
          "available": 250,
          "onHold": 0,
          "scale": 1
        },
        "accountId": "e9de9228-7509-49a5-9ef7-3b4b64293bb2",
        "accountAlias": "@exteral/USD",
        "portfolioId": "2c833328-a6b1-48ef-9d75-1aaa93f59163",
        "metadata": {
          "barcode": "12345667784243242432423432423413123123123"
        },
        "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 a transaction by id

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

Use this endpoint to retrieve the information of a specific Transaction using the identifier (id).

Headers

NameValue

Authorization

Bearer <token>

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
  },
  "instrumentCode": "BRL",
  "chartOfAccountsGroupName": "PIX_OUT",
  "source": [
    "@gabriel"
  ],
  "destination": [
    "@fees/pix",
    "@external/BRL"
  ],
  "inheritMetadata": true,
  "inheritDescription": true,
  "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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",
      "instrumentCode": "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"
}

Update a Transaction

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

Use this endpoint to edit and update the information of a specific Transaction. When you update a Product, the following fields can be edited:

  • metadata

  • description

  • inheritMetadata

  • inheritDescription

In case of updating the transaction's description and/or metadata, considering that the transaction was created with inheritMetadata = true and inheritDescription = true, the operation's description and/or metadata must also be updated, but the opposite is not true.

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Request body
{
  "metadata": {
    "newField": "newValue"
  },
  "description": "RFC content",
  "inheritMetadata": true,
  "inheritDescription": false
}

Response codes

{
  "id": "20e19dab-ce0c-43d6-aee3-0333c42d8a8c",
  "ledgerId": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
  "organizationId": "5f3a4c55-8b28-4276-bed7-f7c8a4bb44e8",
  "parentTransactionId": null,
  "description": "RFC content",
  "type": "PIX_OUT",
  "status": "SENT",
  "amount": {
    "amount": 101,
    "scale": 2
  },
  "instrumentCode": "BRL",
  "chartOfAccountsGroupName": "PIX_OUT",
  "source": [
    "@gabriel"
  ],
  "destination": [
    "@fees/pix",
    "@external/BRL"
  ],
  "inheritMetadata": true,
  "inheritDescription": false,
  "metadata": {
    "newField": "newValue"
  },
  "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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": "@gabriel",
      "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",
      "instrumentCode": "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",
      "instrumentCode": "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"
}

Last updated