Criar QRCode Dinâmico com Validade
Através desse endpoint será possível criar cobranças Pix com vencimento através de um QRCode ou Pix copia e cola.
POST https://sandbox-api.openbank.stone.com.br/api/v1/pix_payment_invoices_with_due_date
HEADERS
authorization* string
Bearer token de autenticação.
x-stone-idempotency-key* string
Chave de idempotência.
BODY PARAMS
account_id* string
Identificador da conta que irá receber o valor pago.
additional_data object
name string
Tamanho: min 1 / max 50
value string
Tamanho: min 1 / max 200
amount integer
customer* object
document string
name string
discount object
type string
Valores aceitos: fixed
, proportional
calculation_mode string
Valores aceitos: date
, period
period_discount object
fixed_value integer
Se type:fixed.
proportional object
Se type:proportional. Representação de porcentagem, dada a seguinte fórmula: coefficient * 10^exponent
coefficient integer
exponent integer
expiration_date* string
Format: date
fine object
type string
Valores aceitos: fixed
, proportional
fixed_value integer
Se type:fixed.
proportional_value object
Se type:proportional. Representação de porcentagem, dada a seguinte fórmula: coefficient * 10^exponent
coefficient integer
exponent integer
interest object
type string
Valores aceitos: fixed
, proportional
period string
Valores aceitos: day
, month
, year
fixed_value integer
Se type:fixed.
proportional_value object
Se type:proportional. Representação de porcentagem, dada a seguinte fórmula: coefficient * 10^exponent
coefficient integer
exponent integer
key* string
only_business_days boolean
Aceia true or false para pagamento somente em dias úteis
payment_limit_period_days integer
Informa por quanto tempo o QRCode estará válido.
reduction object
type string
Valores aceitos: fixed
, proportional
fixed_value integer
Se type:fixed.
proportional_value object
Se type:proportional. Representação de porcentagem, dada a seguinte fórmula: coefficient * 10^exponent
coefficient integer
exponent integer
request_for_payer string
Descrição opcional do QRCode.
transaction_id* string
Validação: “^[a-zA-Z0-9]{26,35}$”
Exemplo:
{
"account_id": "{{account_id}}",
"additional_data": [{
"name": "Título",
"value": "Descrição"
}],
"amount": 15,
"customer": {
"document": "14423692724",
"document_type": "cpf",
"name": "John Doe"
},
"discount": {
"calculation_mode": "period",
"period_discount": {
"fixed_value": 60
},
"type": "fixed"
},
"expiration_date": "2021-06-15",
"fine": {
"fixed_value": 100,
"type": "fixed"
},
"interest": {
"fixed_value": 50,
"period": "day",
"type": "fixed"
},
"key": "4e4bb64d-d17c-4c53-a51b-44f06e28be06",
"only_business_days": false,
"payment_limit_period_days": 15,
"reduction": {
"fixed_value": 100,
"type": "fixed"
},
"request_for_payer": "do something",
"transaction_id": "2b99dae0492c425c969e7768a91b2f3d"
}
Response
200 OK
{
"account_id": "477f8576-ca82-462b-be73-dc28cc6490c3",
"additional_data": [
{
"name": "Mr. Due",
"value": "Date"
}
],
"amount": 555,
"beneficiary_address": {
"city": "Rio de JaneiroA",
"country": "BRA",
"extra": "A",
"neighborhood": "FlamengoA",
"postal_code": "22250120",
"reference_point": null,
"state": "RJA",
"street": "Rua Honório de BarrosoA",
"street_number": "3A"
},
"beneficiary_entity": {
"document": "91092573062",
"document_type": "cpf",
"legal_name": "Gilderoy Lockhart",
"trade_name": null
},
"cancelled_at": null,
"created_at": "2021-03-19T14:43:55Z",
"created_by": "user:380f9968-8946-4f88-a781-be8b7efc1f90",
"customer": {
"document": "85553990335",
"document_type": "cpf",
"name": "Fulano da Silva"
},
"discount": null,
"expiration_date": "2021-03-19",
"fine": null,
"id": "b4bdc3df-795e-4d33-9851-15192fb7e216",
"inbound_pix_payments": [],
"interest": null,
"key": "4e4bb64d-d17c-4c53-a51b-44f06e28be06",
"key_type": "random_key",
"location": "pix-h.stone.com.br/pix/v2/cobv/b4bdc3df-795e-4d33-9851-15192fb7e216",
"only_business_days": false,
"paid_at": null,
"payment_limit_period_days": 30,
"qr_code_content": "00020101021226890014br.gov.bcb.pix2567pix-h.stone.com.br/pix/v2/cobv/b4bdc3df-795e-4d33-9851-15192fb7e21652040000530398654045.555802BR5925Nome do CPF 581.360.533-96014RIO DE JANEIRO622905253f6a429254c34b3091847f85d63046EBC",
"qr_code_image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAH4CAIAAAApSmgoAAA590lEQVR4nO2bMaIjSbIj//0vvauMGvWIpFnDPRlQyxswIB5Tmvm//3d1dXV19Wr9Xxvg6urq6srV/dBfXV1dvVz3Q391dXX1ct0P/dXV1dXLdT/0V1dXVy/X/dBfXV1dvVz3Q391dXX1ch0/9P+3RCk/dW/vluZSPHYvKpfawfb5dpennFSvaTyUT+qf+rR05H9tMfne3i3NpXjsXlQutYPt8+0uTzmpXtN4KJ/UP/Vp6cj/2mLyvb1bmkvx2L2oXGoH2+fbXZ5yUr2m8VA+qX/q09KR/7XF5Ht7tzSX4rF7UbnUDrbPt7s85aR6TeOhfFL/1KelI/9ri8n39m5pLsVj96JyqR1sn293ecpJ9ZrGQ/mk/qlPS0f+1xaT7+3d0lyKx+5F5VI72D7f7vKUk+o1jYfySf1Tn5aO/K8tJt/bu6W5FI/di8qldrB9vt3lKSfVaxoP5ZP6pz4tHflfW0y+t3dLcykeuxeVS+1g+3y7y1NOqtc0Hson9U99Wjry20NTiotRAw0Ttc",
"reduction": null,
"request_for_payer": "do something until today",
"request_id": "f06fe0c17b96d26965b069c73b77153c",
"status": "ACTIVE",
"transaction_id": "3f6a429254c34b3091847f85da88eb65",
"updated_at": "2021-03-19T14:43:55Z"
}
400 Bad Request
{
"reason": [
{
"error": "is invalid",
"path": [
"key_type"
]
},
{
"error": "is invalid",
"path": [
"status"
]
}
],
"type": "srn:error:validation"
}
401 Unauthorized
{
"type": "srn:error:unauthorized"
}
403 Forbidden
{
"type": "srn:error:unauthenticated"
}
409 Conflict
{
"type": "srn:error:idempotency_conflict"
}
422 Unprocessable
{
"reason": [
{
"error": "has already been taken",
"path": [
"transaction_id"
]
}
],
"type": "srn:error:unprocessable_entity"
}