1. Pay In Request
A Pay In transaction occurs when a Customer starts a direct deposit in the Merchant website.

This algorithm outlines the expected steps and procedures to be followed in the Pay In process with Pay4Fun:
^(?!0|\.00)[0-9]+((,|\.)\d{3})*(.[0-9]{0,2})?$Success
Bad Request
POST /1.0/Go/Process HTTP/1.1
Host:
Content-Type: application/json-patch+json
Accept: */*
Content-Length: 436
{
"amount": 1,
"merchantInvoiceId": "text",
"language": "text",
"currency": "text",
"okUrl": "https://example.com",
"notOkUrl": "https://example.com",
"confirmationUrl": "https://example.com",
"hash": "text",
"p4fAccountEmail": "text",
"p4fMainId": "text",
"merchantLogo": "https://example.com",
"layoutColor": "text",
"labelId": 1,
"paymentMethodId": 1,
"paymentMethod": "text",
"fullName": "text",
"lockByName": true,
"birthDate": "text",
"email": "text",
"zipcode": "text"
}{
"code": 201,
"message": "success"
}1. Send a Pay In Request:
You initiate the process by sending us a Pay In request.
Purpose of this request is allow your customers authenticate their Pay4Fun’s wallet. (No transaction will be generated due this request)
^(?!0|\.00)[0-9]+((,|\.)\d{3})*(.[0-9]{0,2})?$Success
Bad Request
POST /1.0/Go/Process HTTP/1.1
Host:
Content-Type: application/json-patch+json
Accept: */*
Content-Length: 436
{
"amount": 1,
"merchantInvoiceId": "text",
"language": "text",
"currency": "text",
"okUrl": "https://example.com",
"notOkUrl": "https://example.com",
"confirmationUrl": "https://example.com",
"hash": "text",
"p4fAccountEmail": "text",
"p4fMainId": "text",
"merchantLogo": "https://example.com",
"layoutColor": "text",
"labelId": 1,
"paymentMethodId": 1,
"paymentMethod": "text",
"fullName": "text",
"lockByName": true,
"birthDate": "text",
"email": "text",
"zipcode": "text"
}{
"code": 201,
"message": "success"
}Transaction Parameters
The following table provides a list of parameters required for transaction processing:
hash
String
Anti-fraud hash. Refer to Appendix 1 for generation details.
Yes
amount
Decimal
Payment amount with up to 2 decimal places.
Yes
merchantInvoiceId
String
Unique transaction ID for merchants. Maximum of 250 characters.
Yes
language
String
Preferred language for customer: pt-BR, en-US, or es-ES.
No
currency
String
Currency code as per ISO 4217 (3 characters). Supported Currencies: BRL, GBP, USD, EUR.
Yes
okUrl
String
Redirection URL upon successful transaction.
Yes
notOkUrl
String
Redirection URL upon transaction failure.
Yes
confirmationUrl
String
URL for merchant’s transaction confirmation.
Yes
labelId
Integer
Label for transaction tagging. Refer to Appendix 3 for details.
No
Onboard Data Parameters
To enhance the user experience, you can provide your customer's personal data. If provided, we'll automatically populate the appropriate fields during the transaction process. Otherwise, the customer will be prompted to enter this information themselves.
Note: We only process the customer's initial data submission. Subsequent submissions of the same data will be ignored, so it's only necessary to send this information once.
zipcode
String
Brazilian postal code.
No
email
String
Customer's email address.
No
birthDate
String
Birthdate in yyyy-MM-dd format.
No
fullName
String
Customer's full name.
No
p4fMainId
String
Customer's CPF.
No
Payment Method Parameters
Display Pay4Fun GO as a Single Icon: By doing this, you should avoid specifying any Payment Method parameters in your request. We will present all available payment methods, letting the customer select their preferred option.
Use Individual Icons for Each Payment Method: If you opt for this, include just ONE of the parameters—either
paymentMethodorpaymentMethodId—in your request. Based on this, we'll guide the customer directly to the confirmation screen for their chosen payment method.
paymentMethod
String
Desired Payment Method: PIX, Boleto, or BankTransfer.
No
paymentMethodId
Integer
Check Error! Not a valid result for table. section for more details
No
Branding
merchantLogo
String
Merchant logo URL (https). Max height: 40 pixels.
No
layoutColor
String
Hexadecimal color code.
No
Pay in hash seed string generation
To generate the seed string for hash creation in Pay in requests (See Appendix – Generating the Hash), follow the concatenation order below:
Merchant’s ID
Pay in amount (expressed in cents and always including two decimal places)
Merchant’s invoice ID
Merchant’s secret
Example: Consider a Pay in request of $10.00 USD tied to merchant’s invoice ID ABC777. Given:
Merchant’s ID:
34567Merchant’s secret:
abcdef
The resulting seed string becomes:
codeSeed string = 345671000ABC777abcdefSecurity Note: The Merchant's secret is crucial for hash integrity. Ensure it remains confidential to prevent unauthorized hash generation.
Key Point: Always include cents in the seed string, even for whole amounts like $1000.00.
The P4F API will generate its hash for verification. If there's a mismatch, likely due to an attempt to forge a request without the authentic Merchant's secret, the transaction will be declined.
Payment Methods
Success
processing_error
GET /1.0/Go/PaymentMethods HTTP/1.1
Host:
Accept: */*
[
{
"paymentMethodId": 1,
"name": "text",
"paymentMethodTypeName": "text"
}
]How to Create a Seed String for Payment Methods:
To make a seed string for hash generation:
Start with the Merchant's ID.
Add the Merchant's Secret.
For detailed hash generation, see Appendix 1.
Example: If your Merchant's ID is 34567 and Secret is abcdef, then:
Seed string = 34567abcdef
Example of a Payment Method Request:
[
{
"paymentMethodId": 1987,
"name": "Itau",
"paymentMethodTypeName": "Bank Transfer"
},
{
"paymentMethodId": 2009,
"name": "PIX",
"paymentMethodTypeName": "Bank Transfer"
}
// ... other payment methods
]Last updated
Was this helpful?
