Pular para o conteúdo

Authorise payment

Completes the JSR payment for a consent created by Create payment consent, after the payer performs the FIDO2 gesture (navigator.credentials.get()). Send enrollmentId, paymentRequestId (the id returned by Create payment consent), riskSignals, and fidoAssertion matching the WebAuthn credential — the ASPSP authorises and settles the Pix.

The envelope data follows RetornoPaymentRequestDto (request-level status, payments[], etc.) — the same shape you get back from Get payment request.

POST/api/v1/jsr/payments

Authorise consent and make payment

Submits enrollmentId and paymentRequestId to execute the JSR Pix payment.

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

4 campos
enrollmentId
bodystring

Authorised enrollment used for this payment.

paymentRequestId
bodystring

Payment request id from Create payment consent (`data.id`).

riskSignals
bodyobject

Risk signals collected on the payer's device at the moment of payment.

deviceId
bodystring
osVersion
bodystring
userTimeZoneOffset
bodystring
language
bodystring
screenDimensions
bodyobject
width
bodynumber
height
bodynumber
accountTenure
bodystring

ISO date the user registered on your platform.

fidoAssertion
bodyobject

WebAuthn assertion from navigator.credentials.get().

id
bodystring

Credential id (base64url).

rawId
bodystring

Same value as id.

response
bodyobject
authenticatorData
bodystring

Base64url.

clientDataJSON
bodystring

Base64url.

signature
bodystring

Base64url.

userHandle
bodystring

Base64url or empty string if absent.

type
bodystring
clientExtensionResults
bodyobject

Browser extension results (send `{}` when none).

authenticatorAttachment
bodystring

platform or cross-platform.

curl --request POST \
  --url 'https://embedded-payment-manager.hml.linaob.com.br/api/v1/jsr/payments' \
  --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",
  "paymentRequestId": "pay_req_xyz",
  "riskSignals": {
    "deviceId": "00aa11bb22cc33dd",
    "osVersion": "14",
    "userTimeZoneOffset": "-03",
    "language": "pt",
    "screenDimensions": {
      "width": 1080,
      "height": 2340
    },
    "accountTenure": "2023-08-20"
  },
  "fidoAssertion": {
    "id": "PHTfZjunYYbZqbHcE7cRewO4QUCI5FLfl_NFLXHDWPs",
    "rawId": "PHTfZjunYYbZqbHcE7cRewO4QUCI5FLfl_NFLXHDWPs",
    "response": {
      "authenticatorData": "ZynbwP-T2rhdodTWL28bNVIvLR9PJWFgR8TC-gttcR4FAAAAAQ",
      "clientDataJSON": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiYlhGV2VrMWpZVk5qZEdadVVVRSIsIm9yaWdpbiI6Imh0dHBzOi8vcGFzc2tleS1hdXRoLXJlZ2lzdGVyLnZlcmNlbC5hcHAiLCJjcm9zc09yaWdpbiI6ZmFsc2V9",
      "userHandle": "15e200d8-c7ff-4a95-90a5-1c461e03a099"
    },
    "type": "public-key",
    "clientExtensionResults": {},
    "authenticatorAttachment": "platform"
  }
}'

Response

200Payment processed; payment request payload returned.
Response body
object
  • dataobjectrequired

    RetornoPaymentRequestDto.

    • idstringrequired

      Payment request id.

    • createDateTimestringrequired· date-time

      Creation timestamp.

    • lastChangedDateTimestringrequired· date-time

      Last modification timestamp.

    • externalCommentstring· nullable

      External comment associated with the payment.

    • externalIdstring· nullable

      External id of the payment.

    • cpfCnpjstring· nullable

      Debtor CPF/CNPJ.

    • redirectUristring· nullable

      Redirect URI after payment processing.

    • tenantIdstringrequired

      Tenant id associated with the payment.

    • consentIdstring· nullable

      Consent id.

    • valuenumberrequired

      Total value BRL.

    • statusstringrequired

      PENDENTE | EM_PROCESSAMENTO | CONSUMIDO | EXPIRADO | CANCELADO | ERRO_NA_DETENTORA | ERRO

    • creditorobjectrequired
    • debitorobject· nullable

      Debtor account details. Null when not provided at consent creation.

    • typestring· nullable

      NOW | SINGLE | DAILY | WEEKLY | MONTHLY | CUSTOM

    • paymentsarray of objectsrequired

      Installments / legs with statuses.

    • requestExpiresAtstring· nullable

      Payment expiration date.

    • businessCnpjstring· nullable

      Company CNPJ (stored without punctuation).

    • localInstrumentstring· nullable

      MANU | DICT | QRDN | QRES | INIC | APES | APDN

  • messagestring

    Response message.

  • typestring

    Envelope type.

  • statusCodeinteger· nullable

    HTTP status in envelope.

200 · Payment processed; payment request payload returned.
{
  "data": {
    "id": "pay_req_xyz",
    "createDateTime": "2024-06-01T12:00:00Z",
    "lastChangedDateTime": "2024-06-02T12:00:00Z",
    "externalComment": "Payment processed",
    "externalId": "ext123",
    "cpfCnpj": "12345678901234",
    "redirectUri": "http://example.com/redirect",
    "tenantId": "tenant123",
    "consentId": "consent_xyz",
    "value": 1500.5,
    "status": "CONSUMIDO",
    "creditor": {
      "name": "Merchant SA",
      "personType": "PESSOA_JURIDICA",
      "cpfCnpj": "12345678000195",
      "accountNumber": "1234567890",
      "accountIssuer": "0001",
      "accountPixKey": "email@example.com",
      "accountIspb": "12345678",
      "accountType": "CACC"
    },
    "debitor": {
      "accountNumber": "1234567890",
      "accountIssuer": "0001",
      "accountIspb": "12345678",
      "accountType": "CACC"
    },
    "type": "SINGLE",
    "payments": [
      {
        "id": "pay_leg_1",
        "endToEndId": "E47133056202409201011eCPvUq3GjmK",
        "dueDate": "2024-06-01T12:00:00Z",
        "externalComment": "Payment processed",
        "txId": "ext123",
        "externalPaymentId": "consent_xyz",
        "status": "PAGO",
        "rejectionReason": null,
        "rejectionReasonDetail": null
      }
    ],
    "requestExpiresAt": "2024-09-01T12:00:00Z",
    "businessCnpj": "12345678000195",
    "localInstrument": "MANU"
  },
  "message": "",
  "type": "success",
  "statusCode": null
}

How payment status settles: synchronous check, webhook, and polling

In synchronous mode, POST /api/v1/jsr/payments performs up to 10 internal status checks against the account holder before it responds, trying to return a final status (PAGO / REJEITADO) directly in this response. In the large majority of cases this is enough — Pix has a tight settlement SLA, and the payment reaches a final status inside that window.

If the response comes back without a final status (still PENDENTE / EM_PROCESSAMENTO), don't treat that as a failure: call Get payment request with the same paymentRequestId to fetch the latest state. Two things happen in parallel to eventually update it, in case the window above wasn't enough:

  • Webhook — Lina fires a webhook whenever the payment's status changes, as soon as the account holder reports it. See Webhooks — treat the notification as a signal only and always confirm with a GET.
  • Internal polling — Lina also runs a background job that re-checks any payment without a final status every two hours, independent of the webhook.

You can additionally run your own client-side polling, querying the account holder directly (bypassing Lina's cached record) via Get payment from holder — useful if you don't want to depend solely on the webhook or Lina's internal polling cadence.

After authorise payment — how the final status reaches you

Next steps