CFX Pay
  1. Hardcode integration
CFX Pay
  • Introduction
  • Integration Types
  • API Standards
  • Status Flow
  • Lists
  • SPEI Mexico
  • PIX Brazil
  • Basic Integration
    • checkout_create
      POST
  • Intermediary Integration
    • checkout_form
      POST
  • Hardcode integration
    • balance_merchant
      GET
    • payment_type
      GET
    • payin_create
      POST
    • payin_check
      GET
    • payout_create
      POST
    • payout_check
      GET
  • Notification
    • How it works
  1. Hardcode integration

payin_create

POST
https://api.cfxpay.io/{{param_environment}}/{{param_company}}/gateway/payin_create
Last modified:2024-02-29 16:46:47
Create a new payin.

Request

Authorization
Send your HTTP requests with an
Authorization
header that contains the word Basic followed by a space and a base64-encoded string username:password
Example:
Authorization: Basic *****************
Header Params
Language
string 
required
Language list
Example:
PORTUGUESE_BR
Body Params application/json
payment_type_id
string <md5>
required
This ID is returned in the endpoint payment_type.
>= 32 characters<= 32 characters
Example:
a88eb69672cc1f8483d481a56259dcaa
Match pattern:
^[a-fA-F0-9]{32}$
tracking_id
string <uuid>
required
External tracking reference for the transaction UUID_v4.
>= 36 characters<= 36 characters
amount
string 
required
Amount of the invoice.
The decimal separator used is a "dot" "."
<= 10 characters
Examples:
20.0025.4542.10
Match pattern:
^\d+(\.\d{2})?$
description
string 
optional
A short description.
<= 100 characters
Example:
Payment user: 1234567890
callback_url
string <uri>
required
The URL that receive notifications when a transaction is created or change STATUS.
<= 1000 characters
Example:
https://api.cfxpay.io/webhook_test
return_url
string <uri>
optional
The URL to redirect the customer after the transaction is completed.
<= 1000 characters
Example:
https://cfxpay.io
cancel_url
string <uri>
optional
The URL to redirect the customer if the transaction is canceled.
<= 1000 characters
Example:
https://cfxpay.io
customer
object 
optional
Check in payment_type for mandatory fields
first_name
string 
optional
Required if in payment_type mandatory.
Customer first name.
<= 30 characters
Example:
Satoshi
Match pattern:
^[a-zA-Z\s]+$
last_name
string 
optional
Required if in payment_type mandatory.
Customer last name.
<= 30 characters
Example:
Nakamoto
Match pattern:
^[a-zA-Z\s]+$
document_number
string 
optional
Required if in payment_type mandatory.
Customer document number.
Check the documents allowed in each Country.
<= 20 characters
Match pattern:
^[a-zA-Z0-9]+$
email
string <email>
optional
Required if in payment_type mandatory.
Customer email.
<= 60 characters
Example:
support@cfxpay.io
phone
string 
optional
Required if in payment_type mandatory.
Customer phone number.
<= 16 characters
Match pattern:
^\+?[0-9]{1,15}$
address
string 
optional
Required if in payment_type mandatory.
Customer address.
<= 150 characters
Match pattern:
^[a-zA-Z0-9\s\.+:,\-_]+$
city
string 
optional
Required if in payment_type mandatory.
Customer city.
<= 60 characters
Match pattern:
^[a-zA-Z\s]+$
country
enum<string> 
optional
Required if in payment_type mandatory.
Customer country.
>= 2 characters<= 2 characters
Allowed values:
ARBRCLCOCRECSVMXPAPEGT
zip
string 
optional
Required if in payment_type mandatory.
Customer zip code.
<= 10 characters
Match pattern:
^[a-zA-Z0-9\-]+$
device_id
string 
optional
Required if in payment_type mandatory.
Customer device id.
<= 50 characters
ip
string <ip>
optional
Required if in payment_type mandatory.
Customer IPv4 or IPv6 address.
>= 7 characters<= 39 characters
Example
{
    "payment_type_id": "a88eb69672cc1f8483d481a56259dcaa",
    "amount": "50.00",
    "description": "Payment test",
    "tracking_id": "55616f79-0bdd-42f2-8943-165ae7359001",
    "callback_url": "https://api.cfxpay.io/webhook_test",
    "return_url": "https://cfxpay.io",
    "cancel_url": "https://cfxpay.io",
    "customer": {
        "first_name": "Satoshi",
        "last_name": "Nakamoto",
        "document_number": "28276469686",
        "email": "dev@cfxpay.io",
        "phone": "5511999999999",
        "address": "R. Jose Simoes, 596",
        "city": "Sao Paulo",
        "country": "BR",
        "zip": "01508001",
        "device_id": "123123123",
        "ip": "182.147.131.140"
    }
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://api.cfxpay.io/{{param_environment}}/{{param_company}}/gateway/payin_create' \
--header 'Language: PORTUGUESE_BR' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '{
    "payment_type_id": "a88eb69672cc1f8483d481a56259dcaa",
    "amount": "50.00",
    "description": "Payment test",
    "tracking_id": "55616f79-0bdd-42f2-8943-165ae7359001",
    "callback_url": "https://api.cfxpay.io/webhook_test",
    "return_url": "https://cfxpay.io",
    "cancel_url": "https://cfxpay.io",
    "customer": {
        "first_name": "Satoshi",
        "last_name": "Nakamoto",
        "document_number": "28276469686",
        "email": "dev@cfxpay.io",
        "phone": "5511999999999",
        "address": "R. Jose Simoes, 596",
        "city": "Sao Paulo",
        "country": "BR",
        "zip": "01508001",
        "device_id": "123123123",
        "ip": "182.147.131.140"
    }
}'

Responses

🟢200Success
application/json
Body
server
string 
required
code
integer 
required
message
string 
required
identifier
string 
required
type
string 
required
caller
string 
required
caller_id
string 
required
translation_message
string 
required
gateway
array [object {24}] 
optional
transaction_id
string 
required
merchant_id
string 
required
tracking_id
string 
required
api_transaction_id
string 
required
payment_type_id
string 
required
callback_url
string 
required
return_url
string 
optional
cancel_url
string 
optional
country
string 
required
source
string 
required
origin
string 
required
status
string 
required
currency_symbol
string 
required
amount
string 
required
amount_fee
string 
optional
amount_final
string 
required
exchange_symbol
string 
optional
exchange_rate
string 
optional
exchange_amount
string 
optional
exchange_amount_fee
string 
optional
exchange_amount_final
string 
optional
checkout_url
string 
required
checkout_info
object (Checkout Info) 
required
customer
object (Customer Payin) 
optional
Example
{
    "server": "01",
    "code": 0,
    "message": "Success",
    "identifier": "1708459481804055808",
    "type": "LOG_INFO",
    "caller": "_gateway_payin_create",
    "caller_id": "1708459480212169629",
    "translation_message": "Sucesso",
    "gateway": [
        {
            "transaction_id": "1708459481626763970",
            "merchant_id": "cfxpaygateway_merchant",
            "tracking_id": "55616f79-0bdd-42f2-8943-185ce7359001",
            "api_transaction_id": "3ad3383d-3cea-49e7-b1a5-d688668b0bcc",
            "payment_type_id": "a88eb69672cc1f8483d481a56259dcaa",
            "callback_url": "https://api.cfxpay.io/webhook_test",
            "return_url": "https://cfxpay.io",
            "cancel_url": "https://cfxpay.io",
            "country": "BR",
            "source": "DEPOSIT",
            "origin": "PROVIDER_01",
            "status": "PENDING",
            "currency_symbol": "BRL",
            "amount": "50.00",
            "amount_fee": "0.00",
            "amount_final": "50.00",
            "exchange_symbol": "USD",
            "exchange_rate": "5.33049040",
            "exchange_amount": "9.38",
            "exchange_amount_fee": "0.00",
            "exchange_amount_final": "9.38",
            "checkout_url": "https://checkout.cfxpay.io/#/invoice/55616f79-0bdd-42f2-8943-185ce7359001",
            "checkout_info": {
                "description": "PIX",
                "type": "QRCODE",
                "code": "00020101021226910014br.gov.bcb.pix2569qrcode.pix.com.br/pixqrcode/v2/d4ace62a7907bd90a3d4ea2aa5c85652046009Sao ***630444F1",
                "amount": "50.00",
                "symbol": "BRL",
                "expire_utc": "1708545881",
                "language_default": "PORTUGUESE_BR",
                "instructions": [
                    {
                        "language": "ENGLISH",
                        "instruction_01": "Open your bank's app",
                        "instruction_02": "Select the pay option through PIX",
                        "instruction_03": "Select the option QR Code",
                        "instruction_04": "Scan the QR code with your phone's camera",
                        "instruction_05": "Authorize payment"
                    },
                    {
                        "language": "SPANISH",
                        "instruction_01": "Abre la aplicación de tu banco",
                        "instruction_02": "Seleccione la opción de pago a través de PIX",
                        "instruction_03": "Seleccione la opción Código QR",
                        "instruction_04": "Escanea el código QR con la cámara de tu teléfono",
                        "instruction_05": "Autorizar pago"
                    },
                    {
                        "language": "PORTUGUESE_BR",
                        "instruction_01": "Abra o aplicativo do seu banco",
                        "instruction_02": "Selecione a opção de pagamento via PIX",
                        "instruction_03": "Selecione a opção Código QR",
                        "instruction_04": "Digitalize o código QR com a câmera do seu telefone",
                        "instruction_05": "Autorizar pagamento"
                    }
                ]
            },
            "customer": {
                "first_name": "Satoshi",
                "last_name": "Nakamoto",
                "document_number": "28266469781",
                "email": "dev@cfxpay.io",
                "country": "BR",
                "city": "Sao Paulo",
                "address": "R. Jose Simoes, 596",
                "zip": "01508001",
                "phone": "5511999999999",
                "device_id": "123123123",
                "ip": "182.147.131.140"
            }
        }
    ]
}
🟠400Wrong Params
Modified at 2024-02-29 16:46:47
Previous
payment_type
Next
payin_check
Built with