Skip to main content

How to use the API to create a charge with due date, fine and interest (cobv)?

To create a Pix charge with a due date, fine and interest, use the API's /api/v1/charge endpoint.

You can find the documentation for this endpoint here.

The required fields to create a Pix charge with a due date, fine and interest are the following:

  • value: The amount, in cents, of the Pix charge to be created.
  • correlationID: A unique identifier for the Pix charge. CorrelationID
  • type: The charge type. Specifically, the value OVERDUE.
  • customer: An object representing the user who will receive the charge.

Inside customer you must send the CPF/CNPJ of the customer being charged.

If the customer is already registered in our database and has an address, this information is enough.

However, if the customer is not registered, or has no address registered, you must either register the customer with an address or send this information along with the request.

Example​

Your request body will look similar to this example:

{
"value": 100,
"correlationID": "c782e0ac-833d-4a89-9e73-9b60b2b41d3a",
"type": "OVERDUE",
"customer": {
"taxID": "607.681.970-74"
}
}

After making the request, if everything went well, the request status code will be 2xx and the response body will contain the created charge.

A response similar to the following will be returned:

{
"charge": {
"customer": {
"name": "S...",
"address": {
"zipcode": "13...",
"street": "R...",
"number": "151",
"neighborhood": "Centro",
"city": "S...",
"state": "SP",
"complement": "Casa"
},
"taxID": { "taxID": "60768197074", "type": "BR:CPF" },
"correlationID": "b6b1f741-f13f-4923-a14e-b515b245e6a5"
},
"value": 1500,
"identifier": "ec60c...",
"correlationID": "c782e0ac-833d-4a89-9e73-9b60b2b41d3a",
"paymentLinkID": "98e76...",
"transactionID": "ec60c...",
"status": "ACTIVE",
"giftbackAppliedValue": 0,
"discount": 0,
"valueWithDiscount": 1500,
"expiresDate": "2023-03-04T02:59:59.999Z",
"type": "OVERDUE",
"createdAt": "2023-02-24T20:31:35.288Z",
"additionalInfo": [],
"updatedAt": "2023-02-24T20:31:43.744Z",
"interestsSettings": {
"fines": { "value": 1000 },
"interests": { "value": 200 }
},
"expiresIn": 628104,
"pixKey": "d65032...",
"brCode": "0002010...",
"paymentLinkUrl": "http://url.com/pay/...",
"qrCodeImage": "http://url.com/openpix/charge/brcode/image/...",
"globalID": "Q2hhcmdlOjYzZjkxZ..."
},
"correlationID": "c782e0ac-833d-4a89-9e73-9b60b2b41d3a",
"brCode": "0002010..."
}

Code examples​

curl 'https://api.woovi.com/api/v1/charge' -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "user-agent: node-fetch" \
--data-binary '{"correlationID":"c782e0ac-833d-4a89-9e73-9b60b2b41d3a","value":1500, "type": "OVERDUE","customer": {"taxID": "607.681.970-74"}}'