> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Use COB with Pix Lerian

> Create static BR Codes and immediate or due-date Pix collections with Pix Lerian.

COB creates Pix payment payloads and tracks collection state.

## Create a static BR Code

Use [Create static BR Code](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/create-static-brcode.md) when you need a reusable BR Code. The returned resource contains the encoded payment payload. Keep its identifier and use [Get static BR Code](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/get-static-brcode.md) or [List static BR Codes](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/list-static-brcodes.md) to retrieve it later.

A static BR Code is not a collection settlement record. Use a collection when you need to track a charge lifecycle.

## Create an immediate collection

1. Call [Create immediate collection](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/create-immediate-collection.md) with a new idempotency value.
2. Save the collection identifier, BR Code payload, location, and expiration returned by the API.
3. Read it through [Get immediate collection](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/get-immediate-collection.md) or [List immediate collections](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/list-immediate-collections.md).
4. With `MOCK_TEST_ENDPOINTS_ENABLED=true`, the mock provider can simulate a payment. Its callback records payment only when its amount matches the immediate collection amount. An identical callback is a safe replay. A callback with conflicting payment data is not a safe replay.
5. If the charge must end without payment, use [Cancel immediate collection](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/cancel-immediate-collection.md). Cancelling an already cancelled collection returns the existing terminal result.

## Create a due-date collection

A due-date collection requires the due-date calendar and debtor data. It can also carry value modifiers such as fine, interest, abatement, or discount.

1. Call [Create due-date collection](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/create-due-date-collection.md). The plugin validates the Pix key before it creates the collection.
2. Save the identifier and payment payload. Read it with [Get due-date collection](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/get-due-date-collection.md), or find it through [List due-date collections](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/list-due-date-collections.md).
3. Apply only the documented due-date revision contract when a permitted value modifier must change. It uses JSON Merge Patch. Do not send a full replacement body by default.
4. Cancel through [Cancel due-date collection](https://docs.lerian.studio/en/reference/interfaces/pix-lerian/cob/cancel-due-date-collection.md) when the collection must no longer be payable.

The collection callback is internal to the plugin. Your client confirms payment by reading the public collection resource, not by posting a payment callback itself.

## Avoid unsupported assumptions

This page covers static BR Codes and collections. For scheduled payments, see the scheduled-payment operations in the SPI API reference.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.