Ledgera
ledgera.io
  • Introduction
  • Documentation Structure
  • CORE
    • Currencies
    • Balances
      • Balance Creation
      • Balance Query
      • Bulk Balance Query
      • Balance Statements Query
    • Transactions
      • Transaction Creation
      • Transaction Query
      • Entries
  • SETUP
    • Account Rules
    • Chart of Accounts
    • Execution Rules
    • Authorization Rules
    • Billing Plan
      • Custom Entries
  • REGISTER
    • Accounts
      • Account Creation
      • Account Updates
      • Account Query
        • Account Balance Query
        • Account Bulk Balance Query
        • Account Statements Query
  • OPERATION
    • Execution
    • Authorization / Confirmation
    • Split
    • Balance Sheet
  • REPORT
    • Request a report
    • Report Query
  • MULTI-TENANCY
    • Tenant Query
Powered by GitBook
On this page
  1. SETUP

Billing Plan

Last updated 1 year ago

Was this helpful?

CtrlK
  • Create a Billing Plan
  • Update a Billing Plan
  • Billing Plan List Query
  • Billing Plan Details Query

Was this helpful?

Billing Plans are packages that can be freely created by the user and associated with accounts for use online during a transaction. With the application of billing plans, the user simply carries out transactions by entering their main values ​​and the system consults and automatically calculates the other fees or discounts indicated for the main account involved.

The user can freely create a name for each billing plan and must include the types of transactions and their corresponding entry types, informing the value to be applied in the form of amount or percentage. Once created, a billing plan cannot be deleted from the system.

Warning: the system will apply the fee indicated in the billing plan only if the transaction type and entry type match the rules determined in the correct endpoint (authorization_rules or execution_rules)

A billing plan also receives the standard decimal characters size used in its values.

Create a Billing Plan

The POST /billing_plan method is used to create a billing plan. The user must specify the name of the Billing Plan to be created, a list of transaction types, each containing a list of entry types with amount type (value or percentage) and amount to be charged.

Example of creating a billing plan:

Response exemple:

Update a Billing Plan

The PUT /billing_plan method is used to update an existing billing plan.

Example of updating a billing plan:

Billing Plan List Query

The GET /billing_plan method is used to query the list of billing plans.

Query example:

Example response:

Billing Plan Details Query

The GET /billing_plan method is used to query the details of a specific billing plan.

Query example:

Example response:

{
  "id": "fe38153f-36ed-42fb-a879-c46ea92b7ebc"
}
PUT /billing_plan/fe38153f-36ed-42fb-a879-c46ea92b7ebc

{
  "name": "standard_1",
  "decimals": 2,
  "transaction_types": [
    {
      "transaction_type": "pix_out",
      "entry_types": [
        {
          "entry_type": "pix_out_fee",
          "amount_type": "value",
          "amount": 500
        }
      ]
    }  
  ]
}
GET /billing_plan
{
  "data": [
    {
      "id": "fe38153f-36ed-42fb-a879-c46ea92b7ebc",
      "name": "standard_1"
    }
  ]
}
GET /billing_plan/fe38153f-36ed-42fb-a879-c46ea92b7ebc
{
  "name": "standard_1",
  "decimals": 2,
  "transaction_types": [
    {
      "transaction_type": "pix_out",
      "entry_types": [
        {
          "entry_type": "pix_out_fee",
          "amount_type": "value",
          "amount": 500
        }
      ]
    }  
  ]
}
POST /billing_plan

{
  "name": "standard_1",
  "decimals": 2,
  "transaction_types": [
    {
      "transaction_type": "pix_out",
      
"entry_types"
:
[
{
"entry_type": "pix_out_fee",
"amount_type": "value",
"amount": 250
}
]
}
]
}