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

# Initiate Subscription

> To complete this transaction, merchant is expected to redirect to the 3DSecure site via the redirect URL provided with the response below. However if the redirect url is not returned and the code is S20 and the message is transaction is pending, the Validate OTP endpoint should be called as the customer would have received a token either by email or sms on the customers phone. To get the subscription created or the status of a subscription for the customer, the GET Subscription endpoint is called by passing the paymentReference as billingId.



## OpenAPI

````yaml https://raw.githubusercontent.com/seerbit/openapi/master/specs/external-api.yml post /recurring/subscribes
openapi: 3.0.1
info:
  title: SeerBit API Reference
  contact: {}
  version: '1.0'
servers:
  - url: https://seerbitapi.com/api/v2
security: []
tags:
  - name: AUTHENTICATION
  - name: STANDARD CHECKOUT
  - name: ORDER CHECKOUT
  - name: PAYMENT METHOD
  - name: MOMO
  - name: NON 3DS PAYMENT
  - name: CARD
  - name: ACCOUNT
  - name: TOKENIZE
  - name: AUTHORISE
  - name: PREAUTHORIZATION
  - name: RECURRENT
paths:
  /recurring/subscribes:
    post:
      tags:
        - RECURRENT
      summary: Initiate Subscription
      description: >-
        To complete this transaction, merchant is expected to redirect to the
        3DSecure site via the redirect URL provided with the response below.
        However if the redirect url is not returned and the code is S20 and the
        message is transaction is pending, the Validate OTP endpoint should be
        called as the customer would have received a token either by email or
        sms on the customers phone. To get the subscription created or the
        status of a subscription for the customer, the GET Subscription endpoint
        is called by passing the paymentReference as billingId.
      operationId: InitiateSubscription
      requestBody:
        content:
          application/json:
            schema:
              type: object
            examples:
              InitiateSubscriptionRequest:
                $ref: '#/components/examples/InitiateSubscriptionRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitiateSubscriptionResponse'
        '400':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                type: object
              examples:
                400Response:
                  $ref: '#/components/examples/400Response'
                400Response1:
                  $ref: '#/components/examples/400Response12'
                400Response3:
                  $ref: '#/components/examples/400Response13'
                400Response4:
                  $ref: '#/components/examples/400Response14'
                400Response5:
                  $ref: '#/components/examples/400Response15'
                400Response6:
                  $ref: '#/components/examples/400Response16'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
              examples:
                401Response:
                  $ref: '#/components/examples/401Response'
        '403':
          description: Missing Header Token
          content:
            application/json:
              schema:
                type: object
              examples:
                CreateOrder403Response:
                  $ref: '#/components/examples/Order403Response'
                403Response:
                  $ref: '#/components/examples/403Response'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
              examples:
                400Response:
                  $ref: '#/components/examples/404Response'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
              examples:
                409Response:
                  $ref: '#/components/examples/409Response'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
              examples:
                500Response:
                  $ref: '#/components/examples/500Response'
      deprecated: false
      security:
        - Bearer: []
components:
  examples:
    InitiateSubscriptionRequest:
      summary: Initiate Subscription Request payload
      value:
        publicKey: SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u
        paymentReference: TPR2181t55PKR540RPP1U1W4392WO
        planId: ''
        cardNumber: '5123450000000008'
        expiryMonth: '05'
        callbackUrl: https://www.google.com
        expiryYear: '21'
        cvv: '100'
        amount: '1000.00'
        currency: NGN
        productDescription: Pilot Test Subscription
        productId: Terrain
        country: NG
        startDate: '2020-02-25 00:00:00'
        cardName: Kolade Samuel
        billingCycle: WEEKLY
        email: akintoyekolawole@gmail.com
        mobileNumber: 8033456500
        customerId: '12345678901234'
        pin: 999
        type: 3DSECURE
        billingPeriod: '1'
        subscriptionAmount: true
    400Response:
      summary: An example of 400 response payload
      value:
        message: Bad Request
        error: There has been a problem with reading or understanding the request.
    400Response12:
      summary: An example of 400 response payload
      value:
        message: Payment Reference cannot be null
        error: INPUT
    400Response13:
      summary: An example of 400 response payload
      value:
        message: Amount cannot be null
        error: INPUT
    400Response14:
      summary: An example of 400 response payload
      value:
        message: Public Key cannot be null
        error: INPUT
    400Response15:
      summary: An example of 400 response payload
      value:
        message: Country cannot be null
        error: INPUT
    400Response16:
      summary: An example of 400 response payload
      value:
        message: Currency cannot be null
        error: INPUT
    401Response:
      summary: An example of 401 response payload
      value:
        message: Invalid Authentication Token
        error: INPUT
    Order403Response:
      summary: An example of 403 response payload
      value:
        message: Header Token Missing
        error: PERMISSION
    403Response:
      summary: An example of 403 response payload
      value:
        message: Confirm Merchant Environment
        error: PERMISSION
    404Response:
      summary: An example of 404 response payload
      value:
        error: Not Found
    409Response:
      summary: An example of 409 response payload
      value:
        message: Transaction with reference exists
        error: PROCESSING
    500Response:
      summary: An example of 500 response payload
      value:
        message: Internal Server Error
        error: PROCESSING
  schemas:
    InitiateSubscriptionResponse:
      title: InitiateSubscriptionResponse
      type: object
      example:
        status: SUCCESS
        data:
          code: S20
          payments:
            paymentReference: TPR2181t55PER540RPP1U1W4392WO
            linkingReference: F365652421603189345033
            redirectUrl: >-
              https://staging.seerbitapigateway.com/seerbit/card-dispatch?sredref=F365652421603189345033
          message: Transaction is pending
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````

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