Skip to main content

Create PIX Transaction

To make a PIX charge, use this route to create a new transaction. Our API will return, among other data, the pix_copy_paste field, responsible for providing the PIX Copy and Paste that should be made available to the customer so they can make the payment.

Each PIX transaction has an expiration time, which can be defined at the time of transaction creation through the expired field. If not informed, the default expiration time is 24 hours (86,400 seconds). After this period, the PIX becomes invalid and it will no longer be possible to make the payment.

POSTv3/pix

Request Body Params

AttributeTypeDescription
amountint32Final amount to be charged from the end consumer. Must be passed in cents.
item_idstringTransaction ID in your platform.
soft_descriptorstringDescription that will appear on your customer's invoice. Maximum of 13 characters, alphanumeric and spaces.
customerobjectCustomer object.
customer[name]stringCustomer name.
customer[email]stringCustomer email.
customer[document_number]stringCustomer document number.
customer[phone]objectCustomer phone number object.
customer[phone][country_code]stringCustomer phone country code (DDI).
customer[phone][area_code]stringCustomer phone state code (DDD).
customer[phone][number]stringCustomer phone number.
expiredint32Optional parameter. Expiration time in seconds. If not informed, we use the default of 86400 (24 h).
pixobjectOptional parameter.
PIX key data object.
If you include sub_seller_id, this field becomes dispensable.
pix[type]stringPIX key type.
Accepted values: cpf, cnpj, email or phone.
pix[key]stringPIX key value. Must be informed according to the PIX key type.
sub_seller_idstringOptional parameter. Partner ID for which the transfer will occur.
If you include pix, this field becomes dispensable.
webhook_urlstringOptional parameter to pass the endpoint of your system that will receive information with each transaction update.
webhook_auth_tokenstringOptional parameter to authenticate notifications sent to webhook_url. If the parameter is not informed, notifications will be sent without authentication.
simulate_statusstringOptional parameter that can be passed in test environment to simulate the PIX flow. Accepted values: paid, failed, expired.
Request Body Example
{
"amount": 1000,
"item_id": "ABC123456789",
"soft_descriptor": "Marlim Store",
"expired": 86400,
"customer": {
"name": "Luke Skywalker",
"email": "luke@jedimaster.sw",
"document_number": "00099988877",
"phone": {
"country_code": "+55",
"area_code": "11",
"number": "999887766"
}
}
}
Important

Our API does not accept null, undefined or empty string values in any endpoint. If you pass a parameter with any of these 3 values, an error will be returned. If the parameter is not mandatory and you don't want it to be computed, simply remove it from the request.

Response Object

PropertyTypeDescription
statusstringRepresents the current state of the transaction. Possible values: waiting_payment, failed.
date_createddateTimeTransaction creation date in ISODateTime format.
date_updateddateTimeTransaction status update date in ISODateTime format.
item_idstringTransaction ID in your platform.
payment_methodstringPayment method used in the transaction. Possible values: pix.
transaction_idstringMarlim transaction identifier number.
amountint32Amount in cents to be charged in the transaction.
payout_amountint32Amount in cents to be transferred.
paid_amountint32Amount in cents captured in the transaction.
refunded_amountint32Amount in cents refunded in the transaction.
pix_copy_pastestring | nullPIX Copy and Paste code that should be presented to the customer for payment. Returns null when the transaction fails or is rejected.
Response Example
{
"status": "waiting_payment",
"date_created": "2025-01-01T10:00:00.000Z",
"date_updated": "2025-01-01T10:00:00.000Z",
"item_id": "ABC123456789",
"payment_method": "pix",
"transaction_id": "ABCeWbEfTwHtmkX3q123",
"amount": 1000,
"payout_amount": 950,
"paid_amount": 0,
"refunded_amount": 0,
"pix_copy_paste": "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426614174000520400005303986540510.005802BR5913Marlim Store6009Sao Paulo62070503***6304E2CA"
}

Examples

WARNING

The values used in the examples below are for illustration purposes only and should not be used to make requests to Marlim APIs. In development and testing environments, use data closer to a real transaction.

Request
curl -X POST "https://api.marlim.co/v3/pix" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
-d '{
"amount": 1000,
"item_id": "ABC123456789",
"soft_descriptor": "Marlim Store",
"expired": 86400,
"customer": {
"name": "Luke Skywalker",
"email": "luke@jedimaster.sw",
"document_number": "00099988877",
"phone": {
"country_code": "+55",
"area_code": "11",
"number": "999887766"
}
}
}'
Response200
{
"status": "waiting_payment",
"date_created": "2025-07-29T11:38:57.850Z",
"date_updated": "2025-07-29T11:38:57.850Z",
"item_id": "ABC123456789",
"payment_method": "pix",
"transaction_id": "ABCeWbEfTwHtmkX3q123",
"amount": 1000,
"payout_amount": 950,
"paid_amount": 0,
"refunded_amount": 0,
"pix_copy_paste": "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426614174000520400005303986540510.005802BR5913Marlim Store6009Sao Paulo62070503***6304E2CA"
}