> ## 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.

# Relay a cross-core TED return

> The body crosses byte-verbatim to {address}/v1/cross-core/ted/returns at the owner's TED address, with the Courier's credential there, Content-Type, Chave-Idempotencia when sent, and X-Courier-Origin-Engine, the caller's engine id read from its credential. One attempt, inside 15 s; the payer resends the identical bytes while the outcome is unknown.



## OpenAPI

````yaml /en/openapi/v3-current/jd-courier.yaml post /v1/cross-core/ted/returns
openapi: 3.1.0
info:
  contact:
    email: support@lerian.studio
    name: Lerian Studio Support
  description: >-
    The JD Courier API. Operators use it to manage the engines, the ownership
    map, the rails and their delivery modes, the retained messages, the SPB send
    journal and reconciliation. Engines use it to resolve and claim ownership,
    declare their Pix Automático payment legs, and relay a payment between two
    cores of the same institution to the core that owns the payee account.
  license:
    name: Lerian Studio General License
  title: JD Courier API
  version: v1.0.0
servers: []
security:
  - BearerAuth: []
tags:
  - description: >-
      The engine registry: the cores that consume the JD channel through the
      Courier, each with its participant set
    name: Engines
  - description: 'The ownership map: which engine owns each key. Every change is audited.'
    name: ownership
  - description: >-
      The rails: what each declares about itself, its activation and state per
      tenant, and its delivery modes
    name: channels
  - description: >-
      The engines' side of the ownership map: resolution for the on-us gate,
      authoritative and never advisory, the claim of the accounts, charger
      documents and Pix Automático recurrences the engine holds, and the
      declaration of a payment leg it holds.
    name: ownership-query
  - description: >-
      A same-bank Pix or TED between two cores: the Courier asks the map who
      owns the payee account, forwards the body byte for byte to that engine's
      address for the rail, and relays its answer. It stores, retries and posts
      nothing; bodies are not modelled.
    name: cross-core
  - description: >-
      The durable message store: redelivery on demand, without asking the vendor
      again
    name: ledger
  - description: >-
      Count reconciliation per rail: E(m) = C(m) + T(m) + R(m), the sequence
      gaps it saw, and the sends whose return leg never arrived
    name: assurance
  - description: >-
      The SPB send journal: every send, written before it leaves, and the sends
      whose outcome is unknown. A by-hand close records an operator's finding
      and never resends.
    name: send-journal
  - description: >-
      Per-(tenant, channel) state an operator acts on: lifting a durable channel
      halt
    name: channel-leases
  - description: >-
      Messages the Courier holds because no engine could receive them. A routing
      or delivery retention leaves by itself once its cause lifts, or when an
      operator asks for its routing decision to be run again.
    name: retained
paths:
  /v1/cross-core/ted/returns:
    post:
      tags:
        - cross-core
      summary: Relay a cross-core TED return
      description: >-
        The body crosses byte-verbatim to {address}/v1/cross-core/ted/returns at
        the owner's TED address, with the Courier's credential there,
        Content-Type, Chave-Idempotencia when sent, and X-Courier-Origin-Engine,
        the caller's engine id read from its credential. One attempt, inside 15
        s; the payer resends the identical bytes while the outcome is unknown.
      operationId: crossCoreTedReturns
      parameters:
        - description: >-
            The engine id the payer's own map lookup returned for the payee
            account.
          in: header
          name: X-Courier-Expected-Owner
          required: true
          schema:
            type: string
        - description: The payee's idempotency key, forwarded as sent.
          in: header
          name: Chave-Idempotencia
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
        required: true
      responses:
        '400':
          description: >-
            JDC-0001, not-sent: the body is not a UTF-8 JSON object, or
            X-Courier-Expected-Owner is missing.
        '401':
          description: >-
            JDC-0401, no marker: the credential is not an enabled engine's
            granted cross-core:send. Nothing was sent.
        '409':
          description: >-
            Not-sent. JDC-0118: no engine owns the payee account. JDC-0119: the
            owner is not X-Courier-Expected-Owner; it moved, and after an
            earlier unknown attempt the payer parks the item. JDC-0121: the
            owner is the caller itself.
        '422':
          description: >-
            JDC-0104, not-sent: the payee account cannot be read from the body:
            its account, and its branch unless it is a payment account.
        '503':
          description: >-
            Not-sent. JDC-9001: the map or the registry is not readable.
            JDC-0120: the owner is disabled, declares no address for the rail,
            could not be reached, redirected or refused the Courier's
            credential. JDC-0902: the licence is revoked. A call whose request
            reached the payee and whose answer did not come back within 15 s
            gets no status at all: its connection is closed.
        default:
          description: >-
            The payee engine's answer, status, Content-Type and body as it wrote
            them, with no X-Send-Outcome: it reached the engine the map names. A
            payee that redirects or refuses the Courier's credential never took
            the call, and is the Courier's 503 JDC-0120 instead.
      security:
        - engineCredentials:
            - cross-core:send
components:
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http
    engineCredentials:
      description: >-
        An Access Manager application token whose subject is bound to exactly
        one engine; an engine may hold several, one per calling product. It
        reaches only the operations its scopes name; the operator surface
        refuses it.
      flows:
        clientCredentials:
          scopes:
            cross-core:send: Send a same-bank payment to the core that owns the payee account
            ownership:read: Read the ownership map
            ownership:write: >-
              Claim accounts, charger documents or a Pix Automático recurrence,
              or declare a Pix Automático payment leg, for the calling engine
              alone
          tokenUrl: https://access-manager.example.com/v1/login/oauth/access_token
      type: oauth2

````

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