Pular para o conteúdo

Create payment consent

Creates a JSR payment consent for an AUTHORISED enrollment. The response is 201 Created with consentId and FIDO2 assertion options under fidoSignOptions — pass them to navigator.credentials.get() before calling Authorise payment.

The exported OpenAPI nests creditor oddly; send a normal payment.creditor object with Pix fields as in other Lina Pay payment docs. Optional payment.schedule supports scheduled Pix (e.g. single future date).

For Tap on Pix (NFC), after decoding the qr query parameter from the pix://… URI into the Pix Copia e Cola string, send isNFC: true and qrCode with that decoded payload on this request. See Tap on Pix (NFC).

POST/api/v1/jsr/consents

Create payment and FIDO sign options

Creates a JSR consent and returns FIDO2 assertion options for the payer gesture.

Auth: Bearer Token

Cabeçalhos

2 campos
subTenantId
headerstring

Subtenant identifier.

x-client-ip
headerstring

End-user client IP.

Corpo da requisição

7 campos
enrollmentId
bodystring

Authorised enrollment id.

organisationId
bodystring

Organisation id from participants.

authorisationServerId
bodystring

Authorisation server id from participants.

isNFC
bodyboolean

Set to true for Tap on Pix (NFC) — proximity-initiated payment after reading the pix:// URI.

qrCode
bodystring

Pix Copia e Cola string (decoded EMV BR Code from the Tap to Pix URI `qr` parameter). Required when using Tap on Pix (`isNFC` true).

fidoSignOptions
bodyobject

FIDO context for signing — rp and platform.

rp
bodystring

Relying Party id (CN of transport certificate).

platform
bodystring

ANDROID | IOS | BROWSER | CROSS_PLATFORM

payment
bodyobject

Payment payload (instant or scheduled). Required fields match OpenAPI payment.required.

details
bodystring

Human-readable description.

externalId
bodystring
redirectUri
bodystring

Callback URI pattern for your product (policy may mirror redirect flows).

cpfCnpj
bodystring

Payer document digits.

value
bodynumber
creditor
bodyobject
name
bodystring
personType
bodystring
cpfCnpj
bodystring
accountNumber
bodystring
accountIssuer
bodystring
accountIspb
bodystring
accountType
bodystring
debitor
bodyobject
accountNumber
bodystring
accountIssuer
bodystring
accountIspb
bodystring
accountType
bodystring
schedule
bodyobject

Optional — omit for instant Pix. Populate exactly one nested branch (`single`, `daily`, `weekly`, `monthly`, or `custom`). Same rules as Scheduled & recurring Pix: first settlement at least D+1, up to 60 installments, last installment within two years of consent creation.

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>

Optional transaction ids.

businessCnpj
bodystring

Optional business CNPJ digits.

curl --request POST \
  --url 'https://embedded-payment-manager.hml.linaob.com.br/api/v1/jsr/consents' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <SEU_TOKEN>' \
  --header 'subTenantId: subtenant_abc123' \
  --header 'x-client-ip: 198.21.104.1' \
  --data '{
  "enrollmentId": "enr_abc123",
  "organisationId": "74e929d9-33b6-4d85-8ba7-c146c867a817",
  "authorisationServerId": "c8f0bf49-4744-4933-8960-7add6e590841",
  "isNFC": true,
  "qrCode": "00020126580014br.gov.bcb.pix0136…",
  "fidoSignOptions": {
    "rp": "*.lina.com.br",
    "platform": "BROWSER"
  },
  "payment": {
    "details": "Invoice 123",
    "externalId": "ext-123",
    "redirectUri": "https://your-app.example.com/payments/done",
    "cpfCnpj": "12345678901",
    "value": 1500.5,
    "creditor": {
      "name": "Merchant SA",
      "personType": "PESSOA_JURIDICA",
      "cpfCnpj": "12345678000195",
      "accountNumber": "1234567890",
      "accountIssuer": "0001",
      "accountIspb": "12345678",
      "accountType": "CACC"
    },
    "debitor": {
      "accountNumber": "9876543210",
      "accountIssuer": "0001",
      "accountIspb": "87654321",
      "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": [
      "tx-ref-1"
    ],
    "businessCnpj": "12345678000195"
  }
}'

Response

201Consent created; FIDO assertion options returned.
Response body
object
  • dataobjectrequired
    • idstringrequired

      Payment request id — use as paymentRequestId when authorising.

    • consentIdstringrequired

      Consent id for authorise payment.

    • fidoSignOptionsobjectrequired

      Assertion options for navigator.credentials.get.

  • messagestring

    Response message.

  • typestring

    Envelope type.

  • statusCodeinteger· nullable

    HTTP status in envelope.

201 · Consent created; FIDO assertion options returned.
{
  "data": {
    "id": "pay_req_xyz",
    "consentId": "consent_xyz",
    "fidoSignOptions": {
      "challenge": "challengeBase64url",
      "timeout": 60000,
      "rpId": "pay.example.com",
      "allowCredentials": [
        {
          "id": "credId",
          "type": "public-key"
        }
      ],
      "userVerification": "required"
    }
  },
  "message": "Created",
  "type": "success",
  "statusCode": 201
}

Next steps