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

NameValue

Content-Type

application/octet-stream

Authorization

Bearer <token>

Request body
(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


Retrieve all transaction templates

GET /v1/organizations/{{id}}/ledgers/{{id}}/transaction-templates

Use this endpoint to retrieve the information of all transaction templates.

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Query parameters

NameTypeDescription

chart-of-accounts-group-name

code

metadata

status

Response codes

(
  (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

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Response codes

(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)
    )
  )
)

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

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Request body
(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

(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)
      )    
    )
  )
)

Delete a transaction template

DELETE /v1/organizations/{{id}}/ledgers/{{id}}/transaction-templates/{{code}}

Use this endpoint to deactivate a specific transaction template.

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Response codes

Last updated