API Documentation

API reference for the DDSM QR Code Generator — programmatically generate and download QR codes in batches.

Overview

DDSM provides HTTP APIs for developers to programmatically generate and download QR codes in batches. All APIs return JSON responses.

Base URL

https://ddsm.com/api

Authentication

Currently, API calls do not require authentication. API Key authentication will be added in future versions.


Generate QR Code

Record QR code generation for statistics and download retention management.

Request

POST /api/qr/generate
Content-Type: application/json

{
  "count": 10,
  "content": "[\"https://example.com\",\"https://example2.com\"]",
  "names": "[\"Link 1\",\"Link 2\"]",
  "settings": "{\"size\":200,\"format\":\"image/png\",\"errorLevel\":\"M\"}"
}

Parameters

ParameterTypeRequiredDescription
countnumberYesNumber of QR codes generated
contentstring (JSON)NoQR content data array for re-download later
namesstring (JSON)NoQR code file names array
settingsstring (JSON)NoGeneration settings (size, format, errorLevel)

Response

{
  "success": true
}

Re-Download QR Code

Download a previously generated QR code from history. Subject to member retention limits.

Request

GET /api/qr/download?recordId=xxx&index=0

Or via POST:

POST /api/qr/download
Content-Type: application/json

{
  "recordId": "xxx",
  "index": 0
}

Parameters

ParameterTypeRequiredDescription
recordIdstringYesGeneration record ID
indexnumberNoQR code index in the batch, default 0
formatstringNoOutput format, default image/png

Response

On success, returns the QR code image file directly (Content-Type: image/png or image/svg+xml).

If beyond retention period:

{
  "error": "This record exceeds the download retention period (7 days). Please upgrade to member for longer retention.",
  "retentionDays": 7,
  "expired": true
}

Check Member Status

Get the current user's membership status and download retention period.

Request

POST /api/user/member-status

Response

{
  "code": 0,
  "data": {
    "isMember": true,
    "planName": "Annual",
    "planTier": "annual",
    "retentionDays": 365,
    "subscription": {
      "status": "active",
      "planName": "Annual",
      "currentPeriodEnd": "2026-06-18T00:00:00.000Z"
    }
  }
}

Retention Period Reference

TierRetention Days
Free0 (not available)
Trial7 days
Monthly30 days
Pro Monthly90 days
Annual365 days
Pro AnnualPermanent

CSV/XLSX Import

All paid members (Trial, Monthly, Pro Monthly, Annual, Pro Annual) can use batch CSV/XLSX import without restrictions.

Get User Info

Get basic user information and credit balance.

Request

POST /api/user/get-user-info

Response

{
  "code": 0,
  "data": {
    "id": "xxx",
    "name": "User Name",
    "email": "user@example.com",
    "isAdmin": false,
    "credits": {
      "remainingCredits": 100
    }
  }
}

Checkout

Create a payment order and obtain a checkout URL (for membership purchase).

Request

POST /api/payment/checkout
Content-Type: application/json

{
  "product_id": "member-monthly",
  "currency": "CNY",
  "locale": "zh",
  "payment_provider": "wechat"
}

Parameters

ParameterTypeRequiredDescription
product_idstringYesProduct ID from pricing table
currencystringNoCurrency, auto-detected from locale
localestringNoLanguage
payment_providerstringNoProvider: stripe / wechat / paypal / creem

Response

{
  "code": 0,
  "data": {
    "sessionId": "prepay_id_xxx",
    "checkoutUrl": "https://...",
    "orderNo": "1234567890"
  }
}

For WeChat Pay, checkoutUrl is a QR code URL that should be displayed as an image for the user to scan.


Error Codes

HTTP StatusDescription
200Success
400Bad request
401Unauthorized
403Forbidden
404Not found
410Gone (beyond retention period)
500Internal server error
API Documentation