# Purchase subscription

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/subscriptions/purchase:
    post:
      summary: Purchase subscription
      deprecated: false
      description: >
        This endpoint allows you to purchase a Zapmail subscription plan using
        your wallet balance. Payment is processed exclusively through your
        wallet, with automatic recharge if enabled.



        ## Plans (Google)


        | Plan    | Mailboxes | Monthly | Quarterly                 |
        Yearly                   |

        |---------|-----------|---------|---------------------------|--------------------------|

        | Starter | 10        | \$39    | \$105 (\$35/mo)           | \$390
        (\$32.50/mo)       |

        | Growth  | 30        | \$99    | \$270 (\$90/mo)           | \$990
        (\$82.50/mo)       |

        | Pro     | 100       | \$299   | \$810 (\$270/mo)          | \$3000
        (\$250/mo)        |


        ## Plans (Microsoft)


        | Plan    | Mailboxes | Monthly | Quarterly                 |
        Yearly                   |

        |---------|-----------|---------|---------------------------|--------------------------|

        | Starter | 10        | \$39    | \$105 (\$35/mo)           | \$390
        (\$32.50/mo)       |

        | Growth  | 30        | \$99    | \$270 (\$90/mo)           | \$990
        (\$82.50/mo)       |

        | Pro     | 100       | \$299   | \$810 (\$270/mo)          | \$3000
        (\$250/mo)        |
      tags:
        - subscriptions
      parameters:
        - name: planName
          in: query
          description: ''
          required: true
          example: mvp
          schema:
            type: string
        - name: billingCycle
          in: query
          description: ''
          required: false
          example: monthly
          schema:
            type: string
        - name: x-auth-zapmail
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
        - name: x-workspace-key
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
        - name: x-service-provider
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  paymentLink:
                    type: string
                required:
                  - message
                  - paymentLink
                x-apidog-orders:
                  - message
                  - paymentLink
              example:
                message: >-
                  Plan purchase is processed successfully and invoice is
                  created.
                paymentLink: https://invoice.example.com/i/
          headers: {}
          x-apidog-name: Success
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        msg:
                          type: string
                        param:
                          type: string
                        location:
                          type: string
                      x-apidog-orders:
                        - msg
                        - param
                        - location
                required:
                  - status
                  - message
                  - errors
                x-apidog-orders:
                  - status
                  - message
                  - errors
              example:
                status: 400
                message: Validation failed
                errors:
                  - msg: planName is required
                    param: planName
                    location: query
          headers: {}
          x-apidog-name: Bad Request
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  errorId:
                    type: string
                required:
                  - status
                  - message
                  - errorId
                x-apidog-orders:
                  - status
                  - message
                  - errorId
              example:
                status: 401
                message: Invalid API key
                errorId: uuid-v4-error-id
          headers: {}
          x-apidog-name: Unauthorized
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  errorId:
                    type: string
                required:
                  - status
                  - message
                  - errorId
                x-apidog-orders:
                  - status
                  - message
                  - errorId
              example:
                status: 500
                message: Internal server error
                errorId: uuid-v4-error-id
          headers: {}
          x-apidog-name: Internal Server Error
      security: []
      x-apidog-folder: subscriptions
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/797058/apis/api-25771049-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.zapmail.ai/api
    description: Prod Env
security: []

```
