Skip to main content

Immediate charges

The following set of endpoints is responsible for managing immediate charges. Charges, in the context of the Pix API, represent a financial transaction between a payer and a payee, with Pix as the payment method.


Information

To test the Pix Cob charge endpoints in the sandbox environment, it's possible to simulate all the statuses returned by our API and webhook.

Charges with values between R$ 0.01 to R$ 10.00 are confirmed, and you will receive the information via Webhook.
Charges with values above R$ 10.00 remain active without confirmation, and there is no webhook in these cases.


Create Immediate Charge (without txid)

Endpoint to create an immediate charge without providing a txid.

Usually, the txid is created by the receiving user and is under their responsibility. However, this endpoint is an exception to this rule, and in this case, the txid will be defined by Efí.

POST /v2/cob
Requires authorization for the scope: cob.write


Request

{
"calendario": {
"expiracao": 3600
},
"devedor": {
"cpf": "12345678909",
"nome": "Francisco da Silva"
},
"valor": {
"original": "123.45"
},
"chave": "71cdf9ba-c695-4e3c-b010-abb521a3f1be",
"solicitacaoPagador": "Cobrança dos serviços prestados."
}

Responses

The Responses below represent Success(201) and consumption failures/errors.

{
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": 3600
},
"txid": "7978c0c97ea847e78e8849634473c1f1",
"revisao": 0,
"loc": {
"id": 789,
"location": "pix.example.com/qr/v2/9d36b84fc70b478fb95c12729b90ca25",
"tipoCob": "cob"
},
"location": "pix.example.com/qr/v2/9d36b84fc70b478fb95c12729b90ca25",
"status": "ATIVA",
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "567.89"
},
"chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1",
"solicitacaoPagador": "Informar cartão fidelidade",
"pixCopiaECola": "00020101021226830014BR.GOV.BCB.PIX2561qrcodespix.sejaefi.com.br/v2/41e0badf811a4ce6ad8a80b306821fce5204000053000065802BR5905EFISA6008SAOPAULO60070503***61040000"
}

Create Immediate Charge (with txid)

Endpoint to register a charge with a transaction identifier (txid).

PUT /v2/cob/:txid
Requires authorization for the scope: cob.write


Request

{
"calendario": {
"expiracao": 3600
},
"devedor": {
"cpf": "12345678909",
"nome": "Francisco da Silva"
},
"valor": {
"original": "123.45"
},
"chave": "71cdf9ba-c695-4e3c-b010-abb521a3f1be",
"solicitacaoPagador": "Cobrança dos serviços prestados."
}

Responses

The Responses below represent Success(201) and consumption failures/errors.

{
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": 3600
},
"txid": "7978c0c97ea847e78e8849634473c1f1",
"revisao": 0,
"loc": {
"id": 789,
"location": "pix.example.com/qr/v2/9d36b84fc70b478fb95c12729b90ca25",
"tipoCob": "cob"
},
"location": "pix.example.com/qr/v2/9d36b84fc70b478fb95c12729b90ca25",
"status": "ATIVA",
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "567.89"
},
"chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1",
"solicitacaoPagador": "Informar cartão fidelidade",
"pixCopiaECola": "00020101021226830014BR.GOV.BCB.PIX2561qrcodespix.sejaefi.com.br/v2/41e0badf811a4ce6ad8a80b306821fce5204000053000065802BR5905EFISA6008SAOPAULO60070503***61040000"
}

Review Charge

Endpoint to review (modify) a charge based on its txid.

PATCH /v2/cob/:txid
Requires authorization for the scope: cob.write


Request

{
"loc": {
"id": 7768
},
"devedor": {
"cpf": "12345678909",
"nome": "Francisco da Silva"
},
"valor": {
"original": "123.45"
},
"solicitacaoPagador": "Informe o número ou identificador do pedido."
}

Responses

The Responses below represent Success(200) and consumption failures/errors.

{
"status": "ATIVA",
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": 3600
},
"location": "pix.example.com/qr/9d36b84f-c70b-478f-b95c-12729b90ca25",
"txid": "7978c0c97ea847e78e8849634473c1f1",
"revisao": 1,
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "567.89"
},
"chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1",
"solicitacaoPagador": "Informe o número ou identificador do pedido.",
"pixCopiaECola": "00020101021226830014BR.GOV.BCB.PIX2561qrcodespix.sejaefi.com.br/v2/41e0badf811a4ce6ad8a80b306821fce5204000053000065802BR5905EFISA6008SAOPAULO60070503***61040000"
}

Get Charge

Endpoint to retrieve a charge from the txid.

GET /v2/cob/:txid
Requires authorization for the scope: cob.read


Request

It's also possible to query information about a specific revision of a charge. For this, you need to provide the query param revisao. Example: /v2/cob/:txid/?revisao=1. When the parameter is not provided, the most recent revision is returned by default.

Responses

The responses below represent Success(200) and consumption failures/errors.

{
"status": "ATIVA",
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": "3600"
},
"location": "pix.example.com/qr/9d36b84f-c70b-478f-b95c-12729b90ca25",
"txid": "7978c0c97ea847e78e8849634473c1f1",
"revisao": 1,
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "567.89"
},
"chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1",
"solicitacaoPagador": "Informe o número ou identificador do pedido.",
"pixCopiaECola": "00020101021226830014BR.GOV.BCB.PIX2561qrcodespix.sejaefi.com.br/v2/41e0badf811a4ce6ad8a80b306821fce5204000053000065802BR5905EFISA6008SAOPAULO60070503***61040000"
}

Get list of charges

Endpoint to retrieve multiple charges.

This endpoint has filters to narrow down the search results, such as CPF/CNPJ and status. Among all available filters, the inicio and fim filters are mandatory and represent the date range in which the queried charges must be included.

GET /v2/cob
Requires authorization for the scope: cob.read


Request

The code snippet below illustrates the consumption of the endpoint in a request with the minimum possible parameters (the date range inicio and fim) and the format in which these parameters should be passed.

/v2/cob?inicio=2020-10-22T16:01:35Z&fim=2020-11-30T20:10:00Z

Responses

The responses below represent Consumption Success (200).

{
"parametros": {
"inicio": "2020-04-01T00:00:00Z",
"fim": "2020-04-02T10:00:00Z",
"paginacao": {
"paginaAtual": 0,
"itensPorPagina": 100,
"quantidadeDePaginas": 1,
"quantidadeTotalDeItens": 2
}
},
"cobs": [
{
"status": "ATIVA",
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": "3600"
},
"location": "qrcodes-pix.gerencianet.com.br/9d36b84f-c70b-478f-b95c-12729b90ca25",
"txid": "7978c0c97ea847e78e8849634473c1f1",
"revisao": 1,
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "567.89"
},
"chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1",
"solicitacaoPagador": "Informe o número ou identificador do pedido.",
"pixCopiaECola": "00020101021226830014BR.GOV.BCB.PIX2561qrcodespix.sejaefi.com.br/v2/41e0badf811a4ce6ad8a80b306821fce5204000053000065802BR5905EFISA6008SAOPAULO60070503***61040000"
},
{
"status": "CONCLUIDA",
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": "3600"
},
"location": "qrcodes-pix.gerencianet.com.br/1dd7f893-a58e-4172-8702-8dc33e21a403",
"txid": "655dfdb1a4514b8fbb58254b958913fb",
"revisao": 1,
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "100.00"
},
"chave": "40a0932d-1918-4eee-845d-35a2da1690dc",
"solicitacaoPagador": "Informe o número ou identificador do pedido.",
"pixCopiaECola": "00020101021226830014BR.GOV.BCB.PIX2561qrcodespix.sejaefi.com.br/v2/41e0badf811a4ce6ad8a80b306821fce5204000053000065802BR5905EFISA6008SAOPAULO60070503***61040000",
"pix": [
{
"endToEndId": "E12345678202009091221kkkkkkkkkkk",
"txid": "655dfdb1a4514b8fbb58254b958913fb",
"valor": "110.00",
"horario": "2020-09-09T20:15:00.358Z",
"pagador": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"infoPagador": "0123456789",
"devolucoes": [
{
"id": "123ABC",
"rtrId": "Dxxxxxxxx202009091221kkkkkkkkkkk",
"valor": "10.00",
"horario": {
"solicitacao": "2020-09-09T20:15:00.358Z"
},
"status": "EM_PROCESSAMENTO"
}
]
}
]
}
]
}