Visa Simulator API

This application simulates Visa card issuance, validation, and transaction processing with a RESTful JSON API. All responses mimic real Visa API formats.

Authentication: All endpoints except POST /auth.php require a Bearer token. Obtain a token by calling POST /auth.php with credentials, then include Authorization: Bearer {token} in the header.
Use the API credentials configured on the server. Do not expose production credentials in public documentation.

Supported Card Types

Endpoints

1. Get Token (Login)

POST /auth.php

{
    "username": "your_api_username",
    "password": "your_api_password"
}

2. Issue Card

POST /issue.php

Automatic generation (based on card type):

{
    "card_type": "virtual_classic"
}

Register with provided full details:

{
    "card_number": "4060020112345678",
    "cvv2": "123",
    "exp_date": "05/2029",
    "card_type": "virtual_classic" // optional
}

3. Validate Card

POST /validate.php

{
    "card_number": "4060020112345678",
    "cvv2": "123",
    "exp_date": "05/2029"
}

4. List Cards

GET /cards_list.php?page=1&limit=20

5. Get Card Details

POST /get_card.php

{
    "card_number": "4060020112345678"
}

6. Block Card

POST /block.php

{
    "card_number": "4060020112345678"
}

7. Unblock Card

POST /unblock.php

8. Authorize Transaction

POST /authorize.php

{
    "card_number": "4060020112345678",
    "amount": "150.00",
    "currency": "USD"
}

9. Capture Transaction

POST /capture.php

{
    "transaction_identifier": "trx_..."
}

10. Refund

POST /refund.php

{
    "card_number": "4060020112345678",
    "amount": "50.00"
}

11. Void Transaction

POST /void.php

{
    "transaction_identifier": "trx_..."
}

Response Codes