Testing in the sandbox
Test your integration in the sandbox with test cards before you go live.
On this page
The sandbox is a test environment of the Easyflow API. Charges created there don’t move real money, and card payments are approved or refused according to the test card you use.
Base URL and credentials
| Environment | Base URL |
|---|---|
| Production | https://9iq81tsdy4.execute-api.sa-east-1.amazonaws.com |
| Sandbox | https://vl7qx1ndr5.execute-api.us-east-1.amazonaws.com |
The sandbox has the same endpoints, headers and request bodies as production. Only the base URL changes.
Sandbox credentials are different from your production credentials. Ask the Easyflow team for your sandbox API key, API secret and business identifier.
Data you create in the sandbox can be erased when the environment is reset. Don’t use it to keep records.
Test cards
These cards are approved in the sandbox:
| Brand | flag value |
Card number |
|---|---|---|
| Mastercard | mastercard |
5480832801033311 |
| Visa | visa |
4235647728025682 |
| American Express | american-express |
375365153556885 |
| Elo | elo |
5067766783888311 |
Any other card number is refused, including test cards from other payment providers.
The sandbox only checks the card number. Use any holder name, a future expiration date and any security code with 3 digits, or 4 digits for American Express.
Testing a card payment
Follow the credit card flow and send the requests to the sandbox base URL.
Encrypt a test card with the Easyflow JavaScript SDK:
const encryptedCard = await window.easyflowSDK.encrypt({
cardNumber: '5480832801033311',
holderName: 'MARIA SILVA',
month: '12',
year: '2035',
cvv: '123',
});Then create the charge in the sandbox with the encrypted token:
curl --request POST \
--url 'https://vl7qx1ndr5.execute-api.us-east-1.amazonaws.com/orders/create-charge' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_SANDBOX_API_KEY' \
--header 'x-api-secret: YOUR_SANDBOX_API_SECRET' \
--data '{
"businessId": "YOUR_SANDBOX_BUSINESS_ID",
"items": [
{
"name": "Premium plan",
"description": "Monthly subscription to the premium plan",
"quantity": 1,
"priceInCents": 4990
}
],
"payments": [
{
"method": "credit-card",
"numberInstallments": 1,
"valueInCents": 4990,
"creditCard": {
"token": "ENCRYPTED_CARD_TOKEN",
"flag": "mastercard",
"last4Numbers": "3311",
"expiresAtMonth": 12,
"expiresAtYear": 2035,
"holderName": "MARIA SILVA"
}
}
]
}'With a test card, the payment is approved and the order changes to paid. Follow it as described in Following the payment.
What the sandbox doesn’t simulate
- The amount of the charge doesn’t change the result. Only the card number decides if the payment is approved or refused.
- Refusals by fraud analysis.
- Refunds and chargebacks of card payments.