Transaction

Pix Hub Transaction

General Information

This document specifies the Pix Hub API for transactional operations involving collections and payments via Pix. Key features include:

  • Authentication: Obtaining a token for all operations.
  • Generation of Pix Collections: Create Pix collections efficiently and securely.
  • Pix Payment Consultation: Check the status and details of payments made via Pix.
  • Return: Return payments via Pix efficiently.

Environments

  • Production: https://connect.latam.fiservapis.com
  • Certification: https://connect-cert.latam.fiservapis.com

Error Structure

All errors handled are returned in the following standard format:

{
  "message": "Error message",
  "details": [
    {
      "errorCode": 0,
      "error": "Description of the error"
    }
  ]
}

Default Headers

Some information is required in all requests:

HeaderDescription
AuthorizationAuthentication token. See POST /token
apikeyMade available by Fiserv after accreditation
x-timestampTimestamp of the request. Also used for the generation of HMAC signature
x-hmac-signatureHMAC signature generated. See HMAC Calculation section

POST /token

Authentication endpoint required for all calls. Get the authentication token through a client_secret and client_id. Send via application/x-www-form-urlencoded and use the Bearer token for subsequent requests.

See Authentication Documentation


HMAC Calculation

The HMAC must be calculated using the SHA256 algorithm and the private key provided by Fiserv, containing the following concatenated fields:

APIKEY + TIMESTAMP + REQUEST_BODY + URL_PATH
Postman Script Example
var CryptoJS = require("crypto-js");

function setHMACAuth(request) {
  const currentDate = new Date();
  var API_KEY = pm.collectionVariables.get('apikey');
  var SECRET = pm.collectionVariables.get('secret');
  var requestId = generateUUID();
  const timestamp = currentDate.getTime().toString();
  var rawData = API_KEY + timestamp + request.body.toString() + '/' + pm.request.url.path.toString().replaceAll(',', '/');
  var signedValue = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, SECRET).update(rawData).finalize();
  hashedStringRequest = CryptoJS.enc.Base64.stringify(signedValue);
  pm.request.headers.add({ key: "x-timestamp", value: timestamp });
  pm.request.headers.add({ key: "x-hmac-signature", value: hashedStringRequest });
  pm.request.headers.add({ key: "x-request-id", value: requestId });
}

function generateUUID() {
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
    var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
    return v.toString(16);
  });
}

setHMACAuth(pm.request);


Charges (Collections)

POST /apm/pix/v1/charges

Create a Pix charge (QR Code).

Request Fields
FieldTypeDescriptionMandatory
omniPaymentIdstringFiserv OmniPayment IDyes
amountdecimalPayment amountyes
providersobjectPSP list and Credential Alias. If not provided, default values from onboarding are usedno
providers.providerCodestringCode provided by the Central Bank for each PSPno
providers.credentialAliasstringCredential alias earned after registering a PSP credential during the onboarding processno
expirationnumberQR Code expiration time in seconds. Default: 900no
payerRequeststringText presented to the payer for entering related information (up to 140 characters in pacs.008)no
additionalInfo[].namestringAdditional information label presented to the payerno
additionalInfo[].valuestringAdditional information value presented to the payerno
Response Fields
FieldTypeDescription
tidstringFiserv transaction ID, alphanumeric up to 60 characters
txidstringPix payment transaction ID with BACEN, alphanumeric up to 36 characters
provider.providerCodestringPSP used to carry out the transaction
provider.credentialAliasstringCredential used to perform the transaction
pixCopyPastestringPayment QR code, alphanumeric up to 750 characters
statusstringPayment status. Possible values: PENDING, DENIED

GET /apm/pix/v1/charges/{tid}

Query a charge by transaction ID.

Request Fields
FieldTypeDescriptionMandatory
tidstringFiserv Transaction IDyes
Response Fields
FieldTypeDescription
tidstringFiserv transaction ID, alphanumeric up to 60 characters
txidstringPix payment transaction ID with BACEN, alphanumeric up to 36 characters
endToEndIdstringTransaction ID between PSPs, alphanumeric up to 36 characters
provider.providerCodestringPSP used to carry out the transaction
provider.credentialAliasstringCredential used to perform the transaction
refunds[].rtrIdstringChargeback transaction ID between PSPs, alphanumeric up to 32 characters
refunds[].amountdecimalReversed amount
refunds[].solicitedAtstringChargeback date and time
refunds[].statusstringChargeback status
statusstringPayment status. Possible values: PENDING, CANCELLED, EXPIRED, FINISHED, REVERSED
amountnumberPayment amount. Format: DDDDDDDD.DD
pixCopyPastestringPayment QR code, alphanumeric up to 750 characters

PUT /apm/pix/v1/charges/{tid}/refund

Request a reversal (chargeback) of the charge amount. Should only be used after the customer has already made the payment and the transaction is finalized.

Request Fields
FieldTypeDescriptionMandatory
amountnumberAmount to be refundedyes
Response Fields
FieldTypeDescription
tidstringFiserv transaction ID, alphanumeric up to 60 characters
txidstringPix payment transaction ID with BACEN, alphanumeric up to 36 chars
rtrIdstringChargeback transaction ID between PSPs, alphanumeric up to 32 chars
amountdecimalReversed amount
solicitedAtstringDate and time of the request
statusstringChargeback status. Possible values: CONFIRMED


Charges with Due Date (Pix COBV)

POST /apm/pix/v2/charges-duedate

Create a Pix charge with a due date (COBV format).

Request Fields
FieldTypeDescriptionMandatory
omniPaymentIdstringFiserv OmniPayment IDyes
amountdecimalPayment amountyes
providersobjectPSP list and Credential Alias. If not provided, default values from onboarding are usedno
providers.providerCodestringCode provided by the Central Bank for each PSPno
providers.credentialAliasstringCredential alias earned after registering a PSP credential during the onboarding processno
dueDatedatePayment due date (ISO 8601, e.g. 2026-12-01). Payment can be made up to and including this dateyes
expirationDatedateDeadline for payment after the due date (ISO 8601). Must be greater than dueDate. Defaults to dueDate + 30 daysno
payerRequeststringText presented to the payer for entering related information (up to 140 characters in pacs.008)no
additionalInfo[].namestringAdditional information label presented to the payerno
additionalInfo[].valuestringAdditional information value presented to the payerno
interestModalitystringInterest calculation method. Possible values: DAILY_FIXED_VALUE, DAILY_PERCENTAGE, MONTHLY_PERCENTAGE, YEARLY_PERCENTAGE, BUSINESS_DAY_VALUE, BUSINESS_DAY_PERCENT, BUSINESS_MONTH_PERCENT, BUSINESS_YEAR_PERCENTno
interestValuestringInterest value (absolute or percentage, per interestModality). Pattern: \d{1,10}\.\d{2}no
penaltyModalitystringPenalty value format: FIXED or PERCENTAGE. Mandatory when penaltyValue is informedno
penaltyValuestringPenalty value (absolute or percentage, per penaltyModality). Pattern: \d{1,10}\.\d{2}no
discountModalitystringDiscount calculation method. Possible values: FIXED_AMOUNT_WITH_DATE, PERCENTAGE_WITH_DATE, VALUE_ADVANCE_CALENDAR, VALUE_ADVANCE_BUSINESS, PERCENT_ADVANCE_CALENDAR, PERCENT_ADVANCE_BUSINESSno
discounts[].discountDatedateMandatory when discountModality is FIXED_AMOUNT_WITH_DATE or PERCENTAGE_WITH_DATE (ISO 8601)no
discounts[].discountValuestringDiscount value (absolute or percentage). Pattern: \d{1,10}\.\d{2}no
rebateModalitystringRebate value format: FIXED or PERCENTAGE. Mandatory when interestValue is informedno
rebateValuestringRebate value (absolute or percentage, per rebateModality)no
payer.personTypestringPayer type: COMPANY for companies or INDIVIDUAL for individualsyes
payer.taxNumberstringPayer's tax number. CPF (11 digits) for individuals or CNPJ (^[0-9A-Z]{14}$) for companiesyes
payer.namestringPayer's nameyes
payer.emailstringPayer's email (up to 100 characters)no
payer.address.streetstringPayer's street (up to 200 characters)no
payer.address.citystringPayer's city (up to 100 characters)no
payer.address.statestringPayer's state abbreviation (UF, 2 characters)no
payer.address.postalCodestringPayer's postal code (up to 8 characters)no
receiver.pixKeystringReceiver's Pix key (CPF/CNPJ, mobile phone with country code, email, or random UUID key - 36 characters)yes
Response Fields
FieldTypeDescription
tidstringFiserv transaction ID, alphanumeric up to 60 characters
txidstringPix payment transaction ID with BACEN, alphanumeric up to 36 characters
provider.providerCodestringPSP used to carry out the transaction
provider.credentialAliasstringCredential used to perform the transaction
pixCopyPastestringPayment QR code, alphanumeric up to 750 characters
statusstringPayment status. Possible values: PENDING, DENIED
dueDatedatePayment due date
expirationDatedatePayment expiration date
payer.emailstringPayer's email
payer.address.streetstringPayer's street
payer.address.citystringPayer's city
payer.address.statestringPayer's state (UF)
payer.address.postalCodestringPayer's postal code
receiver.pixKeystringReceiver's Pix key
interestValuenumberInterest value. Format: DDDDDDDD.DD
penaltyValuenumberPenalty value. Format: DDDDDDDD.DD
rebateValuenumberRebate value. Format: DDDDDDDD.DD
discounts[].discountDatedateDiscount date
discounts[].discountValuenumberDiscount value

GET /apm/pix/v2/charges-duedate/{tid}

Query a Pix COBV charge by transaction ID.

Request Fields
FieldTypeDescriptionMandatory
tidstringFiserv Transaction IDyes
Response Fields
FieldTypeDescription
tidstringFiserv transaction ID, alphanumeric up to 60 characters
txidstringPix payment transaction ID with BACEN, alphanumeric up to 36 characters
endToEndIdstringTransaction ID between PSPs, alphanumeric up to 36 characters
provider.providerCodestringPSP used to carry out the transaction
provider.credentialAliasstringCredential used to perform the transaction
refunds[].rtrIdstringChargeback transaction ID between PSPs
refunds[].amountdecimalReversed amount
refunds[].solicitedAtstringChargeback date and time
refunds[].statusstringChargeback status
statusstringPayment status. Possible values: PENDING, CANCELLED, EXPIRED, FINISHED, REVERSED
amountnumberPayment amount. Format: DDDDDDDD.DD
dueDatedatePayment due date
expirationDatedatePayment expiration date
pixCopyPastestringPayment QR code, alphanumeric up to 750 characters
payer.emailstringPayer's email
payer.address.streetstringPayer's street
payer.address.citystringPayer's city
payer.address.statestringPayer's state (UF)
payer.address.postalCodestringPayer's postal code
payer.taxNumberstringPayer's tax number (CPF or CNPJ)
payer.namestringPayer's name
receiver.pixKeystringReceiver's Pix key
interestValuenumberInterest value. Format: DDDDDDDD.DD
penaltyValuenumberPenalty value. Format: DDDDDDDD.DD
rebateValuenumberRebate value. Format: DDDDDDDD.DD
discounts[].discountDatedateDiscount date
discounts[].discountValuenumberDiscount value

PUT /apm/pix/v1/charges/{tid}/cancel

Cancel the QR Code of the generated charge. Use this to cancel before the customer makes the payment, or when the transaction status has not yet been returned. If the transaction has already been paid, a refund will be requested automatically.

Request Fields
FieldTypeDescriptionMandatory
tidstringFiserv Transaction IDyes
Response Fields
FieldTypeDescription
tidstringPix Hub transaction ID, alphanumeric up to 60 characters
txidstringPix payment transaction ID with BACEN, alphanumeric up to 36 characters
statusstringPayment status. Possible values: PENDING, CANCELLED, DENIED, FINISHED
provider.providerCodestringPSP used to carry out the transaction
provider.credentialAliasstringCredential used to perform the transaction


Transaction Callback

After the payment is made or the QR Code expires, the registered URL will receive the following notification.

⚠️

For security reasons, when receiving a callback, validate the Api-Key and the Authorization (HMAC signature).

Callback Request Headers
FieldTypeDescription
Client-Request-IdstringRequest ID (UUID)
Api-KeystringAPI Key registered during the onboarding process
TimestampstringDate and time of submission of the request
Auth-Token-TypestringAlways HMAC
AuthorizationstringHMAC Signature: SHA256(Api-Key + Client-Request-Id + Timestamp + RequestBody)
Callback HMAC Calculation

The HMAC must be calculated using the SHA256 algorithm and the private key registered during onboarding, containing the following concatenated fields:

Api-Key + Client-Request-Id + Timestamp + RequestBody

Note: The JSON of the request body must be in compact format (inline), without line breaks or extra formatting. Do not include invisible characters such as \r, \n, or unnecessary spaces.

const crypto = require('crypto');

function guid() {
  function s4() {
    return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
  }
  return s4() + s4() + s4() + s4() + s4() + s4() + s4() + s4();
}

const apiKey = "API_KEY";
const secret = "SECRET";
const clientRequestId = guid();
const timeStamp = new Date().getTime();
const requestBody = JSON.stringify(request.data);
const rawSignature = apiKey + clientRequestId + timeStamp + requestBody;

const hmac = crypto.createHmac('sha256', secret);
hmac.update(rawSignature);
const computedHmac = hmac.digest('base64');

const headers = {
  "content-type": "application/json",
  "client-request-id": clientRequestId,
  "Api-Key": apiKey,
  "Timestamp": timeStamp,
  "Auth-Token-Type": "HMAC",
  "Authorization": computedHmac
};
Callback Fields
FieldTypeDescription
tidstringFiserv transaction ID, alphanumeric up to 60 characters
txidstringPix payment transaction ID with BACEN, up to 36 characters
endToEndIdstringTransaction ID between PSPs, alphanumeric up to 36 characters
statusstringPayment status. Possible values: FINISHED, EXPIRED
operationTypenumberTransaction type: 0 – Charge, 3 – Expiration
rtrIdstringChargeback ID (for chargeback confirmation only)
provider.providerCodestringPSP used to carry out the transaction
provider.credentialAliasstringCredential used to perform the transaction