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/apiAuthentication
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
| Parameter | Type | Required | Description |
|---|---|---|---|
count | number | Yes | Number of QR codes generated |
content | string (JSON) | No | QR content data array for re-download later |
names | string (JSON) | No | QR code file names array |
settings | string (JSON) | No | Generation 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=0Or via POST:
POST /api/qr/download
Content-Type: application/json
{
"recordId": "xxx",
"index": 0
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
recordId | string | Yes | Generation record ID |
index | number | No | QR code index in the batch, default 0 |
format | string | No | Output 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-statusResponse
{
"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
| Tier | Retention Days |
|---|---|
| Free | 0 (not available) |
| Trial | 7 days |
| Monthly | 30 days |
| Pro Monthly | 90 days |
| Annual | 365 days |
| Pro Annual | Permanent |
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-infoResponse
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
product_id | string | Yes | Product ID from pricing table |
currency | string | No | Currency, auto-detected from locale |
locale | string | No | Language |
payment_provider | string | No | Provider: stripe / wechat / paypal / creem |
Response
{
"code": 0,
"data": {
"sessionId": "prepay_id_xxx",
"checkoutUrl": "https://...",
"orderNo": "1234567890"
}
}For WeChat Pay,
checkoutUrlis a QR code URL that should be displayed as an image for the user to scan.
Error Codes
| HTTP Status | Description |
|---|---|
| 200 | Success |
| 400 | Bad request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 410 | Gone (beyond retention period) |
| 500 | Internal server error |