Unlock Protocol Subscriptions API

The Subscriptions API from Unlock Protocol — 1 operation(s) for subscriptions.

OpenAPI Specification

unlock-protocol-subscriptions-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Unlock Locksmith Applications Subscriptions API
  version: '2'
  description: Locksmith provides backend functionality for enabling ticketing, metadata storage, and notification hooks.
  license:
    name: MIT
servers:
- url: https://locksmith.unlock-protocol.com
  description: Production Server
- url: https://staging-locksmith.unlock-protocol.com
  description: Staging Server
tags:
- name: Subscriptions
paths:
  /v2/subscriptions/{network}/locks/{lockAddress}/keys/{keyId}:
    delete:
      operationId: cancelSubscription
      description: Cancel a fiat subscription.
      security:
      - User: []
      parameters:
      - $ref: '#/components/parameters/Network'
      - $ref: '#/components/parameters/LockAddress'
      - $ref: '#/components/parameters/KeyId'
      responses:
        204:
          description: Successfully deleted the subscription.
        401:
          $ref: '#/components/responses/401.NotAuthenticated'
      tags:
      - Subscriptions
    get:
      operationId: getSubscription
      description: Get an active subscription associated with the key. It can be fiat or crypto.
      security:
      - User: []
      parameters:
      - $ref: '#/components/parameters/Network'
      - $ref: '#/components/parameters/LockAddress'
      - $ref: '#/components/parameters/KeyId'
      responses:
        200:
          description: Any active subscription.
          content:
            application/json:
              schema:
                type: object
                properties:
                  subscriptions:
                    type: array
                    items:
                      type: object
                      properties:
                        next:
                          type: number
                          nullable: true
                        balance:
                          type: object
                          properties:
                            symbol:
                              type: string
                            amount:
                              type: string
                            decimals:
                              type: number
                        price:
                          type: object
                          properties:
                            symbol:
                              type: string
                            amount:
                              type: string
                            decimals:
                              type: number
                        approvedRenewals:
                          type: string
                          description: Approved number of renewals by user.
                        possibleRenewals:
                          type: string
                          description: Possible number of renewals based on the user account balance.
                        type:
                          enum:
                          - crypto
                          - fiat
                          description: The type of payment method used for the subscription.
        401:
          $ref: '#/components/responses/401.NotAuthenticated'
      tags:
      - Subscriptions
components:
  responses:
    401.NotAuthenticated:
      description: User is not authenticated.
      content:
        application:
          schema:
            $ref: '#/components/schemas/GenericServerError'
  parameters:
    Network:
      in: path
      name: network
      required: true
      description: Network id.
      schema:
        type: integer
    LockAddress:
      in: path
      name: lockAddress
      required: true
      description: Lock address.
      schema:
        type: string
    KeyId:
      in: path
      name: keyId
      required: true
      description: Key Id.
      schema:
        type: string
  schemas:
    GenericServerError:
      type: object
      nullable: false
      properties:
        message:
          type: string
          default: There was an error in fullfiling the request.
          nullable: false
  securitySchemes:
    User:
      type: http
      scheme: bearer
      bearerFormat: JWT
    Application:
      type: apiKey
      name: api-key
      in: query