> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getruba.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Collect Structured Answers at Checkout

> Define reusable questions, attach them to products, and read the answers

export const RubaSocials = () => {
  if (typeof document === "undefined") {
    return null;
  }
  const inject = () => {
    const footer = document.getElementById("footer");
    if (!footer || document.getElementById("ruba-socials")) {
      return false;
    }
    const isDark = document.querySelector("html.dark") || document.querySelector('html[class*="dark"]');
    const lineColor = isDark ? "#383838" : "#e8e8ed";
    const iconColor = isDark ? "#8e8e93" : "#86868b";
    const markColor = isDark ? "#ffffff" : "#08080c";
    const hoverColor = "#0071e3";
    const div = document.createElement("div");
    div.id = "ruba-socials";
    div.style.cssText = `display:flex;align-items:center;gap:20px;padding-top:20px;margin-top:20px;border-top:1px solid ${lineColor};width:100%`;
    const logo = `<a href="https://getruba.com" style="display:inline-flex;height:24px;align-items:center;gap:8px;text-decoration:none;color:${markColor};line-height:1;"><svg width="24" height="24" viewBox="0 0 120 120" aria-hidden="true" style="display:block;flex:none;"><g transform="translate(2.5 0)"><path d="M19 25h59L65.43 47H19a4 4 0 0 1-4-4V29a4 4 0 0 1 4-4Z" fill="${markColor}"/><path d="M19 73h31.57L38 95H19a4 4 0 0 1-4-4V77a4 4 0 0 1 4-4Z" fill="${markColor}"/><path d="M85 25h25L70 95H45Z" fill="#007AFF"/></g></svg><span style="display:inline-flex;height:24px;align-items:center;font-weight:600;font-size:15px;color:${markColor};letter-spacing:-0.01em;line-height:1;">Ruba</span></a>`;
    const spacer = `<div style="flex:1"></div>`;
    const ig = `<a href="https://instagram.com/getruba" target="_blank" rel="noopener" aria-label="Instagram" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"/><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"/></svg></a>`;
    const li = `<a href="https://linkedin.com/company/getruba" target="_blank" rel="noopener" aria-label="LinkedIn" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"/><rect x="2" y="9" width="4" height="12"/><circle cx="4" cy="4" r="2"/></svg></a>`;
    const x = `<a href="https://x.com/getruba" target="_blank" rel="noopener" aria-label="X" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>`;
    const github = `<a href="https://github.com/rubadot" target="_blank" rel="noopener" aria-label="GitHub" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 .7a11.5 11.5 0 0 0-3.64 22.4c.58.1.79-.25.79-.56v-2.24c-3.22.7-3.9-1.37-3.9-1.37-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.71.08-.71 1.16.08 1.78 1.2 1.78 1.2 1.04 1.77 2.72 1.26 3.38.96.1-.75.4-1.26.74-1.55-2.57-.3-5.27-1.29-5.27-5.69 0-1.26.45-2.29 1.19-3.09-.12-.29-.52-1.47.11-3.05 0 0 .97-.31 3.16 1.18A10.96 10.96 0 0 1 12 6.09c.98 0 1.94.13 2.86.39 2.2-1.49 3.16-1.18 3.16-1.18.63 1.58.23 2.76.11 3.05.74.8 1.19 1.83 1.19 3.09 0 4.42-2.7 5.39-5.28 5.68.42.36.79 1.06.79 2.14v3.28c0 .31.21.67.8.56A11.5 11.5 0 0 0 12 .7Z"/></svg></a>`;
    div.innerHTML = logo + spacer + ig + li + x + github;
    footer.appendChild(div);
    return true;
  };
  if (!document.documentElement.dataset.rubaSocialsObserver) {
    document.documentElement.dataset.rubaSocialsObserver = "true";
    const observer = new MutationObserver(() => {
      if (!document.getElementById("ruba-socials")) {
        inject();
      }
    });
    observer.observe(document.body, {
      childList: true,
      subtree: true
    });
  }
  setTimeout(() => {
    if (!inject()) {
      const interval = setInterval(() => {
        if (inject()) {
          clearInterval(interval);
        }
      }, 500);
      setTimeout(() => clearInterval(interval), 10000);
    }
  }, 300);
  return null;
};

<link rel="stylesheet" href="/style.css" />

<RubaSocials />

Checkout already collects identity and billing information. Custom fields cover information specific to your business, such as terms acceptance, marketing consent, attribution, or fulfillment details.

## Define the data before the form

Open [Settings → Custom Fields](https://getruba.com/to/dashboard/settings/custom-fields) and create an organization-level field. Products choose from this shared library later.

<img className="block dark:hidden" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/custom_fields.light.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=b848cccc4731aef6c4c875447e48b52c" width="3840" height="2400" data-path="assets/features/custom-fields/custom_fields.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/custom_fields.dark.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=2473a750e1d3029ca5597fcedcc5671f" width="3840" height="2400" data-path="assets/features/custom-fields/custom_fields.dark.png" />

The field type is permanent after creation because it controls both the checkout control and stored value:

| Type     | Checkout control                       | Stored value          | Validation                                 |
| -------- | -------------------------------------- | --------------------- | ------------------------------------------ |
| Text     | Single-line input or optional textarea | String                | Minimum and maximum length                 |
| Number   | Numeric input                          | Number                | Minimum and maximum value                  |
| Date     | Date input                             | ISO 8601 string       | Earliest and latest date                   |
| Checkbox | Checkbox                               | Boolean               | Required state can enforce acknowledgement |
| Select   | Menu of label/value pairs              | Selected option value | Allowed options                            |

## Separate internal identity from customer copy

The **slug** is the unique organization-wide key used in orders, subscriptions, and API responses. It can be renamed later; Ruba updates existing data to the new key. The **name** identifies the field in the dashboard and becomes its initial checkout label.

<img className="block dark:hidden" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/create_custom_field.light.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=02eac8c9b5e1cce3c08e26806cfeafb2" width="1620" height="2334" data-path="assets/features/custom-fields/create_custom_field.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/create_custom_field.dark.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=58c336cb37358dd2aa3e2fc63c6228b6" width="1620" height="2334" data-path="assets/features/custom-fields/create_custom_field.dark.png" />

Form options let you replace the label, add help text beneath the control, and add an empty-state placeholder. Label and help text accept basic Markdown including emphasis and links.

<img className="block dark:hidden" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/label_markdown.light.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=3e58507e18e5130d389a4ab544e6071a" width="1383" height="132" data-path="assets/features/custom-fields/label_markdown.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/label_markdown.dark.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=c037506bab4304141c27a92516af65a5" width="1383" height="132" data-path="assets/features/custom-fields/label_markdown.dark.png" />

## Attach questions to a product

Edit or [create the product](/features/products), select the fields that belong on its checkout, and mark each one optional or required.

<img className="block dark:hidden" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/add_custom_field.light.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=360b50ca857a71bb20fd3b5f7992c2d8" width="3837" height="2400" data-path="assets/features/custom-fields/add_custom_field.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/add_custom_field.dark.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=5a1f94aeca5657e6c97351e9c2318ec3" width="3837" height="2400" data-path="assets/features/custom-fields/add_custom_field.dark.png" />

A required checkbox must be checked before confirmation, which makes it suitable for explicit agreement to linked terms.

<img className="block dark:hidden" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/custom_fields_checkout.light.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=4b0a9764beec2cf96a3f1d9a9ee84d9f" width="1866" height="4245" data-path="assets/features/custom-fields/custom_fields_checkout.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/custom_fields_checkout.dark.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=9298cf3bc1c7132314e31e4d20267199" width="1866" height="4245" data-path="assets/features/custom-fields/custom_fields_checkout.dark.png" />

## Consume the answers

Sales views add the organization fields as columns on orders and subscriptions.

<img className="block dark:hidden" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/custom_field_data.light.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=e14fab9cdc5488b24f2914c86dd2affc" width="3840" height="2400" data-path="assets/features/custom-fields/custom_field_data.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/ruba/JDRjNJtBhntQypch/assets/features/custom-fields/custom_field_data.dark.png?fit=max&auto=format&n=JDRjNJtBhntQypch&q=85&s=a51f96eff1db336de14d970b2afb60ea" width="3840" height="2400" data-path="assets/features/custom-fields/custom_field_data.dark.png" />

The [Orders API](/api-reference/orders/get) and [Subscriptions API](/api-reference/subscriptions/get) return the same values under `custom_field_data`, keyed by slug:

```json theme={"system"}
{
  "custom_field_data": {
    "terms": true,
    "source": "social_media"
  }
}
```
