Credit Card
How to use CreditCard to submit a payin in Brazil.
Use the following server-side flow to submit a Credit Card payment in Brazil:
Tokenize the card details.
Submit the payment using the returned card token.
If 3DS verification is required, redirect the customer to the returned
check_url.
Step 1: Tokenize the card
Send the card details to Pagsmile and obtain a temporary card token.
Endpoint
POST https://security-test.pagsmile.com/card/tokenize
Request body
app_id
string
Yes
Maximum 32 characters.
Merchant application ID assigned by Pagsmile.
version
string
No
Fixed value: 2.0; defaults to 2.0 when omitted.
API version.
timestamp
string
Yes
Format: yyyy-MM-dd HH:mm:ss; maximum 19 characters.
Time at which the request is sent.
card.card_no
string
Yes
Maximum 32 characters.
Card number.
card.issuer
string
Yes
For example, visa or mastercard.
Card brand.
card.holder.name
string
Yes
Maximum 64 characters.
Name printed on the card.
card.cvv
string
Yes
Maximum 8 characters.
Card security code. Never store this value.
card.valid_thru_year
string
Yes
Four digits in YYYY format.
Card expiration year.
card.valid_thru_month
string
Yes
Two digits from 01 to 12.
Card expiration month.
Request example
Response example
Step 2: Submit the payment
Use the token returned in Step 1 to create and process the Credit Card payment.
Endpoint
POSThttps://gateway-test.pagsmile.com/trade/pay
Request body
app_id
string
Yes
Maximum 32 characters. Must match the application used to generate the card token.
Merchant application ID assigned by Pagsmile.
version
string
No
Fixed value: 2.0; defaults to 2.0 when omitted.
API version.
timestamp
string
Yes
Format: yyyy-MM-dd HH:mm:ss; maximum 19 characters.
Time at which the request is sent.
out_trade_no
string
Yes
Maximum 64 characters; must be unique for the merchant application.
Merchant order number.
method
string
Yes
Fixed value: CreditCard.
Payment method.
trade_type
string
Yes
Fixed value: API.
Indicates a direct API payment.
order_amount
decimal
Yes
From 0.01 to 50000.00; maximum two decimal places.
Payment amount.
order_currency
string
Yes
Fixed value: BRL.
Payment currency.
subject
string
Yes
Maximum 128 characters.
Payment subject or order title.
content
string
No
Maximum 255 characters.
Payment description.
notify_url
string
Yes
Must be a valid URL. HTTPS is recommended.
Endpoint that receives asynchronous payment notifications.
return_url
string
No
Must be a valid URL. HTTPS is recommended.
URL to which the customer is redirected after completing the payment flow.
buyer_id
string
Yes
Maximum 128 characters.
Merchant-side customer ID.
timeout_express
string
No
Supports m (minutes), h (hours), d (days), and c (end of the current day). The default is 90m and the maximum is 15d.
Time allowed for the payment to move from the initial state to processing.
token
string
Yes
Must be the unexpired psct_ token returned in Step 1.
Tokenized card details.
user_ip
string
Yes
Valid public IPv4 or IPv6 address.
Customer IP address used for risk assessment.
installments
string
No
Positive integer represented as a string; defaults to 1. Available values depend on the merchant and channel configuration.
Number of installments.
issuer
string
Yes
Must match the card brand, for example visa or mastercard.
Card brand.
Request example
Response example
Complete 3DS verification
When trade_status is RISK_CONTROLLING and check_url is returned:
Redirect the customer's browser to the complete
check_urlreturned by Pagsmile.Do not construct or modify the URL or its query parameters.
Allow the customer to complete the 3DS challenge or verification flow.
Use the payment notification or the Payin Detail API to determine the final payment status.
Last updated
Was this helpful?