Transactions templates API Use the Transactionas templates API to create transactions models
Create a transaction template
POST
/v1/organizations/{{id}}/ledgers/{{id}}/transaction-templates
Use this endpoint to create a template for transactions.
Headers
Request body
Copy (transaction-template v1
(chart-of-accounts-group-name PIX_OUT)
(metadata
(anyKey anyValue)
(anotherKey anotherValue)
)
(code PIX_OUT)
(description "description for the transaction not for the operation")
(pending true)
(send BRL $amount+$fee|2
(source
(from $sourceAccount :amount BRL $amount|2
(description "Envio de PIX")
(chart-of-accounts pix_out_debit_82891231)
)
(from $sourceAccount :amount BRL $fee|2
(description "Tarifa envio PIX")
(chart-of-accounts pix_out_fee_debit)
)
)
)
(distribute
(to @fees/PIX_OUT :amount BRL $fee|2
(description "Fee from $sourceAccount")
(chart-of-accounts pix_out_fee_credit)
)
(distribute :remaining
(to @external/BRL :remaining
(chart-of-accounts pix_out_external)
)
)
)
)
Response codes
201 409
Copy {
"code" : "0027" ,
"title" : "transaction template code already in use" ,
"description": "There is already a transaction template with the code {{code}} for your ledger. Try again informing another code."
}
Retrieve all transaction templates
GET
/v1/organizations/{{id}}/ledgers/{{id}}/transaction-templates
Use this endpoint to retrieve the information of all transaction templates.
Headers
Query parameters
Name Type Description chart-of-accounts-group-name
Response codes
200
Copy (
(transaction-template v1
(chart-of-accounts-group-name PIX_OUT)
(metadata
(anyKey anyValue)
(anotherKey anotherValue)
)
(code PIX_OUT)
(description "description for the transaction not for the operation")
(send BRL $amount+$fee|2
(source
(from $sourceAccount :amount BRL $amount|2
(description "Envio de PIX")
(chart-of-accounts pix_out_debit_82891231)
)
(from $sourceAccount :amount BRL $fee|2
(description "Tarifa envio PIX")
(chart-of-accounts pix_out_fee_debit)
)
)
)
(distribute
(to @fees/PIX_OUT :amount BRL $fee|2
(chart-of-accounts pix_out_fee_credit)
)
(distribute :remaining
(to @external/BRL :remaining
(chart-of-accounts pix_out_external)
)
)
)
),
(transaction-template v1
(chart-of-accounts-group-name p2p_transfer_group)
(metadata
(anyKey anyValue)
(anotherKey anotherValue)
)
(code P2P_TRANSFER)
(description "P2P sent")
(pending false)
(send BRL $amount+$fee|2
(source
(from $sourceAccount :amount BRL $amount|2
(description "P2P sent to $destination")
(chart-of-accounts p2p_debit_source_8123891)
)
)
)
(distribute
(to @bucket/p2p :amount BRL $amount|2
(chart-of-accounts p2p_credit_bucket_998239)
)
)
)
)
Retrieve a transaction template by code
GET
/v1/organizations/{{id}}/ledgers/{{id}}/transaction-types/{{code}}
Use this endpoint to retrieve the information of a specific transaction template by using its identifier (code
).
Headers
Response codes
200 404
Copy (transaction-template v1
(chart-of-accounts-group-name p2p_transfer_group)
(metadata
(anyKey anyValue)
(anotherKey anotherValue)
)
(code P2P_TRANSFER)
(description "P2P sent")
(pending false)
(send BRL $amount+$fee|2
(source
(from $sourceAccount :amount BRL $amount|2
(description "P2P sent to $destination")
(chart-of-accounts p2p_debit_source_8123891)
)
)
)
(distribute
(to @bucket/p2p :amount BRL $amount|2
(chart-of-accounts p2p_credit_bucket_998239)
)
)
)
Copy {
"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 template
PUT
/v1/organizations/{{id}}/ledgers/{{id}}/transaction-templates/{{code}}
Use this endpoint to edit and update the information of a specific transaction template.
Headers
Request body
Copy (transaction-template v1
(chart-of-accounts-group-name PIX_OUT)
(metadata
(anyKey anyValue)
(anotherKey anotherValue)
)
(code PIX_OUT)
(description "description for the transaction not for the operation")
(send BRL $amount+$fee|2
(source
(from $sourceAccount :amount BRL $amount|2
(description "Envio de PIX")
(chart-of-accounts pix_out_debit_82891231)
)
(from $sourceAccount :amount BRL $fee|2
(description "Tarifa envio PIX")
(chart-of-accounts pix_out_fee_debit)
)
)
)
(distribute
(to @fees/PIX_OUT :amount BRL $fee|2
(chart-of-accounts pix_out_fee_credit)
)
(distribute :remaining
(to @external/BRL :remaining
(chart-of-accounts pix_out_external)
)
)
)
)
Response codes
200 404
Copy (transaction-template v1
(chart-of-accounts-group-name PIX_OUT)
(metadata
(anyKey anyValue)
(anotherKey anotherValue)
)
(code PIX_OUT)
(description "description for the transaction not for the operation")
(send BRL $amount+$fee|2
(source
(from $sourceAccount :amount BRL $amount|2
(description "Envio de PIX")
(chart-of-accounts pix_out_debit_82891231)
)
(from $sourceAccount :amount BRL $fee|2
(description "Tarifa envio PIX")
(chart-of-accounts pix_out_fee_debit)
)
)
)
(distribute
(to @fees/PIX_OUT :amount BRL $fee|2
(chart-of-accounts pix_out_fee_credit)
)
(distribute :remaining
(to @external/BRL :remaining
(chart-of-accounts pix_out_external)
)
)
)
)
Copy {
"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."
}
Delete a transaction template
DELETE
/v1/organizations/{{id}}/ledgers/{{id}}/transaction-templates/{{code}}
Use this endpoint to deactivate a specific transaction template.
Headers
Response codes
204 400 404
Copy {
"code" : "0013" ,
"title" : "Entity has been already removed" ,
"description": "You are trying to delete a resource has been deleted already. Check if you are sending the correct ID and try again."
}
Copy {
"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."
}
Last updated 6 months ago