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

# Create Masivo TOTP

> Ask Masivo for a one-time code for a Masivo customer.

Creates a Masivo TOTP for a Masivo `customer_id`. Spark authorizes with the merchant's server API key, keeps that bearer token on the server, and returns Masivo's `data` unchanged (`code`, `expired_at`, `seconds_left`).

> [!NOTE]
>
> Requires a Fire spark access token from [token
> exchange](https://firespark.cloud/docs/storefront-api/oauth/exchange/post.md). There is no channel or
> integration toggle for this route. It works when this environment has an
> active Masivo connection, and returns `409` `MASIVO_NOT_CONNECTED` otherwise.

Only `customer_id` is sent to Masivo. Do not send metadata. Spark does not write the code onto an order.

## Request body

| Field | Required | Description |
| - | - | - |
| `customer_id` | Yes | Masivo customer id. Trimmed, 1–128 characters. |

## Request

```bash theme={null}
curl -X POST "https://firespark.cloud/api/storefront/v1/masivo/totp" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"customer_id":"masivo-customer-id"}'
```

## Response

`201` with Masivo's `data` object.

```json theme={null}
{
  "data": {
    "code": "1234",
    "expired_at": "2026-11-11T18:30:00.000Z",
    "seconds_left": 300
  }
}
```

An unknown customer is `404`. Spark keeps Masivo's `error` and `details`. Other Masivo failures use the same shape: client errors keep Masivo's status, and rate limits or server errors become `502`.

No active Masivo connection for this merchant and environment:

```json theme={null}
{
  "error": "This merchant has no Masivo connection.",
  "code": "MASIVO_NOT_CONNECTED",
  "details": { "code": "MASIVO_NOT_CONNECTED" }
}
```

The `error` text follows `Accept-Language` (`es`, `en`, or `pt`). The code stays `MASIVO_NOT_CONNECTED`. Verify the code with [Verify Masivo TOTP](https://firespark.cloud/docs/storefront-api/masivo/totp/verify/get.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.