Batch charges
The following set of endpoints is responsible for managing batch charges.
Create batch of due charges
Endpoint used to create a batch of due charges (lotecobv) for mass processing.
Batch Characteristics:- Asynchronous processing: The batch is processed in the background
- Custom ID: Unique identifier provided by the PSP
- Multiple charges: Up to 1000 charges per batch
- Individual validation: Each charge is validated separately
- Batch status: Monitoring of the processing
- Efficiency: Processes multiple charges at once
- Performance: Reduces overhead from multiple individual requests
- Control: Centralized monitoring of processing
- Partial atomicity: Valid charges are created even if others fail
- 1. Submission: Batch is sent for processing
- 2. Validation: Each charge is validated individually
- 3. Processing: Valid charges are created
- 4. Result: Detailed status of each charge in the batch
- All validations applicable to individual charges
- Unique TxId within the batch and globally
- Complete required data for each charge
Processing is asynchronous. Use the query endpoint to check the status.
PUT /v1/lotecobv/:id
Requires authorization for the scope:
lotecobv.ind.readRequest
- Example
{
"customId": 123,
"description": "Lote de faturas de dezembro 2023",
"datedCharges": [
{
"txid": "fb2761260e054c7a94fb7b7b01",
"calendario": {
"dataDeVencimento": "2023-12-31",
"validadeAposVencimento": 30
},
"devedor": {
"nome": "João Silva Santos",
"cpf": "12345678901",
"logradouro": "Rua das Flores, 123",
"cidade": "São Paulo",
"uf": "SP",
"cep": "01234567"
},
"recebedor": {
"nome": "Empresa XYZ Ltda",
"cnpj": "98765432000123",
"logradouro": "Av. Paulista, 1000",
"cidade": "São Paulo",
"uf": "SP",
"cep": "01310100"
},
"valor": {
"original": "100.50"
},
"chave": "+5561988887777",
"solicitacaoPagador": "Fatura #001 do lote",
"infoAdicionais": [
{
"nome": "Lote",
"valor": "123"
}
]
},
{
"txid": "fb2761260e054c7a94fb7b7b02",
"calendario": {
"dataDeVencimento": "2023-12-31",
"validadeAposVencimento": 30
},
"devedor": {
"nome": "Maria Silva",
"cpf": "98765432100",
"logradouro": "Av. Brasil, 456",
"cidade": "Rio de Janeiro",
"uf": "RJ",
"cep": "20040020"
},
"recebedor": {
"nome": "Empresa XYZ Ltda",
"cnpj": "98765432000123",
"logradouro": "Av. Paulista, 1000",
"cidade": "São Paulo",
"uf": "SP",
"cep": "01310100"
},
"valor": {
"original": "250.00",
"juros": {
"modalidade": 2,
"valorPerc": "0.033"
},
"multa": {
"modalidade": 2,
"valorPerc": "2.00"
}
},
"chave": "[email protected]",
"solicitacaoPagador": "Fatura #002 do lote"
}
]
}
Responses
The responses below represent Success(202) from the consumption.
- 🟢 202
- 🔴 400
- 🔴 401
- 🔴 403
- 🔴 500
- 🔴 503
{
"loteCobvId": 123,
"status": "EM_PROCESSAMENTO",
"customId": 123,
"description": "Lote de faturas de dezembro 2023",
"quantidadeCobrancas": 2,
"criadoEm": "2023-10-15T14:30:00Z"
}
{
"correlationId": "a9f13566e19f5ca51329479a5bae60c5",
"error": {
"status": 400,
"title": "Bad Request",
"detail": "Lote contém cobranças inválidas"
},
"validationErrors": [
{
"txid": "fb2761260e054c7a94fb7b7b01",
"errors": [
"Data de vencimento deve ser no futuro",
"CPF inválido"
]
},
{
"txid": "fb2761260e054c7a94fb7b7b02",
"errors": [
"Endereço do devedor incompleto"
]
}
]
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "Unauthorized",
"detail": "Token de acesso inválido ou expirado",
"status": 401
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "Forbidden",
"detail": "Acesso negado",
"status": 403
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "InternalServerError",
"detail": "Erro interno do servidor",
"status": 500
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "ServiceUnavailable",
"detail": "Serviço temporariamente indisponível",
"status": 503
}
}
Get batch of due charges
Endpoint to retrieve detailed information of a specific batch and the processing status of its charges.
Use Cases:- Monitoring: Track the progress of processing
- Auditing: Verify successfully created charges
- Correction: Identify charges with errors for reprocessing
- Reconciliation: Validate that all charges were processed
GET /v1/lotecobv/:id
Requires authorization for the scope:
lotecobv.ind.readResponses
The responses below represent Success(200) and failures/errors from consumption.
- 🟢 200
- 🟢 200
- 🔴 400
- 🔴 401
- 🔴 403
- 🔴 500
- 🔴 503
// Batch processed successfully
{
"loteCobvId": 123,
"customId": 123,
"description": "Lote de faturas de dezembro 2023",
"status": "PROCESSADO",
"criadoEm": "2023-10-15T14:30:00Z",
"processadoEm": "2023-10-15T14:35:00Z",
"estatisticas": {
"total": 3,
"processadas": 3,
"criadas": 2,
"comErro": 1,
"pendentes": 0
},
"cobrancas": [
{
"txid": "fb2761260e054c7a94fb7b7b01",
"status": "CRIADA",
"criadaEm": "2023-10-15T14:32:00Z",
"cobranca": {
"txid": "fb2761260e054c7a94fb7b7b01",
"status": "ATIVA",
"valor": {
"original": "100.50"
},
"loc": {
"id": 789,
"location": "pix.example.com/qr/v2/cobv/fb2761260e054c7a94fb7b7b01"
}
}
},
{
"txid": "fb2761260e054c7a94fb7b7b02",
"status": "CRIADA",
"criadaEm": "2023-10-15T14:33:00Z",
"cobranca": {
"txid": "fb2761260e054c7a94fb7b7b02",
"status": "ATIVA",
"valor": {
"original": "250.00"
},
"loc": {
"id": 790,
"location": "pix.example.com/qr/v2/cobv/fb2761260e054c7a94fb7b7b02"
}
}
},
{
"txid": "fb2761260e054c7a94fb7b7b03",
"status": "ERRO",
"erro": {
"codigo": "INVALID_CPF",
"mensagem": "CPF informado é inválido",
"detalhes": [
"CPF deve conter 11 dígitos",
"CPF não pode estar em branco"
]
}
}
]
}
// Batch in processing
{
"loteCobvId": 124,
"customId": 124,
"description": "Lote de faturas de janeiro 2024",
"status": "EM_PROCESSAMENTO",
"criadoEm": "2023-10-15T15:00:00Z",
"estatisticas": {
"total": 50,
"processadas": 25,
"criadas": 23,
"comErro": 2,
"pendentes": 25
},
"cobrancas": [
{
"txid": "ac2761260e054c7a94fb7b7b01",
"status": "CRIADA",
"criadaEm": "2023-10-15T15:02:00Z",
"cobranca": {
"txid": "ac2761260e054c7a94fb7b7b01",
"status": "ATIVA",
"valor": {
"original": "150.00"
},
"loc": {
"id": 791,
"location": "pix.example.com/qr/v2/cobv/ac2761260e054c7a94fb7b7b01"
}
}
},
{
"txid": "ac2761260e054c7a94fb7b7b02",
"status": "ERRO",
"erro": {
"codigo": "INVALID_VENCIMENTO",
"mensagem": "Data de vencimento deve ser no futuro"
}
},
{
"txid": "ac2761260e054c7a94fb7b7b03",
"status": "PENDENTE"
}
]
}
{
"correlationId": "a9f13566e19f5ca51329479a5bae60c5",
"error": {
"status": 400,
"title": "Bad Request",
"detail": "ID do lote deve ser um número inteiro positivo"
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "Unauthorized",
"detail": "Token de acesso inválido ou expirado",
"status": 401
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "Forbidden",
"detail": "Acesso negado",
"status": 403
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "InternalServerError",
"detail": "Erro interno do servidor",
"status": 500
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "ServiceUnavailable",
"detail": "Serviço temporariamente indisponível",
"status": 503
}
}
Review specific charges in a batch
Endpoint used to review specific charges within a due-date charge batch.
PATCH /v1/lotecobv/:id
Requires authorization for the scope:
lotecobv.ind.readRequest
- Example
{
"customId": 123,
"description": "Lote de faturas de dezembro 2023",
"datedCharges": [
{
"txid": "fb2761260e054c7a94fb7b7b01",
"calendario": {
"dataDeVencimento": "2023-12-31",
"validadeAposVencimento": 30
},
"devedor": {
"nome": "João Silva Santos",
"cpf": "12345678901",
"logradouro": "Rua das Flores, 123",
"cidade": "São Paulo",
"uf": "SP",
"cep": "01234567"
},
"recebedor": {
"nome": "Empresa XYZ Ltda",
"cnpj": "98765432000123",
"logradouro": "Av. Paulista, 1000",
"cidade": "São Paulo",
"uf": "SP",
"cep": "01310100"
},
"valor": {
"original": "100.50"
},
"chave": "+5561988887777",
"solicitacaoPagador": "Fatura #001 do lote",
"infoAdicionais": [
{
"nome": "Lote",
"valor": "123"
}
]
},
{
"txid": "fb2761260e054c7a94fb7b7b02",
"calendario": {
"dataDeVencimento": "2023-12-31",
"validadeAposVencimento": 30
},
"devedor": {
"nome": "Maria Silva",
"cpf": "98765432100",
"logradouro": "Av. Brasil, 456",
"cidade": "Rio de Janeiro",
"uf": "RJ",
"cep": "20040020"
},
"recebedor": {
"nome": "Empresa XYZ Ltda",
"cnpj": "98765432000123",
"logradouro": "Av. Paulista, 1000",
"cidade": "São Paulo",
"uf": "SP",
"cep": "01310100"
},
"valor": {
"original": "250.00",
"juros": {
"modalidade": 2,
"valorPerc": "0.033"
},
"multa": {
"modalidade": 2,
"valorPerc": "2.00"
}
},
"chave": "[email protected]",
"solicitacaoPagador": "Fatura #002 do lote"
}
]
}
Responses
The responses below represent Success(202) from the consumption.
- 🟢 202
- 🔴 400
- 🔴 401
- 🔴 403
- 🔴 500
- 🔴 503
{
"loteCobvId": 123,
"status": "EM_PROCESSAMENTO",
"customId": 123,
"description": "Lote de faturas de dezembro 2023",
"quantidadeCobrancas": 2,
"criadoEm": "2023-10-15T14:30:00Z"
}
{
"correlationId": "a9f13566e19f5ca51329479a5bae60c5",
"error": {
"status": 400,
"title": "Bad Request",
"detail": "Lote contém cobranças inválidas"
},
"validationErrors": [
{
"txid": "fb2761260e054c7a94fb7b7b01",
"errors": [
"Data de vencimento deve ser no futuro",
"CPF inválido"
]
},
{
"txid": "fb2761260e054c7a94fb7b7b02",
"errors": [
"Endereço do devedor incompleto"
]
}
]
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "Unauthorized",
"detail": "Token de acesso inválido ou expirado",
"status": 401
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "Forbidden",
"detail": "Acesso negado",
"status": 403
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "InternalServerError",
"detail": "Erro interno do servidor",
"status": 500
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "ServiceUnavailable",
"detail": "Serviço temporariamente indisponível",
"status": 503
}
}
List batch charges
Endpoint to retrieve a paginated list of due-date charge batches created by the PSP.
Information per Batch:- Identification: Batch ID and custom ID
- Status: Current processing state
- Statistics: Summary of charges processing
- Dates: Creation and processing completion dates
- Description: Description provided at creation
- Monitoring: Track all batches in processing
- Audit: Check history of processed batches
- Reconciliation: Validate processing of multiple batches
GET /v1/lotecobv
Requires authorization for the scope:
lotecobv.ind.writeRequest
The code snippet below illustrates using the endpoint with the minimum required parameters (theinicio and fim date range) and the format for these parameters./v1/lotecobv?inicio=2023-01-01T16:01:35Z&fim=2023-12-30T16:01:35ZResponses
The responses below represent Success(200) from the consumption.
- 🟢 200
- 🔴 400
- 🔴 401
- 🔴 403
- 🔴 500
- 🔴 503
{
"parametros": {
"inicio": "2023-10-01T00:00:00Z",
"fim": "2023-10-31T23:59:59Z",
"paginacao": {
"paginaAtual": 0,
"itensPorPagina": 100,
"quantidadeDePaginas": 1,
"quantidadeTotalDeItens": 3
}
},
"lotes": [
{
"id": 123,
"description": "Lote de faturas de dezembro 2023",
"cobsv": {
"criacao": "2023-10-15T14:30:00Z",
"txid": "2023-10-15T14:35:00Z",
"status": "PROCESSADO"
}
}
]
}
{
"correlationId": "a9f13566e19f5ca51329479a5bae60c5",
"error": {
"status": 400,
"title": "Bad Request",
"detail": "Data de início deve ser anterior à data de fim"
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "Unauthorized",
"detail": "Token de acesso inválido ou expirado",
"status": 401
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "Forbidden",
"detail": "Acesso negado",
"status": 403
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "InternalServerError",
"detail": "Erro interno do servidor",
"status": 500
}
}
{
"correlationId": "abcdef01-2345-6789-0123-456789012345",
"error": {
"title": "ServiceUnavailable",
"detail": "Serviço temporariamente indisponível",
"status": 503
}
}