Expansion

Many resources allow you to expand certain fields to retrieve related resources inline by using the expand request parameter. Expansion is currently limited to get and list requests.

Expands can be nested to any depth by providing an object instead of a boolean value. Check the expand parameter of a resource to see which properties can be expanded.

Some objects like CheckoutSessions have array properties that can be expanded into lists of objects. These properties will have a value of null unless expanded through the expand parameter.

Example

Click on a value to see it expanded in the response.

Request

const customer = await bias.payments.get("pay_id", {
    expand: {
    }
})

Response

{
  "object": "payment",
  "live": false,
  "id": "payment",
  "created_at": 1750000000000,
  "amount": 1000,
  "amount_capturable": 1000,
  "amount_received": 0,
  "amount_refunded": 0,
  "capture_method": "automatic",
  "customer": "customer",
  "description": "Payment for order 123",
  "dispute": null,
  "invoice": null,
  "metadata": {},
  "payment_error": null,
  "payment_method": "payment_method",
  "session": "checkout_session",
  "statement_descriptor": null,
  "status": "succeeded"
}