openapi: 3.0.3 info: title: KOMOJU Barcodes Subscriptions API description: 'KOMOJU is a Japan-focused global payment gateway operated by Degica. The REST API accepts payments across Japanese and international payment methods - credit cards, convenience store (konbini), bank transfer, Pay-easy (ATM), and e-money / mobile wallets such as PayPay, Merpay, au PAY, Rakuten Pay, LINE Pay, Alipay, and WeChat Pay - plus a hosted checkout (Sessions), tokenization, saved customers, subscriptions, and webhook events. Base URL: https://komoju.com/api/v1. Authentication is HTTP Basic: send your secret (or publishable, where allowed) API key as the username and leave the password empty (for example `curl -u secret_key: ...`). Separate live and test key pairs are issued per merchant account. POST requests support idempotency via the `X-KOMOJU-IDEMPOTENCY` header, and an optional `X-KOMOJU-API-VERSION` header pins the API version. This description is grounded in the public KOMOJU API reference (doc.komoju.com). Paths, methods, and authentication are confirmed against that reference. Request/response schemas below are a representative, partly modeled subset - some object properties are simplified or marked additionalProperties where the full field list is extensive; consult the official reference for exhaustive field-level detail.' version: '1.0' contact: name: KOMOJU (Degica) url: https://en.komoju.com license: name: Proprietary url: https://en.komoju.com/terms/ servers: - url: https://komoju.com/api/v1 description: KOMOJU API (live and test share this host; the key pair selects the environment) security: - basicAuth: [] tags: - name: Subscriptions description: Recurring payments charged against a saved customer. paths: /subscriptions: get: operationId: listSubscriptions tags: - Subscriptions summary: List subscriptions description: Lists existing subscriptions. parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' responses: '200': description: A list of subscriptions. content: application/json: schema: type: object properties: resources: type: array items: $ref: '#/components/schemas/Subscription' '401': $ref: '#/components/responses/Unauthorized' post: operationId: createSubscription tags: - Subscriptions summary: Create a subscription description: Creates a subscription (recurring payment) against a saved `customer`. The `period` may be `weekly`, `monthly`, or `yearly`. Subscriptions are immutable once created - delete and recreate to change one. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SubscriptionInput' responses: '200': description: The created subscription. content: application/json: schema: $ref: '#/components/schemas/Subscription' '401': $ref: '#/components/responses/Unauthorized' '422': $ref: '#/components/responses/UnprocessableEntity' /subscriptions/{id}: parameters: - name: id in: path required: true schema: type: string get: operationId: showSubscription tags: - Subscriptions summary: Show a subscription description: Shows an existing subscription, including its customer and scrubbed payment details. responses: '200': description: The requested subscription. content: application/json: schema: $ref: '#/components/schemas/Subscription' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' delete: operationId: deleteSubscription tags: - Subscriptions summary: Delete a subscription description: Deletes a subscription. Its recurring payments stop once deleted. responses: '200': description: The deleted subscription. content: application/json: schema: $ref: '#/components/schemas/Subscription' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' components: parameters: Page: name: page in: query required: false schema: type: integer default: 1 PerPage: name: per_page in: query required: false schema: type: integer default: 25 responses: Unauthorized: description: Invalid authorization (missing or invalid API key). content: application/json: schema: $ref: '#/components/schemas/Error' UnprocessableEntity: description: The request payload failed validation. content: application/json: schema: $ref: '#/components/schemas/Error' NotFound: description: The requested resource was not found. content: application/json: schema: $ref: '#/components/schemas/Error' schemas: SubscriptionInput: type: object required: - customer - amount - currency - period properties: customer: type: string amount: type: integer currency: type: string example: JPY period: type: string enum: - weekly - monthly - yearly external_order_num: type: string metadata: type: object additionalProperties: true Subscription: type: object properties: id: type: string resource: type: string example: subscription status: type: string customer: type: string amount: type: integer currency: type: string period: type: string enum: - weekly - monthly - yearly next_payment: type: string format: date-time payment_details: type: object additionalProperties: true created_at: type: string format: date-time Error: type: object properties: error: type: object properties: code: type: string message: type: string param: type: string securitySchemes: basicAuth: type: http scheme: basic description: 'HTTP Basic Authentication. Use your KOMOJU API key as the username and leave the password empty (for example `curl -u secret_key: ...`). Secret keys grant full access; publishable keys are limited to creating tokens and paying for sessions. Separate live and test key pairs exist per merchant.'