Skip to main content

Pix on File Payment

Pix on File (JSR) payments require an active enrollment to be initiated.

  1. Merchant initiates payment referencing the enrollment
  2. System returns a FIDO2 challenge
  3. Customer authenticates using their registered FIDO2 credentials
  4. Payment is authorized and funds are transferred

Requirements

  • EBANX Account
  • API Credentials - Ensure you have your EBANX integration Key. If not, complete the Merchant Signup Form.

Payment Initiation

Pix on File Payments are initiated using the merchant_enrollment_code created during Device Linking.

ParameterRequirementDescription
integration_keyRequiredYour integration key
typeRequiredMust be request
modeRequiredMust be full
payment.countryRequiredMust be br
payment.currency_codeRequiredCurrency code
payment.amount_totalRequiredCurrency code
payment.merchant_payment_codeRequiredPayment code
payment.order_numberOptionalOrder number
payment.payment_type_codeRequiredMust be pix-jsr
payment.nameRequiredCustomer name
payment.emailRequiredCustomer email
payment.documentRequiredCustomer document
payment.metadata.merchant_enrollment_codeRequiredUnique enrollment code

Sample Request

curl -X POST \
--location 'https://sandbox.ebanx.com/ws/direct' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "your_ebanx_integration_key",
"type": "request",
"mode": "full",
"payment": {
"country": "br",
"currency_code": "BRL",
"amount_total": "{total_amount}",
"merchant_payment_code": "{merchant_payment_code}",
"order_number": "{order_number}",
"payment_type_code": "pix-jsr",
"name": "{user_name}",
"email": "{user_email}",
"document": "{user_document}",
"metadata": {
"merchant_enrollment_code": "{merchant_enrollment_code}"
}
}
}'

A successful request will return a JSON response like the one below, creating a payment request in pending status and providing the cryptographic challenge (Base64url) that must be signed by the client's FIDO2 authenticator to complete the payment.

{
"payment": {
"hash": "{payment_hash}",
"country": "br",
"merchant_payment_code": "{merchant_payment_code}",
"order_number": "{order_number}",
"status": "PE",
"open_date": "{open_date}",
"amount_br": "{amount_br}",
"amount_ext": "{amount_ext}",
"amount_iof": "{amount_iof}",
"currency_rate": "{currency_rate}",
"currency_ext": "BRL",
"due_date": "{due_date}",
"payment_type_code": "pix-jsr",
"pix-jsr": {
"id": "{id}",
"fido_challenge": "{fido_challenge}"
}
},
"status": "SUCCESS"
}

Payment Authentication

After collecting the results of the FIDO2/WebAuthn authentication performed by the customer, send a payment authentication request using the parameters below to complete the payment.

ParameterRequirementDescription
integration_keyRequiredYour integration key
hashRequiredPayment hash
risk_signalsRequiredRefer to the Risk Signals section.
authentication.credentialIdCredential ID used for the signature, in Base64url format
authentication.rawCredentialIdRequiredThe credential ID in ArrayBuffer format (Base64url encoded)
authentication.typeRequiredMust be public-key
authentication.response.clientDataJSONClient data in JSON, encoded in Base64url
authentication.response.authenticatorDataRequiredAuthenticator data encoded in Base64url
authentication.response.signatureRequiredCryptographic signature of the data (the heart of authentication)
authentication.response.userHandleRequiredThe opaque user identifier, encoded in Base64URL (bytes)

Sample Request

curl -X POST \
--location 'https://sandbox.ebanx.com/ws/payment/authentication' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "your_ebanx_integration_key",
"hash": "{payment_hash}",
"risk_signals": {},
"fidoAssertion": {
"credentialId": "{credential_id_base_64}",
"rawCredentialId": "{credential_id_array_buffer_base_64}",
"type": "public-key",
"response": {
"clientDataJSON": "{client_data_json_in_base_64}",
"authenticatorData": "{authenticator_data_in_base_64}",
"signature": "{cryptographic_signature}",
"userHandle": "{user_handle}"
}
}
}'

A successful request will return a JSON response like the one below, confirming the payment status.

{
"payment": {
"hash": "{payment_hash}",
"country": "br",
"merchant_payment_code": "{merchant_payment_code}",
"order_number": "{order_number}",
"status": "CO",
"status_date": "{status_date}",
"open_date": "{open_date}",
"confirm_date": "{confirm_date}",
"amount_br": "{amount_br}",
"amount_ext": "{amount_ext}",
"amount_iof": "{amount_iof}",
"currency_rate": "1.0000",
"currency_ext": "BRL",
"due_date": "{due_date}",
"payment_type_code": "pix-jsr"
},
"status": "SUCCESS"
}