Pular para o conteúdo

Create payment consent

Creates a JSR payment consent for an AUTHORISED enrollment. The response is 201 Created with id (the payment request id — use it as paymentRequestId when authorising), consentId, and FIDO2 assertion options under fidoSignOptions — pass them to navigator.credentials.get() before calling Authorise payment.

The request body is just { enrollmentId, payment } — the institution (organisationId / authorisationServerId) and the FIDO relying-party context are already resolved from the enrollment, so they are not sent again here.

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

Headers

2 campos
x-client-ip
headerstring

End-user client IP.

subTenantId
headerstring

Sub-tenant ID when required by the authenticated user context.

Request body

2 campos
enrollmentId
bodystring

Authorised enrollment id used to sign the payment consent.

payment
bodyobject

Payment payload.

details
bodystring

Human-readable description.

externalId
bodystring

Your correlation id.

redirectUri
bodystring

Redirect URI for this payment.

cpfCnpj
bodystring

Debtor CPF/CNPJ.

value
bodynumber

Payment value. Must not be provided when qrCode already has a value — the value is extracted from the QR Code in that case.

creditor
bodyobject

Creditor details. Must not be provided when qrCode is provided, since the creditor is resolved from the QR Code.

name
bodystring
personType
bodystring
cpfCnpj
bodystring
accountNumber
bodystring
accountIssuer
bodystring
accountPixKey
bodystring
accountIspb
bodystring
accountType
bodystring
txId
bodyarray<string>

Transaction identification(s). Must not be provided when qrCode is provided, since txId is extracted from the QR Code.

businessCnpj
bodystring

Company CNPJ (optional); stored without punctuation.

qrCode
bodystring

Pix QR Code (static or dynamic), or the raw Tap on Pix pix:// NFC URL — both are parsed internally. When provided with a value, creditor, txId and value must not be provided. When provided without a value, creditor and txId must not be provided (value may be provided).

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 'x-client-ip: 198.21.104.1' \
  --header 'subTenantId: subtenant_abc123' \
  --data '{
  "enrollmentId": "enr_abc123",
  "payment": {
    "details": "Payment for services",
    "externalId": "ext123",
    "redirectUri": "http://example.com/redirect",
    "cpfCnpj": "12345678901234",
    "value": 1500.5,
    "creditor": {
      "name": "John Doe",
      "personType": "PESSOA_NATURAL",
      "cpfCnpj": "12345678901234",
      "accountNumber": "1234567890",
      "accountIssuer": "0001",
      "accountPixKey": "email@example.com",
      "accountIspb": "12345678",
      "accountType": "CACC"
    },
    "txId": [
      "ext123",
      "ext1234"
    ],
    "businessCnpj": "12345678000195",
    "qrCode": "00020126580014BR.GOV.BCB.PIX0136123e4567-e12b-12d1-a456-426655440000520400005303986540512.005802BR5901N6001C62210517testePagamento1236304DB67"
  }
}'

Response

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

      Consent id.

    • idstringrequired

      Payment request id — use as paymentRequestId when authorising.

    • 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": {
    "consentId": "consent_xyz",
    "id": "pay_req_xyz",
    "fidoSignOptions": {
      "challenge": "challengeBase64url",
      "timeout": 60000,
      "rpId": "pay.example.com",
      "allowCredentials": [
        {
          "id": "credId",
          "type": "public-key"
        }
      ],
      "userVerification": "required",
      "extensions": {}
    }
  },
  "message": "",
  "type": "success",
  "statusCode": null
}

Next steps

  • Authorise payment — submit the enrollment and payment request id to settle the Pix.