API reference

Payment Links

A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times. When a customer opens a payment link it will open a new checkout session to render the payment page. You can use checkout session events to track payments through payment links. Related guide: Payment Links API

Knox answers these operations with the same requests and responses as Stripe's API. Authenticate with your secret key, Authorization: Bearer sk_test_..., from your server, and send form-encoded bodies. Test mode only: live processing is currently disabled.

Retrieve a payment link's line items

GET/v1/payment_links/{payment_link}/line_items

When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

Path parameters

  • payment_linkstringRequired

Query parameters

  • ending_beforestring

    A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • starting_afterstring

    A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Returns

A list of item objects.

GET /v1/payment_links/{payment_link}/line_items
curl -G https://api.knoxapi.com/v1/payment_links/plink_1Pgc78B7WZ01zgkWC75kX0jg/line_items \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "object": "list",
  "url": "/v1/payment_links",
  "has_more": false,
  "data": [
    {
      "amount_discount": 0,
      "amount_subtotal": 0,
      "amount_tax": 0,
      "amount_total": 0,
      "currency": "usd",
      "description": "T-shirt",
      "id": "li_1Pgc73B7WZ01zgkWx8kcmZPK",
      "object": "item",
      "price": {
        "active": true,
        "billing_scheme": "per_unit",
        "created": 1721948530,
        "currency": "usd",
        "custom_unit_amount": {
          "maximum": null,
          "minimum": null,
          "preset": null
        },
        "id": "price_1PgafmB7WZ01zgkW02Hf9z6c",
        "livemode": false,
        "lookup_key": null,
        "metadata": {},
        "nickname": null,
        "object": "price",
        "product": "prod_QXg1hqf4jFNsqG",
        "recurring": {
          "interval": "month",
          "interval_count": 797691627,
          "meter": null,
          "trial_period_days": null,
          "usage_type": "licensed"
        },
        "tax_behavior": "unspecified",
        "tiers_mode": null,
        "transform_quantity": {
          "divide_by": 1592560163,
          "round": "down"
        },
        "type": "one_time",
        "unit_amount": 1000,
        "unit_amount_decimal": "1000"
      },
      "quantity": 1,
      "metadata": null,
      "adjustable_quantity": {
        "enabled": true,
        "maximum": null,
        "minimum": null
      }
    }
  ]
}

Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.