> ## 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.

# The Forwarding Request endpoint

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

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>;
  });
};

A ForwardingRequest is a one-time execution that securely forwards sensitive data to
external APIs. It allows you to make outbound requests using templated values from
Method resources (such as payment instruments, secrets, and entities) without exposing the
underlying sensitive data.

Template expressions use the `{{binding_name.path.to.field}}` syntax to reference values
from bound resources.

## ForwardingRequest Objects

<ParamList
  items={[
get_common_parameters("ForwardingRequest").id,
{
  name: "bindings",
  type: "object",
  description: (
    <>
      Map of binding name to resource ID.  
      Allowed resources: <code>payment_instrument</code>, <code>secret</code>, <code>entity</code>.
    </>
  ),
},
{
  name: "url",
  type: "string",
  description: "URL for the forwarding request. Must be one of Method's whitelisted destinations.",
},
{
  name: "method",
  type: "enum",
  description: (
    <>
      HTTP method for the outbound request.
    </>
  ),
  enums: [
    {
      name: "POST",
      description: "POST method.",
    },
  ],
},
{
  name: "headers",
  type: "object",
  description: "Key/value headers for the outbound request. Values may contain template expressions.",
},
{
  name: "body",
  type: "string",
  description: "Stringified body for the outbound request. May contain template expressions.",
},
{
  name: "request",
  type: "object",
  description: "Persisted view of the outbound request with all sensitive fields redacted.",
},
{
  name: "response",
  type: "object",
  description: "Persisted view of the upstream response.",
  items: [
    {
      name: "response.status_code",
      type: "integer",
      description: "HTTP status code from the upstream response.",
    },
    {
      name: "response.headers",
      type: "object",
      description: "Response headers from the upstream server.",
    },
    {
      name: "response.body",
      type: "object",
      description: "Parsed response body from the upstream server.",
    },
  ],
},
{
  name: "duration_ms",
  type: "integer",
  description: "Total time in milliseconds between starting the outbound request and receiving the response.",
},
{
  name: "status",
  type: "enum",
  description: "The status of the ForwardingRequest.",
  enums: [
    {
      name: "completed",
      description: "The forwarding request completed successfully.",
    },
    {
      name: "failed",
      description: "The forwarding request failed.",
    },
  ],
},
get_common_parameters("ForwardingRequest").created_at,
get_common_parameters("ForwardingRequest").updated_at,
]}
/>

<RequestExample>
  ```json THE FORWARDING REQUEST OBJECT theme={null}
  {
    "id": "freq_f6xGfRQyQxDc",
    "bindings": {
      "payment_instrument": "pmt_inst_7TNTTRQwQxWc",
      "secret": "sec_au22b1fbFrmfp",
      "entity": "ent_au22b1FBFJbp8"
    },
    "request": {
      "url": "https://sample-url/v1/tokens",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "Authorization": "Bearer {{secret.value}}"
      },
      "body": "{\"first_name\":\"John\",\"last_name\":\"Doe\",\"number\":\"{{payment_instrument.card.number}}\",\"month\":\"{{payment_instrument.card.month}}\",\"year\":\"{{payment_instrument.card.year}}\",\"cvv\":\"{{payment_instrument.card.cvv}}\",\"address1\":\"123 Main St\",\"city\":\"San Francisco\",\"state\":\"CA\",\"country\":\"US\",\"postal_code\":\"94110\"}"
    },
    "response": {
      "status_code": 200,
      "headers": {
        "content-type": "application/json; charset=utf-8",
        "x-request-id": "3a92e6c6-7661-4270-bf31-2d4cc25ea911"
      },
      "body": {
        "type": "credit_card",
        "id": "vJlxp8rHhCq9FNCNF6VYeA",
        "card": {
          "brand": "visa",
          "first_six": "411111",
          "last_four": "1111",
          "exp_month": 2,
          "exp_year": 2030,
          "issuing_country": "US",
          "funding_source": "credit"
        }
      }
    },
    "duration_ms": 953,
    "created_at": "2025-12-04T18:50:54.024Z",
    "updated_at": "2025-12-04T18:50:54.024Z",
    "status": "completed"
  }
  ```
</RequestExample>
