Cloudreve API Docs
  1. Payment
Cloudreve API Docs
  • Site
    • Ping
      GET
    • Get CAPTCHA
      GET
    • Get site settings
      GET
  • Session
    • Token
      • Password sign-in
      • Finish sign-in with 2FA
      • Refresh Token
      • Sign out
    • OpenID
      • Prepare OpenID sign-in
      • Finish OpenID sign-in
      • Unlink OpenID
    • Passkey
      • Prepare Passkey sign-in
      • Finish Passkey sign-in
    • Prepare login
      GET
  • User
    • Passkey
      • Prepare passkey registration
      • Finish passkey registration
      • Delete passkey
    • Setting
      • List available storage policies
      • List available nodes
      • Get preferences
      • Prepare enabling 2FA
      • Update preference setting
      • Update profile pricture
    • Sign up
      POST
    • Send reset password email
      POST
    • Reset password via temp link
      PATCH
    • Get profile picture
      GET
    • Get user
      GET
    • List user's share links
      GET
    • Get storage capacity
      GET
    • Search user
      GET
    • List credit changes
      GET
    • List payments
      GET
  • Callback
    • Complete OneDrive upload
      GET
    • Complete COS upload
      GET
    • Complete S3 upload
      GET
    • Complete OBS upload
      GET
  • Workflow
    • Remote Download
      • Create remote download
      • Select files to download
      • Cancel task
    • List tasks
    • Get task progress
    • Create archive
    • Extract archive
    • Relocate storage policy
    • Import external files
  • File
    • Permission
      • Set permission
      • Delete permission setting
    • Upload
      • Create upload session
      • Upload file chunk
      • Delete upload session
    • Pin
      • Pin to sidebar
      • Delete a pin
    • Version
      • Set file version
      • Delete file version
    • Direct Link
      • Create direct links
      • Delete direct link
    • List files
    • List file activities
    • Get file info
    • Get thumbnail URL
    • Update file content
    • Create viewer session
    • Create file
    • Rename file
    • Move or copy files
    • Create download URL
    • Restore from trash bin
    • Delete file
    • Force unlock
    • Patch metadata
    • Mount storage policy
    • Update view setting
  • Share
    • Create share link
    • Edit share link
    • Get share link info
    • List my share links
    • Delete share link
  • VAS
    • Payment
      • Create a payment
        PUT
      • Get payment status
        GET
    • GiftCode
      • Check gift code
      • Redeem gift code
  • Group
    • List groups
  • WebDAV
    • List accounts
    • Create account
    • Update account
    • Delete account
  1. Payment

Create a payment

PUT
/vas/payment
Create a payment for given product.

Request

Authorization
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Body Params application/json
product
object 
required
Target product.
type
enum<integer> 
required
Type of the product.
Allowed values:
1234
share_link_id
string  | null 
optional
ID of the paid share link. Only required if type is 3.
Example:
LJ6cM
sku_id
string <uuid> | null 
optional
SKU ID for user group or storage packs. Only required if type is 2 or 3.
Example:
8ff2cceb-b4e6-4fa8-a934-04900a2e8699
quantity
integer 
required
Quantity of the product. For points product, this is the count of purchasing points.
>= 1
provider_id
string <uuid> | null 
optional
ID of the payment provider. Empty value means paying using points.
List of available payment providers can be get from payment in the response of Get site settings under vas section.
Example:
a840b559-001c-484f-bf4c-6c1f51edf041
email
string 
optional
Email of the payment owner to send receipt. Only required when Authorization header is missing.
language
string 
optional
Language code of the receipt email. Only appliable when Authorization header is missing.
Example:
en-US
Example
{
    "product": {
        "type": 3,
        "sku_id": "ea602ab6-bd1e-40c3-b674-bef18fda7fa9"
    },
    "quantity": 1,
    "email": "",
    "provider_id": "8ff2cceb-b4e6-4fa8-a934-04900a2e8699",
    "language": "zh-CN"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT '/vas/payment' \
--header 'Content-Type: application/json' \
--data-raw '{
    "product": {
        "type": 3,
        "sku_id": "ea602ab6-bd1e-40c3-b674-bef18fda7fa9"
    },
    "quantity": 1,
    "email": "",
    "provider_id": "8ff2cceb-b4e6-4fa8-a934-04900a2e8699",
    "language": "zh-CN"
}'

Responses

🟢200Success
application/json
Body
data
object 
optional
Response content. In some error type, e.g. lock conflicting errors, this field wil present details of the error, e.g. who is locking the current file.
payment
object (Payment) 
required
Details of the payment.
request
object 
required
Additional info to initiate a payment.
code
integer 
required
Response code.
0 - Success.
Default:
0
Example:
0
msg
string 
optional
Human readable error message (if any).
error
string  | null 
optional
Internal error message, only visable in debug mode.
correlation_id
string <uuid> | null 
optional
Correlation ID of the request. Only presented on failed reqeust.
Example:
b4351ecc-ee1a-4455-bc94-2c3dbcc58538
Examples
{
    "code": 0,
    "data": {
        "payment": {
            "id": "1XbTb",
            "trade_no": "20250612141601003370839825",
            "name": "123",
            "status": "created",
            "qyt": 4,
            "price_unit": 100,
            "price_id": "CNY",
            "price_mark": "¥",
            "price_one_unit": 100,
            "created_at": "2025-06-12T14:16:02.794208+08:00",
            "updated_at": "2025-06-12T14:16:02.794208+08:00",
            "product_type": 3
        },
        "request": {
            "payment_needed": true,
            "url": "https://checkout.stripe.com/c/pay/cs_test_a1FJraiSgMa6w5V3BZ39lxvgTRjhoV6KEI6jfE9Ws9GuNpI6qVjfnkuyZV#fidkdWxOYHwnPyd1blpxYHZxWjA0SnBcb0JVMGZPVHRMaDZGZk1TXzNqPXZDdU1kMVE8XXZ2TTdmSXNJd0s1aHxiMU98c31ifFRuNFRWX1VuZ2l2MlI1Zkc2NENIQHcwbTZsTEhifTNUZlczNTVhTD1LNmpcSCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl",
            "qr_code_preferred": false
        }
    },
    "msg": ""
}
Modified at 2025-06-12 05:57:50
Previous
Delete share link
Next
Get payment status
Built with