# Creating Charges

There are two ways to create a charge via the API: using **inline data**, or using **stored customer and instrument objects**. Both approaches submit to the same `/charges` endpoint.

## Option 1: Inline Charge

The simplest approach — provide the customer and instrument details directly in the charge request. No pre-existing customer or instrument objects are needed.

Use this when you don't need to store or reuse customer and instrument data, or when you're migrating from a system that already holds this information.

### Request


```bash
curl -X POST https://directdebit.monato.com/charges \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --data '{
    "currency": "mxn",
    "amount": 100,
    "reference": "subscription-0235",
    "inline_instrument": {
      "type": "mx_clabe",
      "identifier": "012180015118333755"
    },
    "inline_customer": {
      "name": "John Doe",
      "document_type": "mx_rfc",
      "document_number": "AABB220089"
    }
  }'
```

### Response


```json
{
  "id": "683b4a12-ebf9-40c2-9226-f97f4b7782ab",
  "org_id": "a0f63202-178c-40fd-8e5b-291c99251a38",
  "status": "pending",
  "amount": 100.0,
  "currency": "mxn",
  "reference": "subscription-0235",
  "instrument_id": null,
  "customer_id": null,
  "inline_instrument": {
    "type": "mx_clabe",
    "identifier": "012180015118333755",
    "bank": null
  },
  "inline_customer": {
    "name": "John Doe",
    "document_type": "mx_rfc",
    "document_number": "AABB220089",
    "email": null,
    "phone_number": null
  },
  "declined_reason": null,
  "declined_reason_rail": null,
  "created_at": "2025-09-29T19:46:27.036739Z",
  "updated_at": null,
  "result_at": null,
  "chargeback_at": null
}
```

The charge is created with a `pending` status. Save the `id` — you'll use it to correlate the incoming webhook event.

### Result Webhook

When the charge is processed by the banking network, the platform sends a `charge_result` webhook event to your configured endpoint:


```json
{
  "event": "charge_result",
  "timestamp": "2025-09-30T12:19:18.086265Z",
  "data": {
    "charge_id": "683b4a12-ebf9-40c2-9226-f97f4b7782ab",
    "charge_result": "confirmed",
    "charge_reference": "subscription-0235"
  }
}
```

See [Charge Statuses](/products/directdebit/content/reference/charge-statuses) for all possible result values and their meanings.

## Option 2: Charge with Stored Objects

Create the charge by referencing a stored [customer](/products/directdebit/content/guides/api/customers) and [instrument](/products/directdebit/content/guides/api/instruments) object. This approach enables filtering charges by customer or instrument, and delegates tokenisation of payment data to the Monato platform.

### Step 1 — Create the customer


```bash
curl -X POST https://directdebit.monato.com/customers \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --data '{
    "name": "John Doe",
    "document_type": "mx_rfc",
    "document_number": "AABB220089",
    "email": "john.doe@example.com"
  }'
```

Response — save the `id`:


```json
{
  "id": "f89c42d8-cd5d-4d51-bf2a-daa66b993d31",
  "org_id": "a0f63202-178c-40fd-8e5b-291c99251a38",
  "name": "John Doe",
  "document_type": "mx_rfc",
  "document_number": "AABB220089",
  "email": "john.doe@example.com",
  "phone_number": null,
  "customer_metadata": null,
  "created_at": "2025-09-29T19:48:32.019743Z",
  "updated_at": null
}
```

### Step 2 — Create the instrument


```bash
curl -X POST https://directdebit.monato.com/instruments \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --data '{
    "type": "mx_direct_debit_card",
    "customer_id": "f89c42d8-cd5d-4d51-bf2a-daa66b993d31",
    "mx_direct_debit_card": {
      "card_number": "012180015118333755",
      "bank": "mx_santander"
    }
  }'
```

Response — save the `id`:


```json
{
  "id": "1208f1c1-71a9-4f44-95ac-4207d028a096",
  "org_id": "a0f63202-178c-40fd-8e5b-291c99251a38",
  "customer_id": "f89c42d8-cd5d-4d51-bf2a-daa66b993d31",
  "type": "mx_direct_debit_card",
  "status": "active",
  "mx_direct_debit_card": {
    "card_number": "012180015118333755",
    "bank": "mx_santander"
  },
  "mx_clabe": null,
  "currency": "mxn",
  "description": null,
  "ownership_verification_result": null,
  "ownership_verification_result_at": null,
  "created_at": "2025-09-29T19:49:08.119336Z",
  "updated_at": null
}
```

:::info Penny Validation
For new instruments, the platform automatically initiates a penny validation to verify account ownership. You'll receive an `instrument_verification_result` webhook event when it completes. You can proceed to submit charges while validation is in progress. See [Instruments](/products/directdebit/content/guides/api/instruments#penny-validation) for details.
:::

### Step 3 — Create the charge


```bash
curl -X POST https://directdebit.monato.com/charges \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --data '{
    "currency": "mxn",
    "amount": 100,
    "customer_id": "f89c42d8-cd5d-4d51-bf2a-daa66b993d31",
    "instrument_id": "1208f1c1-71a9-4f44-95ac-4207d028a096"
  }'
```

Response:


```json
{
  "id": "5585940c-3999-4dd6-b975-7fa7dbf164c8",
  "org_id": "a0f63202-178c-40fd-8e5b-291c99251a38",
  "status": "pending",
  "amount": 100.0,
  "currency": "mxn",
  "reference": null,
  "instrument_id": "1208f1c1-71a9-4f44-95ac-4207d028a096",
  "customer_id": "f89c42d8-cd5d-4d51-bf2a-daa66b993d31",
  "inline_instrument": null,
  "inline_customer": null,
  "declined_reason": null,
  "declined_reason_rail": null,
  "created_at": "2025-09-29T19:53:48.934627Z",
  "updated_at": null,
  "result_at": null,
  "chargeback_at": null
}
```

### Step 4 — Handle the result webhook


```json
{
  "event": "charge_result",
  "timestamp": "2025-09-30T12:19:18.086265Z",
  "data": {
    "charge_id": "5585940c-3999-4dd6-b975-7fa7dbf164c8",
    "charge_result": "declined",
    "charge_reference": null
  }
}
```