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 |
|
tolerance |
|
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"
}
{
"code": "0018",
"title": "Insufficient Funds",
"description": "The transaction could not be completed due to insufficient funds in the account. Please add funds to your account and try again."
}
Create a Pre-transaction
POST
/v1/organizations/{{id}}/ledgers/{{id}}/transactions
Use this endpoint to create a transaction pending statement.
Headers
Name | |
---|---|
idempotencyKey |
|
tolerance |
|
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"
}
{
"code": "0025",
"title": "Insuficient balance",
"detail": "The account {{accountId}} has insuficiente balance. Try again sending the amount minor or equal to the available balance."
}
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 |
|
tolerance |
|
{
"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"
}
{
"code": "0017",
"title": "Transaction already with a final status",
"description": "The transaction has been SENT or DECLINED already. Check if you are sending the right ID and try again."
}
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 |
|
tolerance |
|
{
"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"
}
{
"code": "0017",
"title": "Transaction already with a final status",
"description": "The transaction has been SENT or DECLINED already. Check if you are sending the right ID and try again."
}
Retrieve all Transactions
GET
/v1/organizations/{{id}}/ledgers/{{id}}/transactions
Use this endpoint to retrieve the information of all transactions.
Headers
Name | Value |
---|---|
Authorization |
|
Query parameters
Name | Type | Description |
---|---|---|
| ||
| ||
| ||
| ||
| ||
| ||
|
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",
"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",
"assetCode": "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": "@johndoe",
"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",
"assetCode": "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
Name | Value |
---|---|
Authorization |
|
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"
}
{
"code": "0007",
"title": "Entity not found",
"description": "Entity not found for the ID informed. Check if you are sending the correct ID for the entity that you are managing."
}
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
Headers
Name | Value |
---|---|
Content-Type |
|
Authorization |
|
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
},
"assetCode": "BRL",
"chartOfAccountsGroupName": "PIX_OUT",
"source": [
"@johndoe"
],
"destination": [
"@fees/pix",
"@external/BRL"
],
"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",
"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"
}
{
"code": "0017",
"title": "Invalid Script Error",
"description": "The script provided in the request is invalid or in an unsupported format. Please verify the script and try again."
}
Last updated