Skip to main content

Overview

A digital goods purchase allows customers to buy virtual currency and other digital products. This uses the line items checkout flow where you specify the products, prices, and quantities being purchased. Every Soap API request is authenticated with a bearer token in the Authorization header:
Create your API key in the Soap Dashboard under the Developer section. It looks like key_... and is shown once, when you create it, so store it in your server’s secret manager right away. See Managing API keys. Requests with a missing, unknown or inactive API key return 401 with {"error": "API key not found.", "code": "invalid_api_key"}. Branch on the status and code rather than the message. Never expose your API key in client-side code — it is server-side only.

How It Works

  1. Create products in Soap, or pass inline dynamic product details directly in line_items.
  2. Create a checkout session with type: "deposit" and include line_items.
  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.
The sku processing_fee is reserved for the processing fee Soap adds itself on some checkouts, which the order summary shows as a separate “Processing Fee” line. A line item you send with sku: "processing_fee" is rejected with 422 ("sku processing_fee is reserved for Soap's processing fee."). To charge a fee of your own, send it as an ordinary line item under a sku of yours; it is shown and totalled like any other item.

API Request

You can also manage products from the Soap dashboard and reference them by ID. Simply pass line_items: [{ "product_id": "pr_XXX", "quantity": 1 }] instead of inline product details.

Key Parameters

Line Item Parameters

Each line item can reference an existing product or define a product inline.

When to Use

  • Virtual currency purchases (tokens, credits, etc.)
  • Any digital goods tied to a product catalog or priced dynamically at checkout time

← Back to Create Checkout

View the full API reference for creating checkouts.