---
title: "Update a Payment"
method: PATCH
path: "/api/payments/{payment_ref}/"
tags: ["Payments"]
---

# Update a Payment

`PATCH /api/payments/{payment_ref}/`

> ⚠️ Update Payment Requests Server-Side
>
> To keep your app secure, requests to update a `Payment` should only be generated on the server-side.

A `PATCH` request to `/payments/{payment_ref}/` updates an existing Forage `Payment`.

On success, the API responds with the updated [Payment](https://docs.joinforage.app/reference/payments) object.

The `status` property of the `Payment` determines what data can be updated. If the `status` is `processing`, `cancelled`, or `succeeded`, then only the following `Payment` fields can be modified:

- `metadata`
- `external_order_id`

During these statuses, Forage ignores attempts to update other `Payment` fields.

> 📘 Required For Server-Side Capture
>
> You need to use this endpoint if you're building an integration that [defers payment capture to the server](https://docs.joinforage.app/docs/capture-ebt-payments-server-side).

## Headers

- `Authorization` string, required
- `Merchant-Account` string, required
- `Idempotency-Key` string, required

## Request body

- PaymentRequest — This object represents a single payment. It is associated with a single payment method.
  - `amount` number — A positive decimal number that represents how much to charge the [`PaymentMethod`](https://docs.joinforage.app/reference/payment-methods) in USD. Precision is supported to the penny. The minimum amount that can be charged is `0.01`. To differentiate between a SNAP and an EBT Cash charge on the same EBT Card, use the `funding_type` field. If you need to charge both funding types, then create a `Payment` for each charge.
  - `funding_type` 'ebt_snap' | 'ebt_cash' | 'credit_tpp' | 'credit_payfac' — The payment instrument type. Use this field to differentiate between a SNAP (`ebt_snap`) and an EBT Cash (`ebt_cash`) charge on the same EBT Card. If you need to charge both funding types, then create a `Payment` for each charge. Use `credit_payfac` for all charges to HSA/FSA cards. `credit_tpp` is the funding type assigned to non-EBT payment objects created via a Fully Hosted Checkout integration.
  - `payment_method` string — The unique reference hash for the existing Forage [`PaymentMethod`](https://docs.joinforage.app/reference/payment-methods) that is to be charged in this transaction. ⚠️ **Exception**: POS integrations do not need to provide a `payment_method` when creating a payment.
  - `delivery_address` DeliveryAddressData — ⚠️ **Exception**: If the purchase is made in-store via a POS Terminal, then a `delivery_address` is not required when creating a `Payment`. The address for delivery or pickup of the `Order`. Per FNS regulations, this value must always be provided. If the `Order` is for pickup, then use the merchant address.
    - `city` string — The name of the city.
    - `country` string — Either `us` or `US`. Defaults to `US` if not provided.
    - `line1` string, required — The first line of the street address.
    - `line2` string, nullable — The second line of the street address.
    - `zipcode` string, required — The zip or postal code.
    - `state` string — The two-letter abbreviation, can be upper or lowercase, for the US state.
  - `is_delivery` boolean — ⚠️ **Exception**: If the purchase is made in-store via a POS Terminal, then a `is_delivery` is not required when creating a `Payment`. Whether the order is for delivery or pickup. This information is required per FNS regulations. Defaults to `false` if not provided.
  - `description` string — A description of the payment.
  - `metadata` MetadataObject — A required object containing merchant-defined key-value pairs to provide additional context for the payment. Merchants should use this field to store **reference information** relevant to the transaction (for example, order details, system identifiers, or tracking data). This helps link the payment to records within their system. Pass an empty object (`{}`) if no additional information is available. > ⚠️ Personally Identifiable Information > > **Do not include personally identifiable information (PII)** such as names, emails, or payment details.
  - `platform_fee` number — An optional field, for use by a platform supporting multiple merchants, that indicates the percentage cut of each payment that the platform charges as a fee.
  - `platform_fixed_settlement` number — The fixed amount in USD that a platform takes from EBT Cash payments prior to splitting by the `platform_fee`. Precision is supported to the penny.
  - `merchant_fixed_settlement` number — The fixed amount in USD that should be restored to the merchant from EBT Cash payments prior to splitting by the `platform_fee`. Precision is supported to the penny.
  - `tpp_lookup_id` string — An identifier for the credit/debit TPP. For Stripe integrations, the client secret for a Stripe `PaymentIntent`.
  - `customer_id` string — **⚠️ If you’re integrating Forage with a POS Terminal, then do not use this param. It is only supported for online transactions.** A unique identifier for the end customer making the payment. Forage automatically adds the `customer_id` to the Session's corresponding `Order` and `OrderPayments`. This field helps Forage's servers more quickly identify the customer associated with the request. While `customer_id` is not technically required, if you omit it then requests could take longer to process. **It is strongly recommended to pass customer_id.** If you're providing your internal customer ID, then we recommend that you hash the value before sending it on the payload. Each customer should only have one unique `customer_id`. For example, if you create both a `PaymentMethod` and a Forage `Session` (Fully Hosted or Custom) or `Payment` (SDK) for the same customer, then the `customer_id` should be the same in both requests to ensure continuity of stored payment methods.
  - `external_order_id` string — A unique identifier for the order as created by the merchant or platform (not Forage). When a merchant or platform passes this order ID to Forage, it persists in each Forage transaction related to the `Order`. This field enables merchants to map order IDs in their system to corresponding Forage `Order` IDs. **You must build with Forage Version `2023-05-15` or later to use `external_order_id`.** Either pass `2023-05-15` as the `API-Version` header on a per request basis, or set the version for all requests in the Forage dashboard.
  - `merchant_destination_account` string — A unique reference hash for the bank account that is to receive funds settlement for this payment. Use this field if you're settling funds across multiple merchant bank accounts. Reach out to your Forage account manager for details on generating a hash. Defaults to the hash for the default merchant bank account if not provided.
  - `pos_terminal` object — **⚠️ This param is only supported for POS Terminal integrations. Do not use this param for online transactions.** An object that details information about the POS Terminal that processes the payment.
    - `provider_terminal_id` string — A unique string that identifies the POS Terminal.
  - `external_location_id` string — A unique identifier, provided by the merchant or platform (not Forage), that indicates the physical fulfillment location for the order. For example, this field could specify which location of a grocery store chain fulfilled an order.

## Response `200`

__OK__ - Success

- PaymentResponse — This object represents a single payment. It is associated with a single payment method.
  - `amount` number — A positive decimal number that represents how much to charge the [`PaymentMethod`](https://docs.joinforage.app/reference/payment-methods) in USD. Precision is supported to the penny. The minimum amount that can be charged is `0.01`. To differentiate between a SNAP and an EBT Cash charge on the same EBT Card, use the `funding_type` field. If you need to charge both funding types, then create a `Payment` for each charge.
  - `funding_type` 'ebt_snap' | 'ebt_cash' | 'credit_tpp' | 'credit_payfac' — The payment instrument type. Use this field to differentiate between a SNAP (`ebt_snap`) and an EBT Cash (`ebt_cash`) charge on the same EBT Card. If you need to charge both funding types, then create a `Payment` for each charge. Use `credit_payfac` for all charges to HSA/FSA cards. `credit_tpp` is the funding type assigned to non-EBT payment objects created via a Fully Hosted Checkout integration.
  - `payment_method` string — The unique reference hash for the existing Forage [`PaymentMethod`](https://docs.joinforage.app/reference/payment-methods) that is to be charged in this transaction. ⚠️ **Exception**: POS integrations do not need to provide a `payment_method` when creating a payment.
  - `delivery_address` DeliveryAddressData — ⚠️ **Exception**: If the purchase is made in-store via a POS Terminal, then a `delivery_address` is not required when creating a `Payment`. The address for delivery or pickup of the `Order`. Per FNS regulations, this value must always be provided. If the `Order` is for pickup, then use the merchant address.
    - `city` string — The name of the city.
    - `country` string — Either `us` or `US`. Defaults to `US` if not provided.
    - `line1` string, required — The first line of the street address.
    - `line2` string, nullable — The second line of the street address.
    - `zipcode` string, required — The zip or postal code.
    - `state` string — The two-letter abbreviation, can be upper or lowercase, for the US state.
  - `is_delivery` boolean — ⚠️ **Exception**: If the purchase is made in-store via a POS Terminal, then a `is_delivery` is not required when creating a `Payment`. Whether the order is for delivery or pickup. This information is required per FNS regulations. Defaults to `false` if not provided.
  - `description` string — A description of the payment.
  - `metadata` MetadataObject — A required object containing merchant-defined key-value pairs to provide additional context for the payment. Merchants should use this field to store **reference information** relevant to the transaction (for example, order details, system identifiers, or tracking data). This helps link the payment to records within their system. Pass an empty object (`{}`) if no additional information is available. > ⚠️ Personally Identifiable Information > > **Do not include personally identifiable information (PII)** such as names, emails, or payment details.
  - `platform_fee` number — An optional field, for use by a platform supporting multiple merchants, that indicates the percentage cut of each payment that the platform charges as a fee.
  - `platform_fixed_settlement` number — The fixed amount in USD that a platform takes from EBT Cash payments prior to splitting by the `platform_fee`. Precision is supported to the penny.
  - `merchant_fixed_settlement` number — The fixed amount in USD that should be restored to the merchant from EBT Cash payments prior to splitting by the `platform_fee`. Precision is supported to the penny.
  - `tpp_lookup_id` string — An identifier for the credit/debit TPP. For Stripe integrations, the client secret for a Stripe `PaymentIntent`.
  - `customer_id` string — **⚠️ If you’re integrating Forage with a POS Terminal, then do not use this param. It is only supported for online transactions.** A unique identifier for the end customer making the payment. Forage automatically adds the `customer_id` to the Session's corresponding `Order` and `OrderPayments`. This field helps Forage's servers more quickly identify the customer associated with the request. While `customer_id` is not technically required, if you omit it then requests could take longer to process. **It is strongly recommended to pass customer_id.** If you're providing your internal customer ID, then we recommend that you hash the value before sending it on the payload. Each customer should only have one unique `customer_id`. For example, if you create both a `PaymentMethod` and a Forage `Session` (Fully Hosted or Custom) or `Payment` (SDK) for the same customer, then the `customer_id` should be the same in both requests to ensure continuity of stored payment methods.
  - `external_order_id` string — A unique identifier for the order as created by the merchant or platform (not Forage). When a merchant or platform passes this order ID to Forage, it persists in each Forage transaction related to the `Order`. This field enables merchants to map order IDs in their system to corresponding Forage `Order` IDs. **You must build with Forage Version `2023-05-15` or later to use `external_order_id`.** Either pass `2023-05-15` as the `API-Version` header on a per request basis, or set the version for all requests in the Forage dashboard.
  - `merchant_destination_account` string — A unique reference hash for the bank account that is to receive funds settlement for this payment. Use this field if you're settling funds across multiple merchant bank accounts. Reach out to your Forage account manager for details on generating a hash. Defaults to the hash for the default merchant bank account if not provided.
  - `pos_terminal` object — **⚠️ This param is only supported for POS Terminal integrations. Do not use this param for online transactions.** An object that details information about the POS Terminal that processes the payment.
    - `provider_terminal_id` string — A unique string that identifies the POS Terminal.
  - `external_location_id` string — A unique identifier, provided by the merchant or platform (not Forage), that indicates the physical fulfillment location for the order. For example, this field could specify which location of a grocery store chain fulfilled an order.
  - `ref` string — A unique reference hash for the Forage `Payment` object. _Note:_ `receipt.ref_number` equals `ref`. You need to pass this value to the front-end SDK method that captures the payment.
  - `merchant` string — A string that represents a unique merchant ID that Forage provides during onboarding.
  - `status` 'requires_confirmation' | 'processing' | 'canceled' | 'succeeded' | 'failed' | 'authorized' — The status of the `Payment`. One of: - `canceled`: The `Payment`object can't be used. - `failed`: If the error is temporary, then this `Payment` can be resubmitted for capture without modification. Check the `receipt.message` field for a description of the error. - `processing`: The outcome of the `Payment` is pending. - `requires_confirmation`: The `Payment` hasn't been submitted for processing. - `succeeded`: The `Payment` has been successfully processed and will be included in settlement. It can't be changed. - `authorized`: The `Payment` has been authorized, but not yet captured. Only applicable to HSA payments.
  - `created` string, date-time — A UTC timestamp of when the `Payment` was created, represented as an [ISO 8601 date-time](https://www.iso.org/iso-8601-date-and-time-format.html) string.
  - `updated` string, date-time — A UTC timestamp of that indicates when the `Payment` was last modified, represented as an [ISO 8601 date-time](https://www.iso.org/iso-8601-date-and-time-format.html) string.
  - `expires_at` string, date-time — A UTC timestamp of when the `Payment` will expire if it is not captured or canceled, set to 30 minutes from when the `Payment` is created. If the `status` of the `Payment` is `succeeded` or `canceled`, then the `expires_at` value is `null`.
  - `success_date` string, date-time — A UTC timestamp of when the `Payment` was successfully processed, represented as an [ISO 8601 date-time](https://www.iso.org/iso-8601-date-and-time-format.html) string. This value is `null` until the Payment enters the `succeeded` or `partial_capture` states.
  - `refunds` string[] — References to the `Refund`s attached to this payment. The format depends on the `with_refunds` query parameter: - **Default behavior** (when `with_refunds` is `false` or omitted): Array of refund reference strings - **Expanded behavior** (when `with_refunds=true`): Array of full `Refund` objects with complete refund details
  - `receipt` object — Most of the information that you're required to display to the customer, according to FNS regulations. This field is `null` if the data that populates the receipt is not yet available. The total amount paid by the customer is `snap_amount` + `ebt_cash_amount` + `other_amount`. This amount will be settled with the merchant after applying Forage's fees.
  - `last_processing_error` object — The `code` and `message` values corresponding to the most recent [Payments API error](https://docs.joinforage.app/reference/errors#payments-api-errors). Always `null` when the `Payment` is created.
  - `previous_errors` object[] — An array with information about the error.
    - `code` string — A short string that represents the error.
    - `message` string — A developer-facing message with more details about the error, not to be displayed to customers.
    - `source` object
      - `resource` string — The type of the Forage resource involved in the error.
      - `ref` string — If applicable, the ten character reference hash of the Forage resource that caused the error. An empty string if no specific individual resource was involved.
    - `details` object — Additional details about the error, if applicable.
  - `address_postal_code_check` 'pass' | 'fail' | 'unavailable' | 'unchecked' — The result of any check done on the delivery address zip code. One of: - `pass`: The provided information is correct and matches the data on file with the card issuer. - `fail`: The provided information is incorrect and does not match the data on file. - `unavailable`: The card issuer will not perform the check. - `unchecked`: The information was provided but has not yet been checked by the card issuer.
  - `cvc_check` 'pass' | 'fail' | 'unavailable' | 'unchecked' — The result of any check done on the CVC. One of: - `pass`: The provided information is correct and matches the data on file with the card issuer. - `fail`: The provided information is incorrect and does not match the data on file. - `unavailable`: The card issuer will not perform the check. - `unchecked`: The information was provided but has not yet been checked by the card issuer.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `409` — Conflict
- `423` — __Locked__ - The request could not be completed because the target resource is currently locked.
- `429` — Too Many Requests
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.dev/joinforage/apis/forage-payments-api.md) · [All operations](https://skmtc.dev/joinforage/apis/forage-payments-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/joinforage/forage-payments-api/revisions/4b7212706fae/schema)
