Pular para o conteúdo

Create a consent

Opens a payment consent for scheduled or recurring Pix. The response carries a redirectUrl that the user must visit to authenticate at the account holder and approve the consent. The institution is identified by organisationId and authorisationServerId from Get registered participants.

Send exactly one branch inside payment.schedule (single, daily, weekly, monthly, or custom). The OpenAPI contract requires the first settlement to be at least D+1 calendar day from consent creation, at most 60 installments, and the last installment within two years of consent creation.

The OpenAPI schema marks payment as optional alongside optional paymentId; in practice you send a full payment object (including schedule) when creating a new scheduled or recurring flow. Use paymentId only when your integration reuses an existing payment definition as allowed by your backend contract.

POST/api/v1/open-integration/consents

Create a consent

Opens a payment consent and returns the redirectUrl the end user must visit to authenticate at the account holder.

Auth: Bearer Token

Request body

4 campos
organisationId●
bodystring

OrganisationId of the selected institution (from Get registered participants).

authorisationServerId●
bodystring

AuthorisationServerId of the selected institution.

paymentId
bodystring

Optional existing payment ID when your flow reuses a stored payment definition.

payment
bodyobject

Payment details including schedule. Required for a new scheduled or recurring consent unless your backend accepts only paymentId.

details
bodystring

Human-readable description of the payment.

externalId
bodystring

Your own identifier for the payment. Useful for cross-referencing and for lookups via GET payments by external ID.

redirectUri●
bodystring

URL the end user is redirected to once the flow completes at the account holder.

cpfCnpj●
bodystring

Payer CPF or CNPJ (digits only).

value●
bodynumber

Payment amount in BRL per installment (or single payment).

creditor●
bodyobject

Creditor (receiver) details.

name●
bodystring

Creditor name.

personType●
bodystring

One of `PESSOA_NATURAL`, `PESSOA_JURIDICA`.

cpfCnpj●
bodystring

Creditor CPF or CNPJ (digits only).

accountNumber●
bodystring

Creditor account number.

accountIssuer●
bodystring

Creditor account branch code.

accountIspb●
bodystring

Creditor ISPB (8 digits).

accountType●
bodystring

One of `CACC` (checking), `SVGS` (savings), `TRAN` (payments).

debitor
bodyobject

Debtor (payer) account details. Optional — if omitted, the account holder collects them from the end user.

accountNumber●
bodystring

Debtor account number.

accountIssuer●
bodystring

Debtor account branch code.

accountIspb●
bodystring

Debtor ISPB (8 digits).

accountType●
bodystring

One of `CACC`, `SVGS`, `TRAN`.

schedule
bodyobject

Exactly one nested branch should be populated: `single`, `daily`, `weekly`, `monthly`, or `custom`.

single
bodyobject

One payment on a fixed calendar date (ISO date string).

date●
bodystring

Settlement date (`YYYY-MM-DD`).

daily
bodyobject

Recurring every calendar day from startDate for `quantity` installments.

startDate●
bodystring

First settlement date (`YYYY-MM-DD`).

quantity●
bodynumber

Number of installments.

weekly
bodyobject

Recurring weekly on a fixed weekday.

dayOfWeek●
bodystring

Weekday constant (for example `QUARTA_FEIRA` in the API contract).

startDate●
bodystring

Anchor date (`YYYY-MM-DD`).

quantity●
bodynumber

Number of installments.

monthly
bodyobject

Recurring monthly on a fixed day-of-month.

dayOfMonth●
bodynumber

Calendar day (1–28/29/30/31 as applicable).

startDate●
bodystring

First month anchor (`YYYY-MM-DD`).

quantity●
bodynumber

Number of installments.

custom
bodyobject

Explicit list of settlement dates.

dates●
bodyarray<string>

ISO date strings for each settlement.

additionalInformation●
bodystring

Human-readable note describing the custom pattern.

txId
bodyarray<string>

Transaction identifiers attached to the payment.

businessCnpj
bodystring

Business CNPJ (digits only). Optional — stored without punctuation when provided.

curl --request POST \
  --url 'https://embedded-payment-manager.hml.linaob.com.br/api/v1/open-integration/consents' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <SEU_TOKEN>' \
  --data '{
  "organisationId": "c8f0bf49-4744-4933-8960-7add6e590841",
  "authorisationServerId": "c8f0bf49-4744-4933-8960-7add6e590841",
  "paymentId": "payment123",
  "payment": {
    "details": "Subscription — March cycle",
    "externalId": "ext123",
    "redirectUri": "https://your-app.example.com/payments/callback",
    "cpfCnpj": "12345678901234",
    "value": 1500.5,
    "creditor": {
      "name": "John Doe",
      "personType": "PESSOA_NATURAL",
      "cpfCnpj": "12345678901234",
      "accountNumber": "1234567890",
      "accountIssuer": "0001",
      "accountIspb": "12345678",
      "accountType": "CACC"
    },
    "debitor": {
      "accountNumber": "1234567890",
      "accountIssuer": "0001",
      "accountIspb": "12345678",
      "accountType": "CACC"
    },
    "schedule": {
      "single": {
        "date": "2024-09-01"
      },
      "daily": {
        "startDate": "2024-09-01",
        "quantity": 5
      },
      "weekly": {
        "dayOfWeek": "QUARTA_FEIRA",
        "startDate": "2024-09-01",
        "quantity": 12
      },
      "monthly": {
        "dayOfMonth": 10,
        "startDate": "2024-09-01",
        "quantity": 6
      },
      "custom": {
        "dates": [
          "2024-08-23",
          "2024-09-26"
        ],
        "additionalInformation": "Every Thursday and Sunday for six months"
      }
    },
    "txId": [
      "ext123",
      "ext1234"
    ],
    "businessCnpj": "12345678000195"
  }
}'

Response

200Consent created successfully.
Response body
object
  • dataobjectrequired

    Consent creation result.

    • idstringrequired

      ID of the newly created payment request. Use it as the paymentRequestId when calling GET payments/requests.

    • redirectUrlstringrequired

      URL to redirect the end user so they can authenticate at the account holder and approve the consent.

  • messagestring

    Response message.

  • typestring

    Response type. One of `error`, `warning`, `info`, `success`.

  • statusCodeinteger· nullable

    HTTP status code carried inside the envelope.

200 · Consent created successfully.
{
  "data": {
    "id": "payment123",
    "redirectUrl": "https://bank.example.com/auth?consent=abc123"
  },
  "message": "Consent created successfully.",
  "type": "success",
  "statusCode": 200
}

Next steps