Saltar al contenido principal
POST
/
v1
/
schedules
Crear una programación Pix
curl --request POST \
  --url https://plugin-pix-indirect.api.lerian.net/v1/schedules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Account-Id: <x-account-id>' \
  --header 'X-Idempotency: <x-idempotency>' \
  --data '
{
  "amount": "100.50",
  "initiationId": "550e8400-e29b-41d4-a716-446655440010",
  "scheduledFor": "2026-08-15T00:00:00Z",
  "description": "Recurring charge installment 03/12",
  "endToEndId": "E1234567820260815060012345678901",
  "maxAttempts": 2,
  "recurrenceId": "01988a7c-1234-7abc-8def-111122223333"
}
'
import requests

url = "https://plugin-pix-indirect.api.lerian.net/v1/schedules"

payload = {
"amount": "100.50",
"initiationId": "550e8400-e29b-41d4-a716-446655440010",
"scheduledFor": "2026-08-15T00:00:00Z",
"description": "Recurring charge installment 03/12",
"endToEndId": "E1234567820260815060012345678901",
"maxAttempts": 2,
"recurrenceId": "01988a7c-1234-7abc-8def-111122223333"
}
headers = {
"X-Account-Id": "<x-account-id>",
"X-Idempotency": "<x-idempotency>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'X-Account-Id': '<x-account-id>',
'X-Idempotency': '<x-idempotency>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '100.50',
initiationId: '550e8400-e29b-41d4-a716-446655440010',
scheduledFor: '2026-08-15T00:00:00Z',
description: 'Recurring charge installment 03/12',
endToEndId: 'E1234567820260815060012345678901',
maxAttempts: 2,
recurrenceId: '01988a7c-1234-7abc-8def-111122223333'
})
};

fetch('https://plugin-pix-indirect.api.lerian.net/v1/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://plugin-pix-indirect.api.lerian.net/v1/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '100.50',
'initiationId' => '550e8400-e29b-41d4-a716-446655440010',
'scheduledFor' => '2026-08-15T00:00:00Z',
'description' => 'Recurring charge installment 03/12',
'endToEndId' => 'E1234567820260815060012345678901',
'maxAttempts' => 2,
'recurrenceId' => '01988a7c-1234-7abc-8def-111122223333'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Account-Id: <x-account-id>",
"X-Idempotency: <x-idempotency>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://plugin-pix-indirect.api.lerian.net/v1/schedules"

payload := strings.NewReader("{\n \"amount\": \"100.50\",\n \"initiationId\": \"550e8400-e29b-41d4-a716-446655440010\",\n \"scheduledFor\": \"2026-08-15T00:00:00Z\",\n \"description\": \"Recurring charge installment 03/12\",\n \"endToEndId\": \"E1234567820260815060012345678901\",\n \"maxAttempts\": 2,\n \"recurrenceId\": \"01988a7c-1234-7abc-8def-111122223333\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Account-Id", "<x-account-id>")
req.Header.Add("X-Idempotency", "<x-idempotency>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://plugin-pix-indirect.api.lerian.net/v1/schedules")
.header("X-Account-Id", "<x-account-id>")
.header("X-Idempotency", "<x-idempotency>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"100.50\",\n \"initiationId\": \"550e8400-e29b-41d4-a716-446655440010\",\n \"scheduledFor\": \"2026-08-15T00:00:00Z\",\n \"description\": \"Recurring charge installment 03/12\",\n \"endToEndId\": \"E1234567820260815060012345678901\",\n \"maxAttempts\": 2,\n \"recurrenceId\": \"01988a7c-1234-7abc-8def-111122223333\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://plugin-pix-indirect.api.lerian.net/v1/schedules")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Account-Id"] = '<x-account-id>'
request["X-Idempotency"] = '<x-idempotency>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"100.50\",\n \"initiationId\": \"550e8400-e29b-41d4-a716-446655440010\",\n \"scheduledFor\": \"2026-08-15T00:00:00Z\",\n \"description\": \"Recurring charge installment 03/12\",\n \"endToEndId\": \"E1234567820260815060012345678901\",\n \"maxAttempts\": 2,\n \"recurrenceId\": \"01988a7c-1234-7abc-8def-111122223333\"\n}"

response = http.request(request)
puts response.read_body
{
  "accountId": "019cf6ef-e418-7ced-80c0-7b9816faa798",
  "amount": "100.50",
  "attemptCount": 0,
  "attempts": [
    {
      "attemptedAt": "2026-08-15T06:00:02Z",
      "endToEndId": "E1234567820260815060011111111111",
      "failureMessage": "Midaz error: balance below required (06:00 BRT attempt)",
      "failureReason": "INSUFFICIENT_FUNDS",
      "initiationId": "a1111111-1111-4111-8111-111111111111",
      "transferId": "f1a2b3c4-1111-4d5e-9f6a-7b8c9d0e1f23"
    }
  ],
  "cancelledAt": "2026-05-19T09:15:33Z",
  "createdAt": "2026-05-26T12:30:00Z",
  "description": "Recurring charge installment 03/12",
  "destination": {
    "account": {
      "branch": "0001",
      "number": "123456789",
      "participant": "12345678",
      "type": "CACC"
    },
    "key": "john.doe@example.com",
    "owner": {
      "document": "12345678901",
      "name": "John Doe",
      "tradeName": "John's Business"
    }
  },
  "endToEndId": "E1234567820260815060012345678901",
  "executedAt": "2026-08-15T06:00:04Z",
  "failedAt": "2026-08-15T06:00:04Z",
  "failureMessage": "<string>",
  "failureReason": "INSUFFICIENT_FUNDS",
  "firedAt": "2026-08-15T06:00:04Z",
  "id": "01989f9e-6508-79f8-9540-835be49fbd0d",
  "initiationId": "550e8400-e29b-41d4-a716-446655440010",
  "initiationType": "MANUAL",
  "maxAttempts": 2,
  "recurrenceId": "01988a7c-1234-7abc-8def-111122223333",
  "scheduledFor": "2026-08-15T09:00:00Z",
  "status": "SCHEDULED",
  "transferId": "c8d27e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
  "updatedAt": "2026-05-26T12:30:00Z"
}
{
"code": "<string>",
"title": "<string>",
"message": "<string>"
}
{
"code": "<string>",
"title": "<string>",
"message": "<string>"
}
{
"code": "<string>",
"title": "<string>",
"message": "<string>"
}
{
"code": "<string>",
"title": "<string>",
"message": "<string>"
}
{
"code": "<string>",
"title": "<string>",
"message": "<string>"
}
{
"code": "<string>",
"title": "<string>",
"message": "<string>"
}

Autorizaciones

Authorization
string
header
requerido

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Encabezados

X-Account-Id
string
requerido

Identificador único de la cuenta del Ledger de Midaz (formato UUID).

X-Idempotency
string
requerido

Clave de idempotencia (se recomienda UUID v4); las repeticiones devuelven la respuesta 201 en caché.

Cuerpo

application/json
amount
string
requerido

Amount es el monto de la transferencia en BRL con 2 decimales (p. ej. "100.50"). El formato y los límites se validan cuando se dispara la programación.

Ejemplo:

"100.50"

initiationId
string
requerido

InitiationID ancla la programación a una iniciación de pago existente que ya contiene la instantánea del destino validada por DICT. La programación copia los campos de destino de esa iniciación y guarda la referencia como ancla de auditoría (nunca se reutiliza al momento del disparo). Debe existir una iniciación antes de crear la programación.

Ejemplo:

"550e8400-e29b-41d4-a716-446655440010"

scheduledFor
string<date-time>
requerido

ScheduledFor es la fecha de disparo en horario de reloj, en ISO 8601 con zona horaria. El momento de ejecución real se resuelve a partir de este valor más la hora de ejecución predeterminada del servicio (BRT). Los clientes recurrentes deben ajustarlo a >= D-1 de la fecha de vencimiento.

Ejemplo:

"2026-08-15T00:00:00Z"

description
string

Description es el mensaje de transferencia opcional legible para humanos: opcional, máximo 140 caracteres; se rechaza contenido HTML o de scripts. Opcional a nivel de Pix / BACEN (informacoesEntreUsuarios).

Maximum string length: 140
Ejemplo:

"Recurring charge installment 03/12"

endToEndId
string

EndToEndID es el identificador end-to-end de BACEN opcional, generado por quien llama, para el Pix programado. No está ligado a un encabezado ni es obligatorio, por lo que los clientes HTTP genéricos lo omiten. Los clientes recurrentes (Pix Automático) que generan por adelantado el id end-to-end del cashout lo proporcionan para que el disparo programado reutilice el mismo identificador. Su formato se valida cuando se procesa el pago.

Ejemplo:

"E1234567820260815060012345678901"

maxAttempts
integer

MaxAttempts limita la cantidad de intentos de disparo permitidos para esta programación. El pagador de Pix Automático usa 2 (primer intento a las 06:00 BRT, reintento por INSUFFICIENT_FUNDS a las 18:00 BRT). Cero u omitido recae en el valor predeterminado del servicio.

Rango requerido: 1 <= x <= 2
Ejemplo:

2

recurrenceId
string

RecurrenceID es un ancla de correlación genérica que agrupa varias programaciones creadas por el mismo flujo de origen (pago recurrente, suscripción, plan de cuotas, ciclo de facturación, etc.). Opcional. La capa de programación NO interpreta este valor: es metadato opaco que se refleja en GET / LIST y en los webhooks salientes schedule.* para que el consumidor de origen pueda reagrupar. Nil para programaciones puntuales sin grupo padre.

Ejemplo:

"01988a7c-1234-7abc-8def-111122223333"

Respuesta

Created

accountId
string

AccountID refleja el AccountID de entrada para correlación de auditoría / logs.

Ejemplo:

"019cf6ef-e418-7ced-80c0-7b9816faa798"

amount
string

Amount es el monto en BRL con 2 decimales.

Ejemplo:

"100.50"

attemptCount
integer

AttemptCount es la cantidad de intentos de disparo realizados hasta ahora.

Ejemplo:

0

attempts
object[]

Attempts es la lista cronológica de intentos de disparo previos fallidos. El intento exitoso no se incluye aquí; queda registrado en la propia programación mediante su TransferID y EndToEndID. Arreglo vacío cuando no se registró ningún fallo.

cancelledAt
string<date-time>

CancelledAt es el momento en que la programación llegó a CANCELLED. Ausente para filas que no están en CANCELLED.

Ejemplo:

"2026-05-19T09:15:33Z"

createdAt
string<date-time>

CreatedAt es la marca de tiempo de persistencia (ISO 8601 UTC).

Ejemplo:

"2026-05-26T12:30:00Z"

description
string

Description es el mensaje de transferencia opcional legible para humanos.

Ejemplo:

"Recurring charge installment 03/12"

destination
object

Destination es la instantánea del destino capturada en la programación.

endToEndId
string

EndToEndID es el identificador end-to-end de BACEN de la transferencia liquidada (resuelto mediante TransferID). Ausente para estados que no son EXECUTED.

Ejemplo:

"E1234567820260815060012345678901"

executedAt
string<date-time>

ExecutedAt es el momento en que la programación llegó a EXECUTED. Ausente para filas que no están en EXECUTED.

Ejemplo:

"2026-08-15T06:00:04Z"

failedAt
string<date-time>

FailedAt es el momento en que la programación llegó al estado terminal FAILED. Ausente para filas que no están en FAILED. Simétrico con ExecutedAt / CancelledAt.

Ejemplo:

"2026-08-15T06:00:04Z"

failureMessage
string

FailureMessage es la descripción de fallo legible para humanos, en texto libre (saneada de PII). Ausente para filas que no están en FAILED.

failureReason
enum<string>

FailureReason categoriza un fallo terminal. Instantánea del FailureReason de la última entrada de Attempts[]. Ausente para filas que no están en FAILED.

Opciones disponibles:
INSUFFICIENT_FUNDS,
BTG_REJECTED,
MIDAZ_REJECTED,
VALIDATION_FAILED,
SCHEDULE_STALE_TIMEOUT,
SCHEDULE_RETRIES_EXHAUSTED
Ejemplo:

"INSUFFICIENT_FUNDS"

firedAt
string<date-time>

FiredAt es el instante de despacho más reciente. Ausente hasta que la programación empieza a procesarse (PROCESSING / EXECUTED / FAILED).

Ejemplo:

"2026-08-15T06:00:04Z"

id
string

ID es el identificador único de la programación (UUID v7, generado por la aplicación).

Ejemplo:

"01989f9e-6508-79f8-9540-835be49fbd0d"

initiationId
string

InitiationID es la iniciación de pago referenciada al momento de creación (ancla de auditoría). Nunca se reutiliza al momento del disparo; cada intento de disparo usa su propia iniciación, expuesta por intento como Attempts[].InitiationID.

Ejemplo:

"550e8400-e29b-41d4-a716-446655440010"

initiationType
enum<string>

InitiationType registra cómo se capturó el destino (MANUAL, KEY, QR_CODE).

Opciones disponibles:
MANUAL,
KEY,
QR_CODE
Ejemplo:

"MANUAL"

maxAttempts
integer

MaxAttempts es el tope de reintentos por fila aceptado al momento de creación.

Ejemplo:

2

recurrenceId
string

RecurrenceID refleja el ancla de la recurrencia padre cuando la programación se creó a partir de un flujo recurrente. Vacío para llamadas directas a POST /v1/schedules.

Ejemplo:

"01988a7c-1234-7abc-8def-111122223333"

scheduledFor
string<date-time>

ScheduledFor es el momento de disparo en horario de reloj (ISO 8601 UTC).

Ejemplo:

"2026-08-15T09:00:00Z"

status
enum<string>

Status es el estado del ciclo de vida de la programación. Siempre SCHEDULED al crear. Ciclo de vida: SCHEDULED -> PROCESSING -> EXECUTED | FAILED | CANCELLED.

Opciones disponibles:
SCHEDULED,
PROCESSING,
EXECUTED,
FAILED,
CANCELLED
Ejemplo:

"SCHEDULED"

transferId
string

TransferID es el identificador de la transferencia liquidada. Se completa solo en EXECUTED.

Ejemplo:

"c8d27e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f"

updatedAt
string<date-time>

UpdatedAt es la marca de tiempo de la última transición de estado (ISO 8601 UTC).

Ejemplo:

"2026-05-26T12:30:00Z"