Skip to main content

Discount

The discount instruction is used to apply discounts with various calculation rule possibilities. If discounts already exist for the bank slip in question, and a discount instruction is accepted, the previously existing discounts will be overwritten.

Attention!

If there is any pending discount addition request awaiting confirmation, creating a new request is not allowed.

Request

ENDPOINT
/account/ACCOUNT_KEY/requester_profile/REQUESTER_PROFILE_KEY/bank_slip/BANK_SLIP_KEY/discount
METHOD
POST

Path parameters

FieldTypeDescriptionCharacters
account_keyuuidv4Unique account identification key, in uuid v4 format36
requester_profile_keyuuidv4Unique wallet identification key, in uuid v4 format36
bank_slip_keyuuidv4Unique bank slip identification key, in uuid v4 format36
Request Body
{
"request_control_key": "2e2f0053-a988-40c7-ad17-41c4c4da861e",
"discounts_data": [
{
"discount_type": "anticipation_workdays_daily_percentage",
"discount_percentage": 2,
"discount_number": 1,
"discount_limit_date": "2024-12-01"
},
{
"discount_type": "anticipation_workdays_daily_percentage",
"discount_percentage": 1,
"discount_number": 2,
"discount_limit_date": "2025-01-02"
}
]
}

Request Body Params

FieldTypeDescriptionCharacters
request_control_key *uuidv4Unique request identification key used by the client in uuid v4 format36
discounts_dataobject arrayDiscountsdiscount object

discount object

Option 1: discounts using absolute values (discount_type in ["absolute", "anticipation_calendar_days_daily_amount", "anticipation_workdays_daily_amount"])
FieldTypeDescriptionCharacters
discount_amount *floatAbsolute discount value per time unit-
discount_number *integerDiscount number-
discount_type *stringDiscount configuration in absolute valuesdiscount_type enumerator
discount_limit_date *stringDiscount application limit date10
Option 2: discounts using percentage values (discount_type in ["percentage", "anticipation_calendar_days_daily_percentage", "anticipation_workdays_daily_percentage"])
FieldTypeDescriptionCharacters
discount_percentage *floatPercentage discount value per time unit-
discount_number *integerDiscount number-
discount_type *stringDiscount configuration in percentage valuesdiscount_type enumerator
discount_limit_date *stringDiscount application limit date10
Attention!

The bank slip can have up to three discounts, and all discounts must be of the same type, that is, they must have the same discount_type. Discounts must be numbered from 1 to 3, in ascending order and necessarily starting at 1. That is, if two discounts are sent in the request, they must necessarily be numbered 1 and 2.

discount_type enumerators

EnumeratorDescription
absoluteFixed value
anticipation_calendar_days_daily_amountDaily anticipation discount amount, over calendar days
anticipation_workdays_daily_amountDaily anticipation discount amount, over business days
percentageFixed percentage
anticipation_calendar_days_daily_percentageMonthly anticipation discount percentage, based on calendar days
anticipation_workdays_daily_percentageAnnual anticipation discount percentage, based on business days

Response

STATUS
202
Response Body
{
"occurrence_key": "aaf64135-6bd8-4d49-be6f-e8f884b20ee7",
"bank_slip_key": "470cfcae-159b-4de4-ad22-2d3b2dd717f7"
}

Response Body Params

FieldTypeDescriptionCharacters
occurrence_key *uuidv4Unique occurrence (instruction) identification key in uuid v4 format36
bank_slip_key *uuidv4Unique bank slip identification key in uuid v4 format36

Error Response

STATUS
4xx
Response Body: Error
{
"title": "titulo",
"description": "description in English",
"translation": "descrição em portugues",
"code": "codigo",
"extra_fields": {}
}
HTTP Code
status
QI Code
code
Title
title
Description (eng)
description
Description (pt-br)
translation
400QIT000001Bad RequestSchema ErrorSchema Inválido
404BKS000006Not FoundThe source account key was not found.A chave da conta de origem não foi encontrada.
400BKS000007Bad RequestIt was not possible to consult the source account at this time. Please try again in a few minutes.Não foi possível consultar a conta de origem neste momento. Por favor, tente novamente em alguns minutos.
400BKS000008Bad RequestThe source account is closed.A conta de origem está fechada.
400BKS000009Bad RequestThe source account is blocked.A conta de origem está bloqueada.
404BKS000013Not FoundRequester profile not foundCarteira não encontrada
409BKS000014ConflictRequest control key already sent or duplicated sent: <request_control_key>Chave de controle da requisição já utilizada ou enviada duplicada: <request_control_key>
400BKS000018Bad RequestThe discount dates must be less than the expiration date and increasing.A data dos descontos devem ser menores que a de expiração e crescentes.
400BKS000022Bad RequestRequester profile is not opened.Carteira não está aberta.
404BKS000029Not FoundBank slip not found for the given key ({bank_slip_key}).Boleto não encontrado para a chave fornecida ({bank_slip_key}).
400BKS000032Bad RequestBank slip must be in 'registered' status.O boleto deve possuir o status 'registered'.
400BKS000043Bad RequestInvalid discount numbering. Discounts must be numbered in ascending order and start on 1.Numeração dos descontos inválida. Os descontos devem ser numerados em ordem crescente e começar em 1.
400BKS000046Bad RequestInvalid discount type. All types in the discount list must be the same.Tipo de desconto inválido. Todos os tipos da lista de descontos devem ser iguais.
409BKS000048ConflictThere is already a pending discount occurrence for this bank slip. Please, wait for the confirmation of this occurrence before sending another one.Já existe uma ocorrência de desconto pendente para este boleto. Por favor, aguarde a confirmação dessa ocorrência antes de enviar outra.