> 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/in-store-api/getting-started.md).

# Getting Started

Consider these points about the In-Store API integration path:

## Obtain API Credentials

Before integrating Aplazo into your point-of-sale (POS) system, you will need credentials to authenticate your requests.

* **Merchant ID** and **API Token**: These will be provided by our commercial team once you complete your onboarding process.
* If you have not yet received your credentials or need additional details, please email <soporte-integraciones@aplazo.mx>.

***

## Authentication

Unlike the Online API, the In-Store API does not require session-based or Bearer token generation. Instead, **all requests** must include the following headers:

* `api_token: {yourAPIToken}`
* `merchant_id: {yourMerchantId}`

**Example Request**

```bash
curl --location 'https://merchant.aplazo.net/merchant/create-branch' \
--header 'merchant_id: 1234' \
--header 'api_token: fbb6fe4d-7c63-4dbe-bfd9-cd0f945af8c5' \
--header 'Content-Type: application/json' \
--data '{
    "branches": [
        "Tienda Norte",
        "Tienda Sur"
    ]
}'
```

Make sure to replace the sample `api_token` and `merchant_id` with your own credentials.

***

## Environments

### **Development Environment**

You can test and validate all scenarios in our development environment before going live.

| Endpoint                                                                                                                          | Description                                        | Development Server                                          |
| --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | ----------------------------------------------------------- |
| [`POST` /api/pos/loan](/aplazo-integrations/api-reference/in-store-api/create-a-payment.md)                                       | Creates a new payment.                             | [https://api.aplazo.net](https://api.aplazo.net/)           |
| [`GET` /api/pos/loan/{cartId}](/aplazo-integrations/api-reference/in-store-api/get-payment-status.md)                             | Retrieves the current status of a payment.         | [https://api.aplazo.net](https://api.aplazo.net/)           |
| [`POST` /api/pos/loan/cancel](/aplazo-integrations/api-reference/in-store-api/cancel-payment.md)                                  | Cancels an existing payment using the `cartId`.    | [https://api.aplazo.net](https://api.aplazo.net/)           |
| [`POST` /api/pos/loan/refund](/aplazo-integrations/api-reference/in-store-api/request-a-refund.md)                                | Initiates a refund for a payment.                  | [https://api.aplazo.net](https://api.aplazo.net/)           |
| [`GET` /api/pos/loan/refund/{cartId}](/aplazo-integrations/api-reference/in-store-api/get-refund-status.md)                       | Retrieves the refund status history for a cart.    | [https://api.aplazo.net](https://api.aplazo.net/)           |
| [`POST` /merchant/create-b](/aplazo-integrations/api-reference/in-store-api/register-store-or-branch.md)                          | Registers merchant stores and receives branch IDs. | [https://merchant.aplazo.net](https://merchant.aplazo.net/) |
| [`POST` /merchant/send-checkout/{cartId}](/aplazo-integrations/api-reference/in-store-api/resend-checkout-via-sms-or-whatsapp.md) | Resends the checkout URL to the customer.          | [https://merchant.aplazo.net](https://merchant.aplazo.net/) |
| [`GET` /api/v1/loan/checkout-url](/aplazo-integrations/api-reference/in-store-api/get-checkout-qr-code.md)                        | Generates a QR code for payment checkout.          | [https://merchant.aplazo.net](https://merchant.aplazo.net/) |

### **Production Environment**

After thorough testing and certification of your integration, you can switch to production and start offering installment payments to your customers.

{% hint style="warning" %}
When switching to our production environment, replace the `.net` top-level domain for `.mx`&#x20;
{% endhint %}

***

## Webhooks

For each payment request you send, you'll have to provide Aplazo with the URL where you want to receive webhook notifications.

When a payment is completed, Aplazo will send a real-time notification to your configured endpoint, allowing you to keep your system up to date.

### Webhook Security

* **IP Whitelisting**: If necessary, you can whitelist the static IP addresses from which Aplazo sends webhooks.
* **Authentication**: Aplazo supports sending either Basic or Bearer authentication headers in webhooks for added security.

[\[View Webhook Documentation →\]](/aplazo-integrations/api-reference/webhook-confirmation.md)
