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

# Request TOTP

> Some applications may need customers to authorize other systems on their behalf. With the 'totp' endpoint, customers can request a temporal code that other systems can use to confirm the customer identity.



## OpenAPI

````yaml POST /auth/totp
openapi: 3.0.1
info:
  title: Masivo's REST API
  description: Learn how to use Masivo's REST API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.masivo.ai/api/storefront/v1
security:
  - bearerAuth: []
paths:
  /auth/totp:
    post:
      description: >-
        Some applications may need customers to authorize other systems on their
        behalf. With the 'totp' endpoint, customers can request a temporal code
        that other systems can use to confirm the customer identity.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - customer_id
              properties:
                customer_id:
                  type: string
                  description: The customer unique identifier
                metadata:
                  type: object
                  description: Optional field for additional information
            example: {}
        required: true
      responses:
        '201':
          description: TOTP token created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Time base - One time password
                        example: '1234'
                      expired_at:
                        type: string
                        description: The time when the token expires
                        format: date-time
                      seconds_left:
                        type: number
                        description: The number of seconds left until the token expires
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidCoupon:
                  summary: Invalid coupon code
                  value:
                    error: Internal validation failed
                    details: Invalid coupon
                ecommerceScopeMismatch:
                  summary: Coupon is not available for the redemption scope
                  value:
                    error: Internal validation failed
                    details: >-
                      This coupon is not available for this store, channel, or
                      product.
components:
  schemas:
    Error:
      required:
        - error
        - details
      type: object
      properties:
        error:
          type: string
        details:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````