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

# Create



## OpenAPI

````yaml /openapi.yml post /api/v2/subscriptions
openapi: 3.0.3
info:
  title: Gateway API
  version: v2
  contact:
    name: Support
    email: support@paybyrd.com
  license:
    name: Copyright © Paybyrd
  termsOfService: https://paybyrd.com/en/privacy
servers:
  - url: https://gateway.paybyrd.com
    description: Production
security:
  - authByApiKey: []
paths:
  /api/v2/subscriptions:
    post:
      tags:
        - Subscription
      summary: Create
      operationId: api-subscription-create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionRequest'
            examples:
              Request Example:
                $ref: '#/components/examples/CreateSubscriptionRequestExample'
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                Result:
                  $ref: '#/components/examples/CreateSubscriptionResponseExample'
              schema:
                $ref: '#/components/schemas/CreateSubscriptionResponse'
      deprecated: false
components:
  schemas:
    CreateSubscriptionRequest:
      type: object
      required:
        - currency
        - interval
        - intervalType
        - isoAmount
        - productDescription
        - startDate
      properties:
        currency:
          type: string
          description: Valid ISO-4217 alpha code e.g EUR
        endDate:
          type: string
          description: Defines the end of recurring
          format: date
        interval:
          type: integer
          format: int32
        intervalType:
          type: string
          enum:
            - daily
            - weekly
            - monthly
            - yearly
        isoAmount:
          type: integer
          description: The value of the recurring in ISO format (in cents).
          format: int64
        orderRef:
          type: string
          description: The merchant's order reference related with the recurring.
        productDescription:
          type: string
          description: The product description that recurring is referred.
        startDate:
          type: string
          description: Defines the start of recurring
          format: date
        timeZone:
          type: string
          description: >-
            The recurrence timezone, normally associated with the subscriber
            timezone
    CreateSubscriptionResponse:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/PaybyrdCode'
        description:
          $ref: '#/components/schemas/PaybyrdDescription'
        subscriptionId:
          type: string
          description: >-
            This field contains the unique identifier that represents the
            created recurring.
          example: e034b994-1c2b-4550-bb59-7891abe41617
        operationStatus:
          type: string
          example: Success
        currency:
          type: string
          description: Valid ISO-4217 alpha code e.g EUR
        endDate:
          type: string
          description: Defines the end of recurring
          format: date
        interval:
          type: integer
          format: int32
        intervalType:
          type: string
          enum:
            - daily
            - weekly
            - monthly
            - yearly
        isoAmount:
          type: integer
          description: The value of the recurring in ISO format (in cents).
          format: int64
        orderRef:
          type: string
          description: The merchant's order reference related with the recurring.
        productDescription:
          type: string
          description: The product description that recurring is referred.
        startDate:
          type: string
          description: Defines the start of recurring
          format: date
        timeZone:
          type: string
          description: >-
            The recurrence timezone, normally associated with the subscriber
            timezone  
        checkoutUrl:
          type: string
          description: The redirect URL to proceed with the payment via Paybyrd Checkout.
    PaybyrdCode:
      type: string
      description: >-
        Represents the Paybyrd code of the web request. To see more details
        check in [Return Codes](ref:appendix-return-codes) page.
      example: BYRD200
      enum:
        - BYRD010
        - BYRD200
        - BYRD201
        - BYRD203
        - BYRD205
        - BYRD206
        - BYRD207
        - BYRD208
        - BYRD230
        - BYRD231
        - BYRD240
        - BYRD290
        - BYRD291
        - BYRD292
        - BYRD294
        - BYRD299
        - BYRD401
        - BYRD403
        - BYRD900
        - BYRD901
        - BYRD999
    PaybyrdDescription:
      type: string
      example: Operation successfully completed
      description: >-
        Represents a textually the description of the Paybyrd code of the web
        request.  To see more details check in [Return
        Codes](ref:appendix-return-codes) page
      enum:
        - Request accepted
        - Operation successfully completed
        - Payment being processed. Waiting for shopper
        - >-
          An error occurred while processing the payment. Please query the
          transaction to confirm its status
        - Operation rejected
        - Operation blocked by velocity
        - Pending redirect
        - Payment canceled by the shopper
        - Payment already refunded
        - >-
          The refund amount exceeds the remaining balance of the original
          payment
        - Token is expired
        - >-
          An error occurred while pre processing the transaction. Please review
          your request and try again
        - >-
          An error occurred during while preparing transaction for acquiring.
          Please review your request and try again
        - >-
          No payment methods available for this operation. Please contact
          Paybyrd's support
        - >-
          Transaction could not be updated. Please review your request and try
          again
        - >-
          Operation could not be completed. Please review your request and try
          again
        - Resource access is forbidden
        - Resource access unauthorized
        - Invalid input
        - Resource not found
        - Operation failed
  examples:
    CreateSubscriptionRequestExample:
      value:
        personId: 10
        isoAmount: 1000
        currency: EUR
        orderRef: AMZ1962
        productDescription: Spider-Man HQ subscription
        intervalType: monthly
        interval: 1
        startDate: '1962-08-15'
        endDate: '2082-08-15'
        timeZone: Europe/Berlin
    CreateSubscriptionResponseExample:
      value:
        code: BYRD200
        description: Operation successfully completed
        operationStatus: Success
        subscriptionId: 435483a2-78b5-49e3-8f37-cd1c18834e02
        isoAmount: 1000
        currency: EUR
        orderRef: AMZ1962
        productDescription: Spider-Man HQ subscription
        intervalType: monthly
        interval: 1
        startDate: '1962-08-15'
        endDate: '2082-08-15'
        timeZone: Europe/Berlin
        checkoutUrl: https://link.paybyrd.com/sub_Kr6ZKx8uD
  securitySchemes:
    authByApiKey:
      type: apiKey
      in: header
      name: x-api-key

````