API Documentation

Integrate FlashMail email services into your workflow with simple HTTP requests. Supports balance queries, product purchasing, mail reading, and more.

Query balance and VIP information

Returns the balance and VIP information of the user corresponding to the current API Key

Request URL

GETURL
GET https://api.shanyouxiang.com/open/user/balance

Request Params

clientKey
Yesquery
string

Current user's API key, passed as a query parameter for OpenAPI authentication

Test API

Parameter Input
clientKey*query / string

Current user's API key, passed as a query parameter for OpenAPI authentication

Click to send a request and view the response

Request Example

cURL
curl -X GET "https://api.shanyouxiang.com/open/user/balance?clientKey={clientKey}"

Documented Response Example (Not Live Data)

{
  "code": 0,
  "success": true,
  "message": "",
  "data": {
    "email": "",
    "balance": 0,
    "vipLevel": 0,
    "vipName": "",
    "discountRate": 0,
    "totalDeposit": 0
  },
  "requestId": ""
}

Query product list and stock

Does not require clientKey authentication. Returns all visible product stock when productId is not provided, and returns a list containing the specified product stock when productId is provided

Request URL

GETURL
GET https://api.shanyouxiang.com/open/product/stock

Request Params

productId
Noquery
number

Product ID. When omitted, all visible product stock is returned; you can copy it from the product card on the products page

Test API

Parameter Input
productIdquery / number

Product ID. When omitted, all visible product stock is returned; you can copy it from the product card on the products page

Click to send a request and view the response

Request Example

cURL
curl -X GET "https://api.shanyouxiang.com/open/product/stock?productId={productId}"

Documented Response Example (Not Live Data)

{
  "code": 0,
  "success": true,
  "message": "",
  "data": [
    {
      "productId": 0,
      "name": "",
      "stock": 0,
      "price": 0
    }
  ],
  "requestId": ""
}

Purchase email accounts

Purchases email accounts by productId and quantity

Request URL

GETURL
GET https://api.shanyouxiang.com/open/product/buy

Request Params

clientKey
Yesquery
string

Current user's API key, passed as a query parameter for OpenAPI authentication

productId
Yesquery
number

Product ID. You can copy it from the product card on the products page

quantity
Yesquery
integer

Buy quantity, greater than or equal to 1

Test API

Parameter Input
clientKey*query / string

Current user's API key, passed as a query parameter for OpenAPI authentication

productId*query / number

Product ID. You can copy it from the product card on the products page

quantity*query / integer

Buy quantity, greater than or equal to 1

Click to send a request and view the response

Request Example

cURL
curl -X GET "https://api.shanyouxiang.com/open/product/buy?clientKey={clientKey}&productId={productId}&quantity={quantity}"

Documented Response Example (Not Live Data)

{
  "code": 0,
  "success": true,
  "message": "",
  "data": {
    "accounts": [
      ""
    ],
    "quantity": 0,
    "totalAmount": 0,
    "balance": 0
  },
  "requestId": ""
}

Get the latest email of the specified email account

Queries the latest email by account credentials, mailbox folder, and optional start_timestamp. Currently, only Microsoft mailbox emails are supported

Request URL

GETURL
GET https://api.shanyouxiang.com/open/mail/latest-message

Request Params

clientKey
Yesquery
string

Current user's API key, passed as a query parameter for OpenAPI authentication

account
Yesquery
string

Full email account credentials in email:password:refreshToken:clientId format

folder
Yesquery
string

Mail folder. Only inbox or junkemail is supported

start_timestamp
Noquery
number

Start received timestamp (Unix seconds). Only emails received after this time are returned. Query parameter name is start_timestamp

Test API

Parameter Input
clientKey*query / string

Current user's API key, passed as a query parameter for OpenAPI authentication

account*query / string

Full email account credentials in email:password:refreshToken:clientId format

folder*query / string

Mail folder. Only inbox or junkemail is supported

start_timestampquery / number

Start received timestamp (Unix seconds). Only emails received after this time are returned. Query parameter name is start_timestamp

Click to send a request and view the response

Request Example

cURL
curl -X GET "https://api.shanyouxiang.com/open/mail/latest-message?clientKey={clientKey}&account={account}&folder={folder}&start_timestamp={start_timestamp}"

Documented Response Example (Not Live Data)

{
  "code": 0,
  "success": true,
  "message": "",
  "data": {
    "from": "",
    "subject": "",
    "html": "",
    "text": "",
    "receivedAt": ""
  },
  "requestId": ""
}

Query order list

Queries the current user's web purchase orders by page number, page size, and optional order status. API purchase orders are not currently available for query

Request URL

GETURL
GET https://api.shanyouxiang.com/open/order/list

Request Params

clientKey
Yesquery
string

Current user's API key, passed as a query parameter for OpenAPI authentication

pageNum
Noquery
integer

Page number, starting from 1. Defaults to page 1 when omitted; values less than 1 are rejected

pageSize
Noquery
integer

Page size. Defaults to 10 when omitted; values less than 1 or greater than 100 are rejected

status
Noquery
integer

Filter by order status. When omitted, all statuses are returned. 0=pending, 1=processing, 2=completed, 3=partially completed, 4=failed, 5=refunded

Test API

Parameter Input
clientKey*query / string

Current user's API key, passed as a query parameter for OpenAPI authentication

pageNumquery / integer

Page number, starting from 1. Defaults to page 1 when omitted; values less than 1 are rejected

pageSizequery / integer

Page size. Defaults to 10 when omitted; values less than 1 or greater than 100 are rejected

statusquery / integer

Filter by order status. When omitted, all statuses are returned. 0=pending, 1=processing, 2=completed, 3=partially completed, 4=failed, 5=refunded

Click to send a request and view the response

Request Example

cURL
curl -X GET "https://api.shanyouxiang.com/open/order/list?clientKey={clientKey}&pageNum={pageNum}&pageSize={pageSize}&status={status}"

Documented Response Example (Not Live Data)

{
  "code": 0,
  "success": true,
  "message": "",
  "data": [
    {
      "orderNo": "",
      "productId": 0,
      "productName": "",
      "quantity": 0,
      "unitPrice": 0,
      "totalAmount": 0,
      "status": 0,
      "createTime": "yyyy-MM-dd HH:mm:ss"
    }
  ],
  "requestId": ""
}

Query order detail

Queries the current user's web purchase order detail by order number. API purchase orders are not currently available for query

Request URL

GETURL
GET https://api.shanyouxiang.com/open/order/info

Request Params

clientKey
Yesquery
string

Current user's API key, passed as a query parameter for OpenAPI authentication

orderNo
Yesquery
string

Order number

Test API

Parameter Input
clientKey*query / string

Current user's API key, passed as a query parameter for OpenAPI authentication

orderNo*query / string

Order number

Click to send a request and view the response

Request Example

cURL
curl -X GET "https://api.shanyouxiang.com/open/order/info?clientKey={clientKey}&orderNo={orderNo}"

Documented Response Example (Not Live Data)

{
  "code": 0,
  "success": true,
  "message": "",
  "data": {
    "orderNo": "",
    "productId": 0,
    "productName": "",
    "quantity": 0,
    "unitPrice": 0,
    "totalAmount": 0,
    "status": 0,
    "createTime": "yyyy-MM-dd HH:mm:ss"
  },
  "requestId": ""
}