- 认证中心
- 用户服务
- 商品服务
- 购物车服务
- 订单服务
- 结算服务
- 支付服务
- 智能体
部分清空购物车并生成订单
开发中
POST
/api/v1/order
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Body 参数application/json
user_currency
string
必需
address
object
必需
street_address
string
必需
city
string
必需
state
string
必需
country
string
必需
zip_code
string
必需
email
string
必需
order_items
array [object {2}]
必需
cost
number
必需
item
object
必需
示例
{
"user_id": 5,
"firstname": "John",
"lastname": "Doe",
"email": "johndoe@example.com",
"address": {
"street_address": "123 Main St",
"city": "Springfield",
"state": "IL",
"country": "USA",
"zip_code": "62701"
},
"credit_card": {
"credit_card_number": "4111111111111111",
"credit_card_cvv": 123,
"credit_card_expiration_year": 2025,
"credit_card_expiration_month": 12
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/order' \
--header 'Content-Type: application/json' \
--data-raw '{
"user_id": 5,
"firstname": "John",
"lastname": "Doe",
"email": "johndoe@example.com",
"address": {
"street_address": "123 Main St",
"city": "Springfield",
"state": "IL",
"country": "USA",
"zip_code": "62701"
},
"credit_card": {
"credit_card_number": "4111111111111111",
"credit_card_cvv": 123,
"credit_card_expiration_year": 2025,
"credit_card_expiration_month": 12
}
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
msg
string
必需
data
object
必需
order_id
string
必需
示例
{
"code": 0,
"msg": "success",
"data": {
"order_id": "206831618"
}
}
修改于 2025-03-03 03:23:08