Sale Rule
)
As regras de recebíveis devem ser acessadas de maneira aninhada a conta de recebível (SaleAccount) à qual pertence.
- sale_account_id | integer | Identificador da conta de recebível a qual a regra pertence
A regra só será aplicada para os Recebíveis que também pertencem a esta conta.
Campo obrigatório
- issuer | string | Bandeira (consultar lista no menu lateral)
Campo obrigatório
- payment_method | string | Forma de pagamento
Verificar a Conta de Recebível para valores válidos
Campo obrigatório
- fee_percentage | decimal | Tarifa percentual (%) aplicada sobre cada recebível
- fixed_fee_amount | decimal | Tarifa fixa (R$) aplicada sobre cada recebível
- minimum_fee_amount | decimal | Tarifa mínima (R$) que deve ser aplicada sobre cada recebível
- days_to_liquidation | integer | Quantidade de dias até o recebimento do valor dos recebíveis
- apply_rules | integer | Atributo que indica se a regra será aplicada em recebíveis já existentes.
Enviar 0 para falso, 1 para verdadeiro
Só é necessário durante a edição de uma regra. Será sempre 1 durante a criação
- weekdays | string | Dias da semana no qual será realizado o recebimento do valor dos recebíveis.
O dia deve ser um número, de acordo com a relação abaixo.
Para inserir mais de um, separe-os com vírgulas e sem espaço.
Ex.: Segunda, Quarta e Sexta ficaria: "1,3,5"
0 - Domingo
1 - Segunda
2 - Terça
3 - Quarta
4 - Quinta
5 - Sexta
6 - Sábado
GET /sale_accounts/:sale_account_id/rules
Exibe os atributos da regra de recebível especificada, retornando 200 Ok.
HTTP/1.1 200 OK
Date: Mon, 17 Jan 2011 20:00:02 GMT
Content-Type: application/json; charset=utf-8
[
{
"sale_rule": {
"created_at": "2017-04-04T16:20:18-03:00",
"days_to_liquidation": 0,
"fee_percentage": 10,
"fixed_fee_amount": "1.91",
"minimum_fee_amount": "0.4",
"id": 2,
"issuer": "American Express",
"payment_method": "cash",
"sale_account_id": 3,
"updated_at": "2017-04-26T15:22:18-03:00",
"weekdays": null
}
},
]
HTTP/1.1 200 OK
Date: Mon, 17 Jan 2011 20:00:02 GMT
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<sale-rules type="array">
<sale-rule>
<created-at type="dateTime">2017-04-04T16:20:18-03:00</created-at>
<days-to-liquidation type="integer">0</days-to-liquidation>
<fee-percentage type="integer">10</fee-percentage>
<fixed-fee-amount type="decimal">1.91</fixed-fee-amount>
<minimum-fee-amount type="decimal">0.4</minimum-fee-amount>
<id type="integer">2</id>
<issuer>American Express</issuer>
<payment-method>cash</payment-method>
<sale-account-id type="integer">3</sale-account-id>
<updated-at type="dateTime">2017-04-26T15:22:18-03:00</updated-at>
<week-day type="integer"></week-day>
</sale-rule>
</sale-rules>
GET /sale_accounts/:sale_account_id/rules/:id
Exibe os atributos da regra de recebível especificada retornando 200 Ok.
HTTP/1.1 200 OK
Date: Mon, 17 Jan 2011 20:29:57 GMT
Content-Type: application/json; charset=utf-8
Location: https://financeiro.fintera.com.br/entities/67/sales/2
{ "sale_rule": { "created_at": "2017-04-04T16:20:18-03:00", "days_to_liquidation": 0, "fee_percentage": 10, "fixed_fee_amount": "1.91", "minimum_fee_amount": "0.4", "id": 2, "issuer": "American Express", "payment_method": "cash", "sale_account_id": 3, "updated_at": "2017-04-26T15:22:18-03:00", "weekdays": null } }
HTTP/1.1 200 OK
Date: Mon, 17 Jan 2011 20:29:57 GMT
Content-Type: application/xml; charset=utf-8
Location: https://financeiro.fintera.com.br/entities/67/sales/2
<sale-rule> <created-at type="dateTime">2017-04-04T16:20:18-03:00</created-at> <days-to-liquidation type="integer">0</days-to-liquidation> <fee-percentage type="integer">10</fee-percentage> <fixed-fee-amount type="decimal">1.91</fixed-fee-amount> <minimum-fee-amount type="decimal">0.4</minimum-fee-amount> <id type="integer">2</id> <issuer>American Express</issuer> <payment-method>cash</payment-method> <sale-account-id type="integer">3</sale-account-id> <updated-at type="dateTime">2017-04-26T15:22:18-03:00</updated-at> <week-day type="integer"></week-day> </sale-rule>
POST /sale_accounts/:sale_account_id/rules
Cria uma nova regra de recebível do tipo especificado.
HTTP/1.1 201 Created
Date: Mon, 17 Jan 2011 20:29:57 GMT
Content-Type: application/json; charset=utf-8
Location: https://financeiro.fintera.com.br/entities/67/sales/2
{ "sale_rule": { "days_to_liquidation": 30, "fee_percentage": 10, "fixed_fee_amount": "1.91", "minimum_fee_amount": "0.4", "issuer": "American Express", "payment_method": "cash", "sale_account_id": 3, "weekdays": "4" } }
HTTP/1.1 201 Created
Date: Mon, 17 Jan 2011 20:29:57 GMT
Content-Type: application/xml; charset=utf-8
Location: https://financeiro.fintera.com.br/entities/67/sales/2
<sale-rule> <days-to-liquidation type="integer">30</days-to-liquidation> <fee-percentage type="integer">10</fee-percentage> <fixed-fee-amount type="decimal">1.91</fixed-fee-amount> <minimum-fee-amount type="decimal">0.4</minimum-fee-amount> <issuer>American Express</issuer> <payment-method>cash</payment-method> <sale-account-id type="integer">3</sale-account-id> <week-day type="integer">4</week-day> </sale-rule>
PUT /sale_accounts/:sale_account_id/rules/:id
Altera os dados da regra de recebível especificada. Retorna uma resposta vazia com status 200 OK.
Em caso de erro, retorna os erros que impediram de alterar o recurso.
{ "sale_rule": { "days_to_liquidation": 30, "fee_percentage": 10, "fixed_fee_amount": "1.91", "minimum_fee_amount": "0.4", "id": 2, "issuer": "American Express", "payment_method": "cash", "sale_account_id": 3, "weekdays": "4" } }
<sale-rule> <days-to-liquidation type="integer">30</days-to-liquidation> <fee-percentage type="integer">10</fee-percentage> <fixed-fee-amount type="decimal">1.91</fixed-fee-amount> <minimum-fee-amount type="decimal">0.4</minimum-fee-amount> <id type="integer">2</id> <issuer>American Express</issuer> <payment-method>cash</payment-method> <sale-account-id type="integer">3</sale-account-id> <week-day type="integer">4</week-day> </sale-rule>
DELETE /sale_accounts/:sale_account_id/rules/:id
Apaga a regra de recebível especificada.