# Integración Directa
API Pago Directo
# Solicitud Base URL
Test Environment : https://gateway-test.transfersmile.com
Prod Environment : https://gateway.transfersmile.com
# EndPoints
/trade/pay
# Request Header
Parametro | Requerido | Descripción |
---|---|---|
Tipo-Contenido | recomendado | application/json |
Autorización | si | Básica Base64(app_id:security_key) |
# Request Body (JSON format)
Parametro | Tipo | Requerido | Max longitud(o valor defecto) | Descripción |
---|---|---|---|---|
app_id | string | Si | 32 | App Id creada en dashboard |
timestamp | string | Si | 19 | yyyy-MM-dd HH:mm:ss |
out_trade_no | string | Si | 64 | ID dada por el merchant en su sistema |
method | string | no | 32 | Payment Methods |
channel | string | no | 32 | sub canal (sólo usar en método 'Wallet') |
order_currency | string | Si | 3 | BRL for brasil |
order_amount | decimal | Si | 0.01 ~ 99999999999999.99 | Monto solicitado de pago |
subject | string | Si | 128 | Razón de pago o título de item |
content | string | Si | 255 | Detalle de razón de pago o detalle de item. Se mostrará en la factura bancaria. |
notify_url | string | Si | IPN URL al merchant(empieza con http) | |
buyer_id | string | Si | merchant id de usuario | |
timeout_express | string | no | 90m | m(minutos), h(horas), d(días), c(siempre termina en día actual) |
token | string | no | | requerido para tarjeta de crédito |
fingerprint | string | no | | requerido para tarjeta de crédito |
issuer | string | no | Emisor de tarjeta de crédito(requerido para tarjeta de crédito) | |
installments | integer | no | 1 | Cuotas para tarjeta de crédito |
bank | string | no | | Código de banco, requerido para DepositExpress (itau,santander,bradesco,banco-do-brasil,caixa) Efectivo (Usar bank_id desde Bank Query); Transferenciabancaria (Use bank_id desde Bank Query); Khipu (Use bank_id desde Bank Query); |
language_code | string | no | | Código de idioma, requerido para Efectivo, Transferenciabancaria . (Use language_code desde Bank query) |
customer.name | string | Si | | Nombre de usuario |
customer.email | string | Si | | Correo de usuario |
customer.phone | string | Si | | Teléfono celular del usuario |
customer.identify.number | string | Si | | Número ID del usuario |
customer.identify.type | string | Si | | Tipo de ID del usuario |
address.zip_code | string | Si | zip code | |
address.state | string | Si | | Estado |
address.city | string | Si | | Ciudad |
address.street_number | string | Si | | street1 number |
address.street | string | Si | | street1 |
address.neighborhood | string | no | | street2 |
user_ip | string | no | | Dirección IP de usuario(requerido por Tarjeta de crédito) |
website_url | string | no | 128 | URL de website del merchant |
# Ejemplo de solicitud
curl --location --request POST 'https://gateway.transfersmile.com/trade/create' \
--header 'Authorization: Basic Base64(appid:security_key)' \
--header 'Content-Type: application/json' \
--data-raw '{
"app_id": "app_id",
"content": "content",
"method": "Boleto",
"notify_url": "notify_url",
"order_amount": 10,
"order_currency": "BRL",
"out_trade_no": "{{$randomUUID}}",
"subject": "subject",
"timeout_express": "1h",
"timestamp": "{{datetime}}",
"customer": {
"name": "name",
"email": "email",
"phone": "phone",
"identify": {
"number":"number",
"type":"type“,
}
...
},
"address": {
"zip_code": "84043450",
"state": "Parana",
"city": "Ponta Grossa",
"street"; "Colônia Dona Luíza",
"street_number": "18",
},
"user_ip": "127.0.0.1"
}'
# Http Response (formato JSON )
Parametro | Tipo | Descripción |
---|---|---|
code | string | código retornado |
msg | string | retornado msg |
sub_code | string | retornado sub code(sólo error) |
sub_msg | string | retornado sub msg(sólo error) |
out_trade_no | string | request out_trade_no |
trade_no | string | transfersmile NO. de transacción |
trade_status | string | |
pay_url | string | pay URL; sólo en Boleto、Lottery、DepositExpress |
<!-- reference | string | The value of reference is the ticket number that the user needs to use for payment |
barcode | string | Boleto barcode;o en Boleto |
qr_code | string | Sólo en PIX |
<!-- qr_code_url | string | System generated images of qr code which can be used directly on merchant website depending on needs. |
<!-- qr_code_img | string | System generated images of qr code which can be used directly on merchantwebsite depending on needs. |
provider_owner | string | banco info : dueño de cuenta; sólo en DepositExpress |
provider_owner_document | string | banco info : documento de dueño de cuenta; sólo en DepositExpress |
provider_agency | string | banco info : agencia de banco; sólo en DepositExpress |
provider_number | string | banco info : número de cuenta; sólo en DepositExpress |
<!-- partner_code | string | The value of reference is the ticket number that the user needs to use for payment |
bank_name | string | banco info : nombre de banco; sólo en DepositExpress |
<!-- bank_no | string | Users only need to use the value of bank_no to finish payment at loterica store |
<!-- bank_code | string | The ticket number that the user needs to use for payment |
<!-- clabe | string | Unique automatically generated bank account |
wallet_url | string | Sólo en Wallet |
app_link_url | string | Sólo en Wallet (para uso de APP) |
instruction | string | Take the recipient's bank details from the response parameter - "instruction" and present to users |
# Return Code (Exitoso)
{
"code": "10000",
"msg": "Success",
"out_trade_no": "{out_trade_no}",
"trade_no": "{trade_no}",
"trade_status": "PROCESSING",
"pay_url": "https://checkout-testv2.transfersmile.com/checkout?prepay_id=XX",
"barcode": "{barcode}",
"qr_code": "{qr_code}",
"provider_owner": "{provider_owner}",
"provider_owner_document": "{provider_owner_document}",
"provider_agency": "{provider_agency}",
"provider_number": "{provider_number}",
"wallet_url": "{wallet_url}",
"app_link_url": "{app_link_url}"
}
# Return Code (Fallido)
{
"code": "40002",
"msg": "Business Failed",
"sub_code": "invalid-signature",
"sub_msg": "invalid signature"
}
Atención
Return_url no es necesario en los parámetros de solicitud, también puede anexar el return_url después de la web_url cuando se redirige:
http://checkout.transfersmile.com?prepay_id={$prepay_id}
↓↓↓
http://checkout.transfersmile.com?prepay_id={$prepay_id}&return_url={$return_url}