> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mx.ntxpay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Started

> Welcome to the NTX Pay Mexico API. This guide walks you through the first steps to integrate and start using SPEI.

## Overview

The NTX Pay Mexico API lets your company execute payment operations, reconcile transactions, and receive webhook notifications — all in a secure and scalable way. Authentication uses an **X.509 certificate (mTLS) + OAuth 2.0**, returning a short-lived **JWT** for each request.

## Step by Step in the Sandbox

<Steps>
  <Step title="Request a sandbox account">
    Contact your account manager or write to `contact@ntxpay.com` to request a sandbox account.
  </Step>

  <Step title="Receive your credentials">
    You will receive a **certificate** and the **OAuth credentials** (`clientId` + `clientSecret`) associated with the sandbox account.
  </Step>

  <Step title="Register your webhook URL">
    Register your webhook URL via `POST /api/webhooks-config` to receive simulated events.

    ```bash theme={"system"}
    curl -X POST https://sandbox.mx.ntxpay.com/api/webhooks-config \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "url": "https://meu-servidor.com/webhooks/ntxpay",
        "events": ["cash_in"]
      }'
    ```
  </Step>

  <Step title="Authenticate and simulate scenarios">
    Authenticate, make API calls, and use the `X-Sandbox-Scenario` header to simulate different outcomes (immediate confirmation, failure, expiration, etc.).

    ```bash theme={"system"}
    curl -X POST https://sandbox.mx.ntxpay.com/api/spei/cash-in \
      -H "Authorization: Bearer $TOKEN" \
      -H "X-Sandbox-Scenario: rejected" \
      -H "Content-Type: application/json" \
      -d '{
        "amountCentavos": 50000,
        "externalId": "order-001",
        "customerName": "Juan Perez",
        "customerEmail": "juan@example.com"
      }'
    ```
  </Step>
</Steps>

## Environment

| Environment | URL                             |
| ----------- | ------------------------------- |
| Sandbox     | `https://sandbox.mx.ntxpay.com` |
| Production  | `https://api.mx.ntxpay.com`     |

## Integration Path

<CardGroup cols={2}>
  <Card title="Authentication" href="/en/guides/authentication">
    Certificate + OAuth 2.0 to obtain the JWT
  </Card>

  <Card title="SPEI Cash-In" href="/en/guides/spei-cash-in">
    Receive payments via a disposable CLABE
  </Card>

  <Card title="Webhooks" href="/en/guides/webhooks/overview">
    Receive notifications for every event
  </Card>

  <Card title="Sandbox" href="/en/sandbox/introduction">
    Test scenarios and simulated webhooks
  </Card>
</CardGroup>

## Support

`suporte@ntxpay.com`
