> ## 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 payment 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 Payment is the transfer of funds from a source checking or savings bank account to a
destination credit card, auto loan, mortgage, student loan, and more.

All Payments are processed electronically between the source and
destination, and take 2-3 business days depending on the
receiving financial institution.

#### Cutoff Times

Payments are processed on business days (Monday - Friday),
excluding US Banking Holidays.

<ul>
  <li>Source processing windows: 10:30 AM, 1:30 PM, and 4:30 PM CT</li>
  <li>Destination processing windows: 4:00 PM CT</li>
</ul>

## Payment Objects

<ParamList
  items={[
get_common_parameters('Payment').id,
{
name: 'source',
type: 'string',
required: false,
description: 'The ID of an Account from which the Payment funds will be retrieved.',
},
{
name: 'destination',
type: 'string',
required: false,
description: 'The ID of an Account where the Payment funds will be sent to.',
},
{
name: 'amount',
type: 'number',
required: false,
description: 'The amount, in cents, of the Payment. (e.g. $1.00 = 100)',
},
{
name: 'description',
type: 'string',
required: false,
description: 'The Payment\'s description (maximum of 10 characters).',
},
get_common_parameters('Payment').status([
{
  name: 'pending',
  description: 'Initial status after the Payment is created. Payment will stay in this' +
    ' state until it is processed. Payment can be deleted in this state.',
},
{
  name: 'canceled',
  description: 'The Payment was canceled and was never processed.',
},
{
  name: 'processing',
  description: 'The Payment is being processed. At this point, the Payment can no longer be deleted.',
},
{
  name: 'failed',
  description: 'An error occurred while either pulling funds from the source Account or' +
    'pushing funds to the destination Account.',
},
{
  name: 'sent',
  description: 'The Payment has been executed and sent to the banking networks.',
},
{
  name: 'posted',
  description: 'The Payment has been posted to the destination Account.',
},
{
  name: 'reversal_processing',
  description: 'The active reversal corresponding to this Payment has been approved and is being processed.',
},
{
  name: 'reversed',
  description: 'The active reversal has successfully been completed and the funds have been returned to the source Account.',
}
]),
{
name: 'estimated_completion_date',
type: 'string | null',
required: false,
description: 'An estimated date, in ISO 8601 format (YYYY-MM-DD), on which the Payment should be completed.',
},
{
name: 'source_trace_id',
type: 'string | null',
required: false,
description: 'The underlying ID for the bank transaction on the source Account relating to this Payment.',
},
{
name: 'source_settlement_date',
type: 'string | null',
required: false,
description: 'An estimated date, in ISO 8601 format (YYYY-MM-DD), on which the funds ' +
  'pulled from the source Account will be completed.',
},
{
name: 'source_status',
type: 'enum',
required: false,
description: 'The status of the pulling of funds from the source Account.',
enums: [
  {
    name: 'pending',
    description: 'The funds are scheduled to be pulled on the next cutoff window.',
  },
  {
    name: 'canceled',
    description: 'An error occurred while requesting to pull funds from the source Account.',
  },
  {
    name: 'returned',
    description: 'Failed to pull funds from the source Account.',
  },
  {
    name: 'sent',
    description: 'The funds were successfully pulled from the source Account.',
  }
],
},
{
name: 'destination_trace_id',
type: 'string | null',
required: false,
description: 'The underlying ID for the bank transaction on the destination Account relating to this Payment.',
},
{
name: 'destination_payment_method',
type: 'enum',
required: false,
description: 'The payment method used to process the Payment.',
enums: [
  {
    name: 'electronic',
    description: 'Electronic payment.',
  },
  {
    name: 'paper',
    description: 'Paper check payment.',
  },
],
},
{
name: 'destination_settlement_date',
type: 'string | null',
required: false,
description: 'An estimated date, in ISO 8601 format (YYYY-MM-DD), on which the funds ' +
  'sent to the destination Account will be completed.',
},
{
name: 'destination_status',
type: 'enum',
required: false,
description: 'The status of the push of funds to the destination Account.',
enums: [
  {
    name: 'pending',
    description: 'The funds are scheduled to be pushed on the next cutoff window.',
  },
  {
    name: 'processing',
    description: 'A request to push the funds to the destination Account has been initiated.',
  },
  {
    name: 'failed',
    description: 'An error occurred while requesting to push funds to the destination Account.',
  },
  {
    name: 'sent',
    description: 'The funds were successfully pushed to the destination Account.',
  },
  {
    name: 'posted',
    description: 'The funds have been posted to the destination Account.',
  },
  {
    name: 'returned',
    description: 'The funds have been returned from the destination Account.',
  },
],
},
{
name: 'reversal_id',
type: 'string | null',
required: false,
description: 'The ID of an active Reversal.',
},
{
name: 'reversal_account',
type: 'string',
required: false,
description: 'ID of the account that will be targeted in the event of a payment reversal. Defaults to the source account.'
},
{
name: 'payment_instrument',
type: 'string | null',
required: false,
description: (
  <>
    The ID of the Payment Instrument (<code>pmt_inst_*</code>) used to fund the Payment, if applicable.
    This is set on Payments funded by a Payment Instrument rather than directly from a source Account.
  </>
),
},
{
name: 'fee',
type: 'object | null',
required: false,
description: 'Fee details associated with the Payment, if applicable.',
items: [
  {
    name: 'type',
    type: 'enum',
    required: false,
    description: 'The type of fee.',
    enums: [
      {
        name: 'total',
        description: 'A fee that represents the total fee amount included in the Payment.',
      },
    ],
  },
  {
    name: 'amount',
    type: 'number',
    required: false,
    description: 'The fee amount, in cents.',
  },
],
},
{
name: 'type',
type: 'enum',
required: false,
description: 'The type of Payment.',
enums: [
  {
    name: 'standard',
    description: 'A standard Payment between a source and destination Account.',
  },
  {
    name: 'clearing',
    description: 'An internal clearing Payment used to move funds through Method-managed clearing accounts.',
  },
],
},
{
name: 'fund_status',
type: 'enum',
required: false,
description: 'A status indicating the flow of funds throughout the lifecycle of the Payment. ' +
  'Only returned on the retrieve endpoint.',
enums: [
  {
    name: 'pending',
    description: 'Initial fund status after the Payment is created.',
  },
  {
    name: 'pending_consolidation',
    description: 'Source funds have not yet been transmitted, pending consolidation with other Payments.',
  },
  {
    name: 'transmitting',
    description: 'The Payment funds are being transmitted to the source Account.',
  },
  {
    name: 'transmitted',
    description: 'A request to pull funds from the source Account has been made.',
  },
  {
    name: 'requested',
    description: 'The Payment funds have been requested from the source Account.',
  },
  {
    name: 'clearing',
    description: 'The Payment funds from the source Account have been received.',
  },
  {
    name: 'pending_clearing',
    description: 'Funds for a clearing Payment have not yet been cleared.',
  },
  {
    name: 'hold',
    description: 'Source funds have been received but are being held before being sent to the destination Account.',
  },
  {
    name: 'sent',
    description: 'The Payment funds have been sent to the destination Account.',
  },
  {
    name: 'posted',
    description: 'The Payment funds have been posted to the destination Account.',
  },
  {
    name: 'failed',
    description: 'The clearing of funds for a Payment have failed.',
  },
  {
    name: 'unknown',
    description: 'The fund status could not be determined.',
  },
],
},
get_common_parameters('Payment').error,
get_common_parameters('Payment').metadata,
get_common_parameters('Payment').created_at,
get_common_parameters('Payment').updated_at,
]}
/>

<RequestExample>
  ```json THE PAYMENT OBJECT theme={null}
  {
    "id": "pmt_VeCfmkwGKb",
    "source": "acc_hmap9mbgfLcf9",
    "destination": "acc_YXDrjADGjC76U",
    "amount": 5000,
    "description": "Loan Pmt",
    "status": "processing",
    "estimated_completion_date": "2024-03-21",
    "source_trace_id": "203942084920",
    "source_settlement_date": "2024-03-15",
    "source_status": "sent",
    "destination_trace_id": "304820184832",
    "destination_settlement_date": "2024-03-21",
    "destination_status": "processing",
    "destination_payment_method": "electronic",
    "reversal_id": null,
    "reversal_account": "acc_hmap9mbgfLcf9",
    "payment_instrument": null,
    "fee": null,
    "type": "standard",
    "fund_status": "sent",
    "error": null,
    "metadata": null,
    "created_at": "2024-03-14T16:15:26.074Z",
    "updated_at": "2024-03-14T16:15:26.074Z"
  }
  ```
</RequestExample>
