CreditClawCreditClawDocs
    View as Markdown

    Checkout Pages

    Create hosted checkout pages so your bot can accept payments programmatically.

    All endpoints require bot authentication via Authorization: Bearer cck_live_... header. See Authentication for details.


    List Checkout Pages

    Retrieve all checkout pages associated with the bot's wallet.

    MethodGET
    Path/api/v1/bot/checkout-pages
    AuthBot API key

    Request

    No parameters required.

    Response

    {
      "checkout_pages": [
        {
          "checkout_page_id": "cp_a1b2c3d4e5f6",
          "checkout_url": "/pay/cp_a1b2c3d4e5f6",
          "title": "Premium Plan",
          "description": "Monthly subscription to premium features",
          "wallet_address": "0x1234...abcd",
          "amount_usd": 29.99,
          "amount_locked": true,
          "allowed_methods": ["x402", "usdc_direct", "stripe_onramp", "base_pay"],
          "status": "active",
          "page_type": "product",
          "image_url": null,
          "collect_buyer_name": false,
          "digital_product_url": null,
          "view_count": 42,
          "payment_count": 12,
          "total_received_usd": 359.88,
          "created_at": "2025-01-15T10:30:00.000Z",
          "expires_at": null
        }
      ]
    }
    

    Example

    curl -X GET https://creditclaw.com/api/v1/bot/checkout-pages \
      -H "Authorization: Bearer cck_live_abc123..."
    

    Create Checkout Page

    Create a new hosted checkout page linked to the bot's wallet.

    MethodPOST
    Path/api/v1/bot/checkout-pages/create
    AuthBot API key

    Request Body

    FieldTypeRequiredDescription
    titlestringYesPage title (1–200 chars)
    descriptionstringNoPage description (max 2000 chars)
    amount_usdnumberNoFixed price in USD. Omit for pay-what-you-want.
    amount_lockedbooleanNoWhether the amount is fixed. Default: true
    allowed_methodsstring[]NoPayment methods to accept. Default: all methods. Options: x402, usdc_direct, stripe_onramp, base_pay
    success_urlstringNoURL to redirect buyer after payment
    expires_atstringNoISO 8601 expiration timestamp
    page_typestringNo"product", "event", or "digital_product". Default: "product"
    digital_product_urlstringNoURL delivered to buyer after payment. Required when page_type is "digital_product". Must be a valid URL.
    image_urlstringNoURL of an image to display on the page
    collect_buyer_namebooleanNoWhether to collect buyer's name. Default: false

    Response 201 Created

    {
      "checkout_page_id": "cp_a1b2c3d4e5f6",
      "checkout_url": "/pay/cp_a1b2c3d4e5f6",
      "title": "Premium Plan",
      "description": "Monthly subscription to premium features",
      "wallet_address": "0x1234...abcd",
      "amount_usd": 29.99,
      "amount_locked": true,
      "allowed_methods": ["x402", "usdc_direct", "stripe_onramp", "base_pay"],
      "status": "active",
      "page_type": "product",
      "image_url": null,
      "collect_buyer_name": false,
      "digital_product_url": null,
      "created_at": "2025-01-15T10:30:00.000Z"
    }
    

    Errors

    StatusErrorDescription
    400wallet_not_foundBot does not have an active wallet
    400invalid_jsonRequest body is not valid JSON
    400validation_errorRequest body failed validation

    Example

    curl -X POST https://creditclaw.com/api/v1/bot/checkout-pages/create \
      -H "Authorization: Bearer cck_live_abc123..." \
      -H "Content-Type: application/json" \
      -d '{
        "title": "Premium Plan",
        "description": "Monthly subscription to premium features",
        "amount_usd": 29.99,
        "amount_locked": true,
        "allowed_methods": ["x402", "stripe_onramp"],
        "page_type": "product"
      }'
    

    Related

    • Authentication — how to authenticate API requests
    • Invoices — create and send invoices
    • Sales — track incoming payments
    • Webhooks — listen for wallet.sale.completed events