> For the complete documentation index, see [llms.txt](https://aplazo.gitbook.io/aplazo-integrations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aplazo.gitbook.io/aplazo-integrations/testing-and-qa.md).

# Testing & QA

This section provides details on how to test Aplazo’s payment flows, applicable to both the Online API and the In-Store API.

## Testing Data

To test payments as a user, a registered phone number is required, along with a card to set up the payment method. Below is an overview of each requirement, with links to the corresponding sections for more details.

* **Registering a Test Account**: A phone number must be registered to test transactions.
* **Adding a Test Payment Method**: A test card must be set up to enable payments.

### Test Accounts

#### Registering a Test Phone Number

To test Aplazo's payment flows, you need a phone number registered in the system. The Integrations Team can register your requested test phone numbers upon request at [**soporte-integraciones@aplazo.mx**](mailto:soporte-integraciones@aplazo.mx).

* In the testing environment, you can bypass the OTP verification by entering **`123456`**.
* Any phone number can be registered, including random numbers. However, to receive the checkout URL message via **SMS** or **WhatsApp**, you must use a real phone number.
* When using the [In-Store API](/aplazo-integrations/in-store-api/overview.md), the payment does not have to be completed with the same phone number used in the [create payment](/aplazo-integrations/api-reference/in-store-api/create-a-payment.md) request.

#### Simulating User Credit Limits

Test users have a mock credit limit, which can be exhausted during testing. If you run out of available credit:

1. Log in to [**Aplazo's Customer Portal**](https://customer.aplazo.net/) to simulate paying pending payments, using the same phone number and OTP to log in.
2. Alternatively, contact [**soporte-integraciones@aplazo.mx**](mailto:soporte-integraciones@aplazo.mx) to request a reset of the test account.

### Test Card Data

The first time you try to make a payment, you'll need to set up a test card. Use the following:

* **Card Number**: `4242 4242 4242 4242`
* **CVV/CVC**: `123`
* **Expiration Date**: Any future date

The test card is only required as a first time setup.

## Checkout Flow for Users

A step-by-step guide to the checkout experience:

{% stepper %}
{% step %}

### User initiates checkout with Aplazo

User initiates checkout with Aplazo, either by redirect ([Online API](/aplazo-integrations/online-api/overview.md)) or getting the checkout url via sms/whatsapp/QR Code ([In-Store API](/aplazo-integrations/in-store-api/overview.md)).

<div align="center" data-full-width="false"><figure><img src="https://1083542398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fkw5JIHAGdl5dlteKuPH4%2Fuploads%2Fk7GVQe8bogn0xUwfRe8J%2FIMG_7931.PNG?alt=media&amp;token=167ca5df-715d-4b97-b8d0-3d823fedabbc" alt="" width="188"><figcaption><p>If the user is new, then it'll go through the onboarding process</p></figcaption></figure></div>
{% endstep %}

{% step %}

### User enters phone number and OTP

<figure><img src="https://1083542398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fkw5JIHAGdl5dlteKuPH4%2Fuploads%2FMPM48qVajXrV7ERoI0hS%2FIMG_7933.PNG?alt=media&amp;token=fb8a21a1-02b2-4fb0-b631-3b4f7295f720" alt="" width="188"><figcaption><p>OTP can be bypassed using <code>123456</code> in testing</p></figcaption></figure>
{% endstep %}

{% step %}

### Register card (one-time setup)

<figure><img src="https://1083542398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fkw5JIHAGdl5dlteKuPH4%2Fuploads%2FDAjCm6IR3HSwM929il4h%2FIMG_7937.PNG?alt=media&amp;token=499c2a64-1bcd-4853-b127-2ab6cea1044e" alt="" width="188"><figcaption><p>One-time setup</p></figcaption></figure>

[Test Card Data](#test-card-data)

<figure><img src="https://1083542398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fkw5JIHAGdl5dlteKuPH4%2Fuploads%2FzlZwOwNIax9ONT7xy73J%2Fimage.png?alt=media&amp;token=2c4101b1-5b31-49e4-9efb-8eaf63d7ccc8" alt="" width="188"><figcaption><p>For testing, use the test card described in this guide</p></figcaption></figure>

<figure><img src="https://1083542398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fkw5JIHAGdl5dlteKuPH4%2Fuploads%2FFhbyNe9Q9OSCeWjZ43DW%2FIMG_7939.PNG?alt=media&amp;token=40758899-fc22-416c-bdcb-4a918e513617" alt="" width="188"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Review installment plan and confirm first payment

<figure><img src="https://1083542398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fkw5JIHAGdl5dlteKuPH4%2Fuploads%2FPo3g9rOkmsHq7AGMDUwK%2Fimage.png?alt=media&amp;token=ab1b53d2-e0bc-4fc4-bd9f-3ea28cefcfb3" alt="" width="188"><figcaption><p>User always pays first installment upfront</p></figcaption></figure>
{% endstep %}

{% step %}

### Complete purchase

For the Online Experience, the user will be redirected to whatever successUrl the merchant configured.&#x20;

For the In-Store Experience, the user will see Aplazo's confirmation page and continue the process with the cashier at the retailer's location.
{% endstep %}
{% endstepper %}

## Testing Webhooks

If you want to inspect webhook payloads before integrating them into your system, you can use a free online webhook testing service, such as:

* [webhook.site](https://webhook.site/)
* [webhook-test.com](https://webhook-test.com/)

These services allow you to capture and examine webhook events without any development effort.

For further assistance, contact [**soporte-integraciones@aplazo.mx**](mailto:soporte-integraciones@aplazo.mx).

{% hint style="warning" %}
⚠️ Sandbox limitations: The following endpoints are non-functional in sandbox and return HTTP 403:

* `GET /api/v1/loan/checkout-url`
* `POST /merchant/send-checkout/{cartId}`

These endpoints require production credentials to work.
{% endhint %}
