Skip to main content

Overview

A digital goods purchase allows customers to buy virtual currency, in-game tokens, sweepstakes coins, and other digital products. This uses the line items checkout flow where you specify the products and quantities being purchased.

How It Works

  1. Create products in Soap that represent your digital goods (virtual currency packages, token bundles, etc.).
  2. Create a checkout session with type: "deposit" and include line_items referencing those products.
  3. The customer is redirected to the Soap-hosted checkout page showing the items and total.
  4. The customer selects a payment method and completes the purchase.
  5. Upon completion, a webhook is fired and the customer is redirected back to your app.

API Request

curl -X POST 'https://api-sandbox.paywithsoap.com/api/v1/checkouts' \
--header 'Content-Type: application/json' \
--header 'Authorization: YOUR_API_KEY' \
--data '{
    "customer_id": "cus_vi57KegYgcRqcGHqip8q6UZiqtrwMT870",
    "type": "deposit",
    "line_items": [
        {
            "product_id": "pr_virtual_currency_100",
            "quantity": 1
        }
    ],
    "experience": "web",
    "return_url": "https://myapp.com/store"
}'

Key Parameters

ParameterRequiredDescription
customer_idYesThe customer’s unique identifier
typeYesMust be "deposit"
line_itemsYesArray of products with product_id and quantity
experienceNo"web" or "webview"
return_urlNoWhere to redirect the customer after completion

When to Use

  • Virtual currency purchases (gold coins, tokens, credits, etc.)
  • Sweepstakes coin packages
  • Any digital goods tied to a product catalog

← Back to Create Checkout

View the full API reference for creating checkouts.