Skip to main content
POST
Record a correction to a registered contract

Authorizations

Authorization
string
header
required

JWT bearer token issued by the identity provider.

Headers

X-Idempotency
string
required

Mandatory opaque replay key, 1..128 bytes of valid UTF-8, preserved byte for byte. No default, no alias header, no case folding: two keys differing in one byte are two keys.

Required string length: 1 - 128
Example:

"idem-correcao-0001"

Path Parameters

numero_contrato
string
required

The rail contract number the correction is about. Exact, control-free UTF-8, bounded in BYTES: 2..15, which is the consumer's own bound for this field.

Required string length: 2 - 15
Example:

"99999999999AN1"

Body

application/json
content_type
string
required

Media type of the corrected resource. Its media type must be application/pdf or application/zip — parameters are permitted — and the bytes are sniffed against it.

Maximum string length: 128
Example:

"application/pdf"

correction_type
enum<string>
required

What this correction corrects. Selects which fact is published; the payload shape is identical for both.

Available options:
ccb,
disbursement
Example:

"ccb"

file_name
string
required

Original file name of the corrected resource.

Maximum string length: 255
Example:

"ccb-corrigida.pdf"

payment_reference
string
required

The payment_reference of the confirmed disbursement this correction repairs. Required when correction_type is disbursement, and must be empty otherwise.

Maximum string length: 256
Example:

"E32074986202608011200A1B2C3D4E5F"

resource_base64
string
required

Canonical base64 of the corrected resource. The gateway computes the SHA-256 itself; no client-declared digest is accepted.

Maximum string length: 8388608
Example:

"JVBERi0xLjcKJSVFT0Y="

Response

The correction is durably recorded and its fact queued. A replay under the same key answers with the identical body.

correction_id
string
required

The gateway's identity for this correction. It is also the published event id.

Example:

"1f5b9c26-6f5a-4f77-9c1c-5d1c0f0a9b21"

correction_type
string
required

What was corrected.

Example:

"ccb"

gateway_received_at
string
required

When the gateway took custody, strict RFC 3339 UTC.

Example:

"2026-08-29T12:00:05Z"

numero_contrato
string
required

The rail contract number, echoed from the path.

Example:

"99999999999AN1"

resource_digest_sha256
string
required

Lowercase hex SHA-256 the gateway computed over the corrected bytes.

Example:

"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"

resource_uri
string
required

Same-origin relative path serving the corrected resource under M2M bearer auth.

Example:

"/v1/consignado/contracts/99999999999AN1/corrections/1f5b9c26-6f5a-4f77-9c1c-5d1c0f0a9b21"

source_authority
string
required

Who is authoritative for the corrected value. Always client on this gateway.

Example:

"client"

supersedes_event_id
string

The event id this correction supersedes: the corrected disbursement confirmation, or the previous correction. ABSENT on a first CCB correction, meaning the original contract fact.

Example:

"7c2a1b40-11f4-4a1e-9a44-1f4d7cbb8e02"