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

# Create Preauth Signals

export const ParamList = ({items = [], is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen || false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map((enum_item, index) => <div key={`enum-${index}`}>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </div>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Computes a PreauthSignals assessment for a given card or account. Provide either
an `account_id` for an authenticated Method Account, or a `card` object with raw card
identifiers. Optionally include `purchase` context to improve the prediction.

<Note>
  Exactly one of `account_id` or `card` is required. Providing both will return a `400` error.
</Note>

## Body

<ParamList
  items={[
{ name: 'account_id', type: 'string', required: false, description: 'The ID of an authenticated Method Account. Mutually exclusive with the card object.' },
{
name: 'card', type: 'object', required: false,
description: 'Raw card identifiers for non-authenticated lookup. Mutually exclusive with account_id.',
items: [
  { name: 'card.bin6', type: 'string', required: true, description: 'First 6 digits of the card number.' },
  { name: 'card.last4', type: 'string', required: true, description: 'Last 4 digits of the card number.' },
  { name: 'card.first_name', type: 'string', required: true, description: 'Cardholder first name.' },
  { name: 'card.last_name', type: 'string', required: true, description: 'Cardholder last name.' },
  { name: 'card.phone', type: 'string', required: true, description: 'Cardholder phone number. E.164 format.' },
  { name: 'card.zip', type: 'string', required: false, description: 'Cardholder ZIP code. Improves match rate when provided.' }
]
},
{
name: 'purchase', type: 'object', required: false,
description: 'Optional transaction context. Richer input improves the prediction.',
items: [
  { name: 'purchase.amount', type: 'integer', required: false, description: 'Charge amount in cents.' },
  { name: 'purchase.mcc', type: 'string', required: false, description: 'Merchant category code.' },
  { name: 'purchase.ip_address', type: 'string', required: false, description: 'Cardholder IP address at checkout.' },
  { name: 'purchase.txn_time', type: 'string', required: false, description: 'ISO 8601 timestamp of intended charge. Defaults to request time.' }
]
}
]}
/>

## Returns

Returns a PreauthSignals object.

<br />

<RequestExample>
  ```bash cURL theme={null}
  curl https://production.methodfi.com/preauth \
    -X POST \
    -H "Method-Version: 2025-07-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "card": {
        "bin6": "411111",
        "last4": "1234",
        "first_name": "Jane",
        "last_name": "Doe",
        "phone": "+15555555555",
        "zip": "10001"
      },
      "purchase": {
        "amount": 9999,
        "mcc": "4511",
        "ip_address": "203.0.113.42",
        "txn_time": "2026-05-28T14:00:00Z"
      }
    }'
  ```

  ```javascript Node.js theme={null}
  const preauth = await method
    .preauth
    .create({
      card: {
        bin6: '411111', last4: '1234',
        first_name: 'Jane', last_name: 'Doe',
        phone: '+15555555555',
        zip: '10001',
      },
      purchase: {
        amount: 9999, mcc: '4511',
        ip_address: '203.0.113.42',
        txn_time: '2026-05-28T14:00:00Z',
      },
    });
  ```

  ```python Python theme={null}
  preauth = method.preauth.create({
    'card': {
      'bin6': '411111', 'last4': '1234',
      'first_name': 'Jane', 'last_name': 'Doe',
      'phone': '+15555555555',
      'zip': '10001'
    },
    'purchase': {
      'amount': 9999, 'mcc': '4511',
      'ip_address': '203.0.113.42',
      'txn_time': '2026-05-28T14:00:00Z'
    }
  })
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "preauth_qV7kRaFm4JNxw",
    "account_id": "acc_4m9amk4KFiaQX",
    "status": "completed",
    "verified_ownership": "match",
    "card_standing": "open",
    "success_likelihood": 0.87,
    "optimal_retry_date": "2026-06-02",
    "error": null,
    "metadata": null,
    "created_at": "2026-05-28T14:00:00.000Z",
    "updated_at": "2026-05-28T14:00:00.180Z"
  }
  ```
</ResponseExample>
