← 返回
开发者工具 中文

Shopify Checkout API

Complete online shopping purchases on any online store using the Credpay Checkout API with x402 payments. Trigger when a user wants to buy, order, or checkou...
使用Credpay Checkout API和x402支付完成任何在线商店的购物购买。当用户想要购买、下订单或结账时触发。
jelilat jelilat 来源
开发者工具 clawhub v1.0.0 1 版本 99884.3 Key: 无需
★ 0
Stars
📥 863
下载
💾 22
安装
1
版本
#latest

概述

Credpay Checkout Skill

API Base URL: https://checkout-agent.credpay.xyz

Trigger this skill whenever the user wants to purchase, order, or checkout a product from any online store.

What you need from the user

Collect these before starting (ask if missing):

FieldExample
------
Product URLhttps://example.com/products/tee
Quantity1
Size / Color (if applicable)"Size": "M", "Color": "Black"
Emailcustomer@example.com
Goods total (USD)"49.99" — item price as a USD string, no currency symbol
Shipping addressfirstName, lastName, line1, city, state, postalCode, country, phone

Step 1 — Get a quote (no payment needed)

POST https://checkout-agent.credpay.xyz/v1/quote
Content-Type: application/json

{
  "items": [
    {
      "url": "<product URL>",
      "quantity": 1,
      "options": { "Size": "M", "Color": "Black" }
    }
  ],
  "email": "<email>",
  "shippingAddress": {
    "firstName": "Jane",
    "lastName": "Doe",
    "line1": "123 Main St",
    "city": "Austin",
    "state": "TX",
    "postalCode": "78701",
    "country": "United States",
    "countryCode": "US",
    "phone": "+15125551234"
  },
  "goodsTotal": "<item price in USD as string, e.g. \"49.99\">"
}

→ Save maxAmount from the response. This is the USDC amount you will pay via x402.

Step 2 — Submit checkout (x402 payment required)

POST https://checkout-agent.credpay.xyz/v1/checkout
Content-Type: application/json
X-PAYMENT: <x402 payment payload for maxAmount on Base chainId 8453>

<same body as Step 1>

→ On 202: save requestId and go to Step 3.

→ On 402: re-read the payment requirements from the response and retry with a correct X-PAYMENT header.

Step 3 — Poll for completion

GET https://checkout-agent.credpay.xyz/v1/checkout/{requestId}

Poll every 5 seconds. Stop when status is completed or failed. Timeout after 10 minutes.

StatusAction
------
processingKeep polling
authorization_requiredSee Step 4
completedDone — return result to user
failedReport errorCode + errorMessage to user

Step 4 — Handle extra payment (if needed)

If status is authorization_required, the order total exceeded the quoted amount:

POST https://checkout-agent.credpay.xyz/v1/checkout/{requestId}/authorize
X-PAYMENT: <x402 payment for extraOwed amount>

Then resume polling from Step 3.

Rules

  • Works with any online store — just pass the product page URL.
  • Never create a second checkout for the same intent while a requestId is active.
  • Retry transient network errors with exponential backoff. Never blind-retry failed status.
  • Default chainId is 8453 (Base).

Success response

{
  "requestId": "req_abc123",
  "status": "completed",
  "success": true,
  "orderNumber": "1234"
}

Failure response

{
  "requestId": "req_abc123",
  "status": "failed",
  "success": false,
  "errorCode": "payment_failed",
  "errorMessage": "Card declined"
}

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 03:08 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

business-ops

Stripe

byungkyu
Stripe API 集成,支持托管 OAuth,实现对客户、订阅、发票、产品、价格和支付的可写金融集成。
★ 27 📥 25,919
business-ops

Trello

steipete
使用 Trello REST API 管理看板、列表和卡片
★ 161 📥 41,095
business-ops

Discord

steipete
当需要通过discord工具控制Discord时使用:发送消息、添加反应、发布或上传表情包、上传表情、创建投票、管理帖子/置顶/搜索、获取权限或成员/角色/频道信息,或在Discord私信或频道中处理管理操作。
★ 77 📥 37,810