Billing Plan

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:

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
        }
      ]
    }  
  ]
}

Response exemple:

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

Update a Billing Plan

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

Example of updating a billing plan:

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
        }
      ]
    }  
  ]
}

Billing Plan List Query

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

Query example:

GET /billing_plan

Example response:

{
  "data": [
    {
      "id": "fe38153f-36ed-42fb-a879-c46ea92b7ebc",
      "name": "standard_1"
    }
  ]
}

Billing Plan Details Query

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

Query example:

GET /billing_plan/fe38153f-36ed-42fb-a879-c46ea92b7ebc

Example response:

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

Last updated