결제 (장바구니 → 주문 + 결제)
curl --request POST \
--url https://api.headlesscommerce.io/v1/storefront/carts/{id}/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"payment_provider": "<string>",
"payment_method_id": "<string>"
}
'{
"id": "<string>",
"number": 123,
"customer_id": "<string>",
"email": "<string>",
"shipping_address": {
"name": "<string>",
"company": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>"
},
"billing_address": {
"name": "<string>",
"company": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>"
},
"lines": [
{
"id": "<string>",
"variant_id": "<string>",
"product_id": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"sku": "<string>",
"image_url": "<string>",
"quantity": 123,
"unit_price": {
"amount": 123,
"currency": "<string>"
},
"line_discount": {
"amount": 123,
"currency": "<string>"
},
"line_total": {
"amount": 123,
"currency": "<string>"
},
"tax_amount": {
"amount": 123,
"currency": "<string>"
},
"fulfilled_quantity": 123,
"refunded_quantity": 123
}
],
"subtotal": {
"amount": 123,
"currency": "<string>"
},
"discount_total": {
"amount": 123,
"currency": "<string>"
},
"shipping_total": {
"amount": 123,
"currency": "<string>"
},
"tax_total": {
"amount": 123,
"currency": "<string>"
},
"total": {
"amount": 123,
"currency": "<string>"
},
"refunded_total": {
"amount": 123,
"currency": "<string>"
},
"applied_discounts": [
{
"discount_id": "<string>",
"code": "<string>",
"name": "<string>",
"value": 123,
"saved": {
"amount": 123,
"currency": "<string>"
}
}
],
"shipping_method_name": "<string>",
"note": "<string>",
"payments": [
{
"id": "<string>",
"order_id": "<string>",
"provider": "<string>",
"provider_id": "<string>",
"amount": {
"amount": 123,
"currency": "<string>"
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"fulfillments": [
{
"id": "<string>",
"order_id": "<string>",
"tracking_number": "<string>",
"tracking_url": "<string>",
"carrier": "<string>",
"lines": [
{
"order_line_id": "<string>",
"quantity": 123
}
],
"created_at": "2023-11-07T05:31:56Z",
"shipped_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z"
}
],
"refunds": [
{
"id": "<string>",
"order_id": "<string>",
"amount": {
"amount": 123,
"currency": "<string>"
},
"reason": "<string>",
"restock": true,
"lines": [
{
"order_line_id": "<string>",
"quantity": 123
}
],
"created_at": "2023-11-07T05:31:56Z"
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}Storefront - 장바구니
결제 (장바구니 → 주문 + 결제)
POST
/
storefront
/
carts
/
{id}
/
checkout
결제 (장바구니 → 주문 + 결제)
curl --request POST \
--url https://api.headlesscommerce.io/v1/storefront/carts/{id}/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"payment_provider": "<string>",
"payment_method_id": "<string>"
}
'{
"id": "<string>",
"number": 123,
"customer_id": "<string>",
"email": "<string>",
"shipping_address": {
"name": "<string>",
"company": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>"
},
"billing_address": {
"name": "<string>",
"company": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>"
},
"lines": [
{
"id": "<string>",
"variant_id": "<string>",
"product_id": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"sku": "<string>",
"image_url": "<string>",
"quantity": 123,
"unit_price": {
"amount": 123,
"currency": "<string>"
},
"line_discount": {
"amount": 123,
"currency": "<string>"
},
"line_total": {
"amount": 123,
"currency": "<string>"
},
"tax_amount": {
"amount": 123,
"currency": "<string>"
},
"fulfilled_quantity": 123,
"refunded_quantity": 123
}
],
"subtotal": {
"amount": 123,
"currency": "<string>"
},
"discount_total": {
"amount": 123,
"currency": "<string>"
},
"shipping_total": {
"amount": 123,
"currency": "<string>"
},
"tax_total": {
"amount": 123,
"currency": "<string>"
},
"total": {
"amount": 123,
"currency": "<string>"
},
"refunded_total": {
"amount": 123,
"currency": "<string>"
},
"applied_discounts": [
{
"discount_id": "<string>",
"code": "<string>",
"name": "<string>",
"value": 123,
"saved": {
"amount": 123,
"currency": "<string>"
}
}
],
"shipping_method_name": "<string>",
"note": "<string>",
"payments": [
{
"id": "<string>",
"order_id": "<string>",
"provider": "<string>",
"provider_id": "<string>",
"amount": {
"amount": 123,
"currency": "<string>"
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"fulfillments": [
{
"id": "<string>",
"order_id": "<string>",
"tracking_number": "<string>",
"tracking_url": "<string>",
"carrier": "<string>",
"lines": [
{
"order_line_id": "<string>",
"quantity": 123
}
],
"created_at": "2023-11-07T05:31:56Z",
"shipped_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z"
}
],
"refunds": [
{
"id": "<string>",
"order_id": "<string>",
"amount": {
"amount": 123,
"currency": "<string>"
},
"reason": "<string>",
"restock": true,
"lines": [
{
"order_line_id": "<string>",
"quantity": 123
}
],
"created_at": "2023-11-07T05:31:56Z"
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}인증
API Key. Example: sk_live_xxxxx or pk_live_xxxxx
경로 매개변수
Resource ID
본문
application/json
응답
생성됨
사용 가능한 옵션:
draft, pending, confirmed, processing, completed, cancelled 사용 가능한 옵션:
unpaid, partially_paid, paid, partially_refunded, refunded 사용 가능한 옵션:
unfulfilled, partially_fulfilled, fulfilled, returned Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I