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

# Retrieve a card-on-file enrollment status

> Find out how a card-on-file enrollment ended: abandoned by the payer, refused, or failed. Enrollments created before this endpoint was released return 404.



## OpenAPI

````yaml get /subscription-intents/{id}/status
openapi: 3.0.0
info:
  title: Hub2 Service · Api
  description: |-
    This is the Hub2 api reference |
          Please check https://docs.hub2.io/ for the full documentation |
          Rate limits of endpoints are here : https://docs.hub2.io/en/details/limits.html.
  version: 2.185.0
  contact:
    name: Hub2
    url: https://www.hub2.io/
    email: contact@hub2.io
servers: []
security: []
tags:
  - name: Payments
    description: >-
      Best known as the PAY-IN API, it provides endpoints for merchants to
      perform Hub2 PAY-IN transactions.
  - name: Transfers
    description: >-
      Best known as the PAY-OUT API, it provides endpoints for merchants to
      perform Hub2 PAY-OUT transactions.
  - name: IRT
    description: International Remittance Transfers
  - name: Balance
    description: ''
  - name: Webhooks
    description: ''
  - name: Provisioning
    description: ''
  - name: Payment on Terminal
    description: ''
  - name: Receipt
    description: ''
  - name: Sms
    description: ''
  - name: Data
    description: ''
  - name: Compliance
    description: ''
  - name: Recipient
    description: ''
  - name: Delegation
    description: ''
  - name: Deposits
    description: ''
  - name: Payment Links
    description: ''
  - name: Subscription Links
    description: ''
  - name: Submerchants
    description: ''
  - name: Bill Payments
    description: ''
  - name: Subscriptions
    description: ''
  - name: Subscription Intents
    description: >-
      Enrolls a customer in card-on-file recurring debits and tracks how each
      enrollment ended.
  - name: Instant Payment
    description: >-
      Instant payment (PI SPI, BCEAO) resources, such as the aliases naming your
      accounts in the national directory.
paths:
  /subscription-intents/{id}/status:
    get:
      tags:
        - Subscription Intents
      summary: Retrieve a card-on-file enrollment status
      description: >-
        Resolves how an enrollment ended, at any point after its link was issued
        — so "the payer abandoned it", "it was refused" and "it broke on our
        side" are distinguishable. Enrollments created before this endpoint
        shipped have no attempt record and still answer 404.
      operationId: SubscriptionIntentsController_getEnrollmentStatus
      parameters:
        - name: id
          required: true
          in: path
          description: Id of the enrollment payment returned by POST /subscription-intents.
          schema:
            type: string
        - name: ApiKey
          in: header
          description: >-
            Your api key. To create a key, please get into our dashboard. If you
            don't have access to it, please reach the Support team.
          required: true
          schema:
            type: string
        - name: MerchantId
          in: header
          description: >-
            Your merchant ID. This information is available in our dashboard. If
            you don't have access to it, please reach the Support team.
          required: true
          schema:
            type: string
        - name: Environment
          in: header
          description: >-
            Allow you to choose between the sandbox mode to perform some tests
            or the live mode for real world transactions.
          required: true
          schema:
            type: string
            enum:
              - live
              - sandbox
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollmentStatusResponseDto'
        '401':
          description: Wrong credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorizedErrorAlias'
        '403':
          description: The merchant is closed.
        '404':
          description: >-
            No enrollment with this id belongs to the authenticated merchant in
            this mode.
        '429':
          description: 'ThrottlerException: Too Many Requests'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTooManyRequestErrorAlias'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInternalErrorAlias'
components:
  schemas:
    EnrollmentStatusResponseDto:
      type: object
      properties:
        paymentId:
          type: string
          description: >-
            Id of the underlying enrollment payment, as returned by POST
            /subscription-intents.
        status:
          type: string
          enum:
            - successful
            - failed
            - pending
            - action_required
          description: >-
            "pending" while the enrollment link has been issued but nothing came
            back yet, "action_required" once the payer has been redirected to
            the card issuer's page, "successful" once the subscription has
            actually been recorded, and "failed" when the enrollment was refused
            or could not be recorded. A payer who never completes the page stays
            "action_required" — it is never reported as "failed".
        failureCause:
          description: >-
            Present when status is "failed". Same shape and same codes as a
            regular payment's failureCause.
          allOf:
            - $ref: '#/components/schemas/PaymentFailureCauseDto'
        subscriptionId:
          type: number
          description: >-
            Present once status is "successful": the subscription id to use with
            /subscriptions endpoints (charge, cancel, suspend, transactions).
        createdAt:
          format: date-time
          type: string
          description: When the enrollment link was issued.
        updatedAt:
          format: date-time
          type: string
          description: When the enrollment last changed state.
      required:
        - paymentId
        - status
        - createdAt
        - updatedAt
    ApiUnauthorizedErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP error code.
          example: 401
        error:
          description: HTTP error description.
          allOf:
            - $ref: '#/components/schemas/InternalApiUnauthorizedError'
      required:
        - status
        - error
    ApiTooManyRequestErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: status
          enum:
            - 429
          example: 429
        error:
          type: string
          description: Error
          example: 'ThrottlerException: Too Many Requests'
      required:
        - status
        - error
    ApiInternalErrorAlias:
      type: object
      properties:
        type:
          type: string
          description: The type of this error.
          example: internal_error
        code:
          type: string
          description: The error code for this error.
          example:
            - internal_error
            - wrong_credentials
            - not_granted
            - live_mode_not_granted
        message:
          type: string
          description: The error message describing what happens to throw this error.
          example: An error occurred on our system. Please try again later.
      required:
        - type
        - code
        - message
    PaymentFailureCauseDto:
      type: object
      properties:
        code:
          type: string
          description: Unique code representing the failure cause for the payment.
          enum:
            - internal_error
            - service_unavailable
            - unknown_reason
            - customer_account_locked
            - customer_insufficient_funds
            - authentication_failed
            - authentication_timeout
            - issuer_authentication_unavailable
            - timeout
            - bad_parameters
            - forbidden_by_provider
            - too_many_request
            - duplicate_request
            - consent_reference_in_use
            - canceled_by_customer
            - canceled
            - fraud_suspicion
            - unsupported_currency
            - payer_quota_exceeded
            - invalid_payment_processor
            - invalid_amount
            - recipient_unavailable
            - msisdn_invalid
            - card_expired
            - card_declined
            - card_stolen
            - card_refused
            - card_invalid
            - card_cvn_invalid
            - address_verification_failed
            - payment_limit_reached
            - reconciliation_failure
        message:
          type: string
          description: >-
            Human readable message explaining the failure cause. This message
            can be displayed to the customer.
        params:
          description: >-
            List of parameters causing the payment failure in case of invalid
            parameters
          type: array
          items:
            type: string
      required:
        - code
        - message
    InternalApiUnauthorizedError:
      type: object
      properties:
        type:
          type: string
          description: The type of this error.
          example: authorization_error
        code:
          type: string
          description: The internal error code describing what happened.
          enum:
            - bad_payment_intent_token
            - wrong_credentials
          example: wrong_credentials
        message:
          type: string
          description: Detailed error message which describe what happened.
          example: L'ID marchand et/ou la clé d'API sont incorrects.
      required:
        - type
        - code
        - message

````

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