Skip to main content
Error format The Payments API answers a failed request with one of three bodies. Which body you get depends on where the service catches the failure, not on which endpoint you called. The authentication and authorization layer runs ahead of everything else and answers plain text with a bare reason and no error code. A failure that the request pipeline catches next, before the API layer sees it, answers a flat JSON body on application/json. The idempotency check is the pipeline rule you meet most often. Everything the API layer catches answers an RFC 9457 problem document on the application/problem+json media type.
Field definitions
  • type – A URI that identifies the error in the Lerian error catalog. Built as https://errors.lerian.studio/v1/<code>.
  • title – The HTTP status text, for example Unprocessable Entity.
  • status – The HTTP status code.
  • detail – Text about this occurrence of the condition. The wording comes from the branch that raised it.
  • code – A stable identifier for the condition, in the form PBP-NNNN. Branch on this value.
  • errors – Optional list of per-field validation details, each with a message, a location, and the value found there.
At status 500, 502 and 503 the detail member carries a fixed text instead of a description of your request, so read code to identify the condition. The flat body carries code, title, message, and an optional details object. It never carries type, status or detail. The code member holds the same PBP-NNNN value in both JSON bodies. Branch on it, and handle 401 and 403 by status, because a refusal from the authentication layer carries no code. Five codes reach you as a flat body when the idempotency check raises them: PBP-0002, PBP-0007, PBP-0008, PBP-0012 and PBP-0013. Read the media type rather than the code to tell the two bodies apart, because the pipeline also answers this way for a failure that no handler caught, and that failure can name any code.

Platform errors


These codes answer on any endpoint. The transport layer and the shared request pipeline raise them, so handle them on every rail.

Provider errors


Three codes carry the payment provider answer on a payment instruction. PBP-0014 means the provider read the instruction and refused it, so correct the cause before you send a new request. For PBP-0015 and PBP-0016 the provider gave no usable answer. PBP-0014 is raised before this API writes anything, so a retry with the same idempotency key is safe. PBP-0015 and PBP-0016 leave the outcome unknown, so retry those with a new idempotency key.

Boleto errors


These codes answer the boleto rail: issuance, installment series, cancellation and PDF retrieval.

Payment errors


These codes answer the bill payment rail: bankslip, utilities and DARF.

Ledger errors


Three codes carry the ledger’s answer to a write, and the line that matters is whether the ledger answered at all. PBP-0300 and PBP-0302 are refusals: the write failed, so correct the cause and submit a new request. PBP-0301 says the ledger gave no answer: the payment exists, so submit nothing and poll it instead.

Webhook configuration errors


These codes answer a request that configures where this API pushes event notifications.

Inbound provider webhook errors


These four codes answer the payment provider that posts settlement events to the webhook endpoint. They tell that caller which repair its delivery needs.