---
updatedAt: 2026-05-07T18:17:26.000Z
agentTools:
  projectIndex: https://docs.joinforage.app/llms.txt
---

# Update an OrderPayment

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

A `PATCH` request to `/orders/{order_ref}/payments/{payment_ref}/` updates an existing Forage `OrderPayment`.

On success, the API responds with the updated [OrderPayment](ref:order-payments) object.

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

- `metadata`
- `external_order_id`

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


# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": false
  },
  "info": {
    "title": "Forage Payments API",
    "description": "The Forage Payments API is a REST API for processing Electronic Benefits Transfer (EBT) payments (SNAP and EBT Cash) in your e-commerce or in-store application.\n\nProcessing any EBT payment, or checking an EBT card's balance, requires the cardholder's PIN. Federal regulations require all PIN entry to happen through a PCI-compliant, USDA-approved interface. Forage provides that interface, so EBT PIN collection always happens through a Forage-hosted surface (Forage Checkout or a Forage SDK), never directly in your own form. Some endpoints (for example, capture and balance) are only reachable through that surface because they require PIN data in the request.\n\nEBT rarely covers an entire order: items like delivery fees and non-eligible products can't be paid with SNAP or EBT Cash. You decide how to handle the remaining balance (split tender) and any credit or debit processing alongside the EBT portion.\n\nForage offers four integration options. Pick the one that fits your platform and engineering resources:\n\n1. **Fully Hosted Checkout.** Forage processes EBT and credit/debit through a Forage-hosted Checkout UI. Lowest engineering effort, and Forage absorbs most error handling. See the [Fully Hosted Checkout guide](https://docs.joinforage.app/docs/fully-hosted).\n2. **Custom Checkout.** Forage processes EBT; you handle split tender, taxes, and credit/debit in your own checkout flow. Best when you want minimal changes to your existing UX. See the [Custom Checkout guide](https://docs.joinforage.app/docs/custom).\n3. **Online SDKs.** Client-side SDKs for [web](https://docs.joinforage.app/docs/forage-js), [iOS](https://docs.joinforage.app/docs/ios), and [Android](https://docs.joinforage.app/docs/android) that collect EBT PINs in your app while keeping you out of PCI scope.\n4. **POS Terminal SDK.** Accept in-person EBT payments on an Android POS device. See the [POS Terminal guide](https://docs.joinforage.app/docs/forage-terminal-android).\n\nAs a general principle, any data created by your requests, or by your customers on a Forage-hosted surface, is retrievable through GET requests to the appropriate resource.\n\nHave more questions? Use our [contact form](https://www.joinforage.com/get-in-touch) to reach our sales and engineering support teams.\n",
    "contact": {
      "name": "API Support",
      "email": "engineering@joinforage.com"
    },
    "version": "2025-08-04"
  },
  "externalDocs": {
    "description": "Forage documentation",
    "url": "https://docs.joinforage.app/"
  },
  "servers": [
    {
      "url": "https://{environment}.joinforage.app",
      "variables": {
        "environment": {
          "default": "api.sandbox",
          "enum": [
            "api",
            "api.sandbox"
          ]
        }
      }
    }
  ],
  "security": [],
  "paths": {
    "/api/orders/{order_ref}/payments/{payment_ref}/": {
      "parameters": [
        {
          "name": "order_ref",
          "in": "path",
          "description": "A unique reference hash for the Forage `Order` object, returned when the order’s parent [`Session`](ref:forage-sessions) was created.",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "payment_ref",
          "in": "path",
          "description": "A unique reference hash for the Forage `OrderPayment` object, returned when the [`OrderPayment` was created](ref:create-order-payment).",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/MerchantAccountHeader"
        },
        {
          "$ref": "#/components/parameters/APIVersionHeader"
        }
      ],
      "patch": {
        "parameters": [
          {
            "$ref": "#/components/parameters/AuthenticationBearerTokenHeader"
          },
          {
            "$ref": "#/components/parameters/MerchantAccountHeader"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyHeader"
          }
        ],
        "tags": [
          "Payments"
        ],
        "summary": "Update an OrderPayment",
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl --request PATCH \\\n    --url https://api.sandbox.joinforage.app/api/orders/<order_ref>/payments/cc3175bfea/ \\\n    --header 'Authorization: Bearer <api_key>' \\\n    --header 'Merchant-Account: <merchant-id>' \\\n    --header 'Idempotency-Key: <idempotency-key>' \\\n    --header 'accept: application/json' \\\n    --header 'content-type: application/json' \\\n    --data '\n{\n  \"external_order_id\": \"<external-order-id>\"\n}\n'\n"
            }
          ]
        },
        "description": "> ⚠️ Update `OrderPayment` Server-Side Only\n>\n> To keep your app secure, requests to update an `OrderPayment` should only be generated on the server-side.\n\nA `PATCH` request to `/orders/{order_ref}/payments/{payment_ref}/` updates an existing Forage `OrderPayment`.\n\nOn success, the API responds with the updated [OrderPayment](ref:order-payments) object.\n\nThe `status` property of the `OrderPayment` determines what data can be updated. If the `status` is `processing`, `canceled`, or `succeeded`, then only the following `Payment` fields can be modified:\n\n- `metadata`\n- `external_order_id`\n\nDuring these statuses, Forage ignores attempts to update other `OrderPayment` fields.\n",
        "operationId": "PATCH Update an order payment",
        "security": [
          {
            "OAuth2": [
              "internal",
              "pinpad_only"
            ]
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/Payment"
        },
        "responses": {
          "200": {
            "description": "__OK__ - Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderPaymentResponse"
                }
              }
            }
          },
          "400": {
            "description": "__Bad request__ - The request was not accepted because of an error in the request body or path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseObject"
                },
                "examples": {
                  "cannot_parse_request_body": {
                    "summary": "Cannot Parse Request Body",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "cannot_parse_request_body",
                          "message": "Parsing 'payment_method' field failed",
                          "source": {
                            "resource": "Orders",
                            "ref": "{order_ref}"
                          }
                        }
                      ]
                    }
                  },
                  "different_ebt_card": {
                    "summary": "Different EBT Card",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "different_ebt_card",
                          "message": "Order {order_ref} already has EBT Payment {payment_ref} with payment_method {payment_method_ref}. Your request included payment_method {payment_method_ref}. You must use the same EBT payment_method for all EBT Payments on an Order",
                          "source": {
                            "resource": "Orders",
                            "ref": "{order_ref}"
                          }
                        }
                      ]
                    }
                  },
                  "duplicate_funding_type": {
                    "summary": "Duplicate funding type",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "duplicate_funding_type",
                          "message": "Order {order_ref} already has payment {payment_ref} with funding_type {funding_type}. Please modify the existing payment object instead of adding new payments with the same funding_type",
                          "source": {
                            "resource": "Orders",
                            "ref": "{order_ref}"
                          }
                        }
                      ]
                    }
                  },
                  "exceeds_ebt_cash_total": {
                    "summary": "Exceeds EBT Cash total",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "exceeds_ebt_cash_total",
                          "message": "Order {order_ref} has EBT-Cash payments {payment_ref} with amounts that combined exceed the Cash eligible total of {cash_total}. Please update the Order Payments before capturing the order",
                          "source": {
                            "resource": "Orders",
                            "ref": "{order_ref}"
                          }
                        }
                      ]
                    }
                  },
                  "exceeds_snap_total": {
                    "summary": "Exceeds SNAP total",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "exceeds_snap_total",
                          "message": "Order {order_ref} has EBT-SNAP payments {payment_ref} with amounts that combined exceed the SNAP eligible total of {cash_total}. Please update the Order Payments before capturing the order",
                          "source": {
                            "resource": "Orders",
                            "ref": "{order_ref}"
                          }
                        }
                      ]
                    }
                  },
                  "invalid_input_data": {
                    "summary": "Invalid Input Data",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "invalid_input_data",
                          "message": "Query parameter missing or incomplete.",
                          "source": {
                            "resource": "Orders",
                            "ref": "{order_ref}"
                          }
                        }
                      ]
                    }
                  },
                  "invalid_merchant_account": {
                    "summary": "Invalid Merchant Account",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "invalid_merchant_account",
                          "message": "Merchant account Merchant ID not valid.",
                          "source": {
                            "resource": "Merchants"
                          }
                        }
                      ]
                    }
                  },
                  "missing_idempotency_key": {
                    "summary": "Missing Idempotency Key",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "missing_idempotency_key",
                          "message": "You must include a value for the IDEMPOTENCY-KEY header in your requests to this endpoint.",
                          "source": {
                            "resource": "Idempotency_Key"
                          }
                        }
                      ]
                    }
                  },
                  "missing_merchant_account": {
                    "summary": "Missing Merchant Account",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "missing_merchant_account",
                          "message": "No merchant account was provided.",
                          "source": {
                            "resource": "Merchants"
                          }
                        }
                      ]
                    }
                  },
                  "order_is_cancelled": {
                    "summary": "Order Is Cancelled",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "order_is_cancelled",
                          "message": "Order {order_ref} has been cancelled and therefore cannot have new payments added. Please create a new order to continue.",
                          "source": {
                            "resource": "Orders",
                            "ref": "{order_ref}"
                          }
                        }
                      ]
                    }
                  },
                  "unknown_fields_error": {
                    "summary": "Unknown Fields Error",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "unknown_fields_error",
                          "message": "Unknown field(s) provided: {unknown_fields}",
                          "source": {
                            "resource": "Orders"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseObject"
                },
                "examples": {
                  "invalid_token": {
                    "summary": "Invalid Token",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "invalid_token",
                          "message": "Incorrect authentication credentials.",
                          "source": {
                            "resource": "Accounts",
                            "ref": ""
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseObject"
                },
                "examples": {
                  "invalid_field_update_error": {
                    "summary": "Immutable Fields",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "invalid_field_update_error",
                          "message": "Immutable fields {invalid_update_fields} cannot be updated",
                          "source": {
                            "resource": "Orders",
                            "ref": "{order_ref}"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "__Not Found__ - The requested resource was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseObject"
                },
                "example": {
                  "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                  "errors": [
                    {
                      "code": "resource_not_found",
                      "message": "Order with ref {order_ref} does not exist for current Merchant with FNS {fns_number}",
                      "source": {
                        "resource": "Orders",
                        "ref": "{order_ref}"
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseObject"
                },
                "examples": {
                  "cannot_change_request": {
                    "summary": "Cannot Change Request",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "cannot_change_request",
                          "message": "Two requests were submitted with the same idempotency key, but slightly different request bodies. Please use a new idempotency key if you intended to change the request body",
                          "source": {
                            "resource": "Idempotency_Key"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseObject"
                },
                "examples": {
                  "too_many_requests": {
                    "summary": "Too Many Requests",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "too_many_requests",
                          "message": "Request was throttled, please try again later.",
                          "source": {
                            "resource": "Orders",
                            "ref": "{order_ref}"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseObject"
                },
                "examples": {
                  "unknown_server_error": {
                    "summary": "Unknown Server Error",
                    "value": {
                      "path": "/api/orders/{order_ref}/payments/{payment_ref}/",
                      "errors": [
                        {
                          "code": "unknown_server_error",
                          "message": "Unknown exception from EBT network",
                          "source": {
                            "resource": "Unknown"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorsArray": {
        "type": "array",
        "description": "An array with information about the error.",
        "items": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string",
              "description": "A short string that represents the error."
            },
            "message": {
              "type": "string",
              "description": "A developer-facing message with more details about the error, not to be displayed to customers."
            },
            "source": {
              "type": "object",
              "properties": {
                "resource": {
                  "type": "string",
                  "description": "The type of the Forage resource involved in the error."
                },
                "ref": {
                  "type": "string",
                  "description": "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": {
              "type": "object",
              "description": "Additional details about the error, if applicable."
            }
          }
        },
        "example": []
      },
      "ErrorResponseObject": {
        "type": "object",
        "description": "An object that includes details about the error.",
        "properties": {
          "path": {
            "type": "string",
            "description": "The requested endpoint."
          },
          "errors": {
            "$ref": "#/components/schemas/ErrorsArray"
          }
        }
      },
      "PaymentRequest": {
        "type": "object",
        "description": "This object represents a single payment. It is associated with a single payment method.",
        "properties": {
          "amount": {
            "type": "string",
            "format": "decimal",
            "description": "A positive decimal number that represents how much to charge the [`PaymentMethod`](ref: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": {
            "type": "string",
            "description": "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.",
            "enum": [
              "ebt_snap",
              "ebt_cash",
              "credit_tpp",
              "credit_payfac",
              "benefit",
              "wic"
            ]
          },
          "payment_method": {
            "type": "string",
            "description": "The unique reference hash for the existing Forage [`PaymentMethod`](ref:payment-methods) that is to be charged in this transaction.\n\n⚠️ **Exception**: POS integrations do not need to provide a `payment_method` when creating a payment.\n"
          },
          "delivery_address": {
            "$ref": "#/components/schemas/DeliveryAddressData"
          },
          "is_delivery": {
            "type": "boolean",
            "description": "⚠️ **Exception**: If the purchase is made in-store via a POS Terminal, then a `is_delivery` is not required when creating a `Payment`.\n\nWhether the order is for delivery or pickup. This information is required per FNS regulations. Defaults to `false` if not provided.\n"
          },
          "description": {
            "type": "string",
            "description": "A description of the payment."
          },
          "metadata": {
            "$ref": "#/components/schemas/MetadataObject"
          },
          "platform_fee": {
            "type": "string",
            "format": "decimal",
            "description": "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": {
            "type": "string",
            "format": "decimal",
            "description": "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": {
            "type": "string",
            "format": "decimal",
            "description": "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": {
            "type": "string",
            "description": "An identifier for the credit/debit TPP.\n\nFor Stripe integrations, the client secret for a Stripe `PaymentIntent`.\n",
            "example": "pi_1DpdZq2eZvKYlo2CAYyzTr8j_secret_lxr4crBJP4txbrg7sqit0XQQO"
          },
          "customer_id": {
            "$ref": "#/components/schemas/CustomerIDField"
          },
          "external_order_id": {
            "$ref": "#/components/schemas/ExternalOrderIDField"
          },
          "merchant_destination_account": {
            "type": "string",
            "description": "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.\n\nDefaults to the hash for the default merchant bank account if not provided.\n"
          },
          "pos_terminal": {
            "type": "object",
            "description": "**⚠️  This param is only supported for POS Terminal integrations. Do not use this param for online transactions.**\n\nAn object that details information about the POS Terminal that processes the payment.\n",
            "properties": {
              "provider_terminal_id": {
                "type": "string",
                "description": "A unique string that identifies the POS Terminal."
              }
            }
          },
          "external_location_id": {
            "$ref": "#/components/schemas/ExternalLocationIDField"
          }
        },
        "required": [
          "funding_type"
        ]
      },
      "OrderPaymentRequest": {
        "type": "object",
        "description": "This object represents a one-time payment, charged to a single payment method, associated with a specific Forage Order.",
        "properties": {
          "funding_type": {
            "type": "string",
            "description": "A string that represents the type of tender. One of:\n\n- `benefit`\n- `credit_tpp`\n- `ebt_cash`\n- `ebt_snap`\n",
            "enum": [
              "benefit",
              "credit_payfac",
              "credit_tpp",
              "ebt_cash",
              "ebt_snap",
              "wic"
            ],
            "default": "ebt_snap"
          },
          "amount": {
            "type": "string",
            "format": "decimal",
            "description": "A positive decimal number that represents how much to charge the `PaymentMethod` in USD. Precision is supported to the penny.\n\nThis value must match the `ebt_cash_total` or `snap_total` value that was passed in the request that [created the Custom Capture Session](ref:create-capture-session), depending on the `funding_type`.\n\nIf you need to charge both funding types, then create an `OrderPayment` for each charge, using the same `order_ref` returned when the order's parent [Payment Capture Session was created](ref:create-capture-session).\n\nThe minimum amount that can be charged is `0.01`.\n",
            "example": "25.99"
          },
          "description": {
            "type": "string",
            "description": "A string that describes the `OrderPayment`.",
            "default": "An EBT payment"
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MetadataObject"
              },
              {
                "default": {}
              }
            ]
          },
          "payment_method": {
            "type": "string",
            "description": "The unique reference hash for the existing Forage [`PaymentMethod`](ref:payment-methods) that is to be charged in this transaction.",
            "default": "b16673fe21"
          },
          "customer_id": {
            "$ref": "#/components/schemas/CustomerIDField"
          },
          "external_order_id": {
            "$ref": "#/components/schemas/ExternalOrderIDField"
          },
          "merchant_fixed_settlement": {
            "type": "string",
            "format": "decimal",
            "nullable": true,
            "description": "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.\n",
            "example": "5.11"
          },
          "platform_fixed_settlement": {
            "type": "string",
            "format": "decimal",
            "nullable": true,
            "description": "The fixed amount in USD that should be restored to the platform from EBT Cash payments prior to splitting by the `platform_fee`. Precision is supported to the penny.\n",
            "example": "5.11"
          },
          "external_location_id": {
            "$ref": "#/components/schemas/ExternalLocationIDField"
          }
        },
        "required": [
          "funding_type",
          "amount",
          "description",
          "metadata",
          "payment_method"
        ]
      },
      "OrderPaymentResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderPaymentRequest"
          },
          {
            "type": "object",
            "properties": {
              "ref": {
                "type": "string",
                "description": "A unique reference hash for the Forage `OrderPayment` object.\n\n_Note:_ `receipt.ref_number` equals `ref`.\n",
                "example": "cc3175bfea"
              },
              "status": {
                "type": "string",
                "description": "The status of the `OrderPayment`. One of:\n\n- `authorized`: The `OrderPayment` has been authorized, but not yet captured. Only applicable to HSA/FSA payments, which use an authorize-then-capture flow.\n- `canceled`: The `OrderPayment` object can't be used.\n- `failed`: If the error is temporary, then this `OrderPayment` can be resubmitted for capture without modification. Check the `receipt.message` field for a description of the error.\n- `processing`: The outcome of the `OrderPayment` is pending.\n- `requires_confirmation`: The `OrderPayment` hasn't been submitted for processing.\n- `succeeded`: The `OrderPayment` has been successfully processed and will be included in settlement. It can't be changed.\n",
                "enum": [
                  "authorized",
                  "canceled",
                  "failed",
                  "processing",
                  "requires_confirmation",
                  "succeeded"
                ],
                "example": "requires_confirmation"
              },
              "last_processing_error": {
                "type": "object",
                "nullable": true,
                "description": "The code and message values corresponding to the most recent [Payments API error](ref:errors#payments-api-errors).",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                }
              },
              "created": {
                "type": "string",
                "format": "date-time",
                "description": "A UTC timestamp, represented as an [ISO 8601 date-time](https://www.iso.org/iso-8601-date-and-time-format.html) string, of when the `OrderPayment` was created.",
                "example": "2021-06-16T00:11:50.000000Z"
              },
              "updated": {
                "type": "string",
                "format": "date-time",
                "description": "A UTC timestamp, represented as an [ISO 8601 date-time](https://www.iso.org/iso-8601-date-and-time-format.html) string, of when the `OrderPayment` was last modified.",
                "example": "2021-06-16T00:11:50.000000Z"
              },
              "success_date": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "description": "A UTC timestamp, represented as an [ISO 8601 date-time](https://www.iso.org/iso-8601-date-and-time-format.html) string, of when the `status` of the `OrderPayment` is `succeeded`. This value is always `null` when the `OrderPayment` is first created.",
                "example": "2021-06-16T00:11:50.000000Z"
              },
              "tpp_lookup_id": {
                "type": "string",
                "nullable": true,
                "description": "This value is always null for `OrderPayments` resulting from Custom Sessions. It’s most relevant to Fully Hosted Sessions, which process credit/debit payments.\n\nA value that merchants can use to associate this payment with a credit/debit payment processed by a third party processor.\n\nFor Stripe integrations, this is the client secret for a [`PaymentIntent`](https://stripe.com/docs/api/payment_intents).\n",
                "example": "pi_1DpdZq2eZvKYlo2CAYyzTr8j_secret_lxr4crBJP4txbrg7sqit0XQQO"
              },
              "order": {
                "type": "string",
                "description": "A unique reference hash for the parent `Order`, as passed in the request to create the `OrderPayment`.",
                "example": "340129aff3"
              },
              "merchant": {
                "type": "string",
                "description": "The FNS (Food and Nutrition Service) number of the merchant associated with this `OrderPayment`."
              },
              "amount": {
                "type": "string",
                "format": "decimal",
                "nullable": true,
                "description": "The amount charged to the payment method, in USD. Null until the payment is captured."
              },
              "merchant_fixed_settlement": {
                "type": "string",
                "format": "decimal",
                "nullable": true,
                "description": "The fixed amount in USD restored to the merchant from EBT Cash payments before the `platform_fee` split. Null when not set."
              },
              "platform_fixed_settlement": {
                "type": "string",
                "format": "decimal",
                "nullable": true,
                "description": "The fixed amount in USD the platform takes from EBT Cash payments before the `platform_fee` split. Null when not set."
              },
              "external_location_id": {
                "nullable": true,
                "description": "A unique identifier, provided by the merchant or platform (not Forage), that indicates the physical fulfillment location for the order. Null when not provided."
              }
            },
            "required": [
              "ref",
              "order",
              "merchant",
              "status",
              "created",
              "updated"
            ]
          }
        ]
      },
      "DeliveryAddressData": {
        "type": "object",
        "required": [
          "line1",
          "zipcode"
        ],
        "description": "⚠️ **Exception**: If the purchase is made in-store via a POS Terminal, then a `delivery_address` is not required when creating a `Payment`.\n\nThe 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.\n",
        "properties": {
          "city": {
            "type": "string",
            "description": "The name of the city."
          },
          "country": {
            "type": "string",
            "description": "Either `us` or `US`. Defaults to `US` if not provided."
          },
          "line1": {
            "type": "string",
            "description": "The first line of the street address."
          },
          "line2": {
            "type": "string",
            "nullable": true,
            "description": "The second line of the street address."
          },
          "zipcode": {
            "type": "string",
            "description": "The zip or postal code."
          },
          "state": {
            "type": "string",
            "description": "The two-letter abbreviation, can be upper or lowercase, for the US state."
          }
        }
      },
      "CustomerIDField": {
        "type": "string",
        "maxLength": 64,
        "description": "**⚠️ If you’re integrating Forage with a POS Terminal, then do not use this param. It is only supported for online transactions.**\n\nA unique identifier for the end customer making the payment.\n\nForage automatically adds the `customer_id` to the Session's corresponding `Order` and `OrderPayments`.\n\nThis 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.**\n\nIf you're providing your internal customer ID, then we recommend that you hash the value before sending it on the payload.\n\nEach 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.\n"
      },
      "ExternalOrderIDField": {
        "type": "string",
        "maxLength": 64,
        "description": "A unique identifier for the order as created by the merchant or platform (not Forage).\n\nWhen 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.\n\n**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.\n"
      },
      "ExternalLocationIDField": {
        "type": "string",
        "description": "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.\n",
        "example": "6e3b2ff7-51c8-4c64-befa-2eac90f7c3e9"
      },
      "MetadataObject": {
        "type": "object",
        "description": "A required object containing merchant-defined key-value pairs to provide additional context for the payment.\n\nMerchants 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.\n\nPass an empty object (`{}`) if no additional information is available.\n\n> ⚠️ Personally Identifiable Information\n>\n> **Do not include personally identifiable information (PII)** such as names, emails, or payment details.\n"
      }
    },
    "requestBodies": {
      "Payment": {
        "description": "Object which represents a single charge of a given amount to one payment method",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PaymentRequest"
            }
          }
        }
      }
    },
    "parameters": {
      "AuthenticationBearerTokenHeader": {
        "name": "Authorization",
        "in": "header",
        "description": "An OAuth 2.0 [authentication token](https://docs.joinforage.app/docs/authentication#authentication-tokens) that validates the request. Send a `POST` to the [`/o/token/`](ref:create-authentication-token) endpoint to generate an authentication token. Pass the token in this header after the word `Bearer` and a whitespace, for example `Bearer <api_key>`.",
        "schema": {
          "type": "string"
        },
        "required": true
      },
      "MerchantAccountHeader": {
        "name": "Merchant-Account",
        "in": "header",
        "description": "A unique merchant ID that Forage provides during onboarding, as in `123ab45c67`. The Merchant ID can be found in the Forage [sandbox](https://dashboard.sandbox.joinforage.app/login/) or [production](https://dashboard.joinforage.app/login/) dashboard.",
        "schema": {
          "type": "string"
        },
        "required": true
      },
      "IdempotencyKeyHeader": {
        "name": "Idempotency-Key",
        "in": "header",
        "description": "An alphanumeric key that clients can use to identify repeated requests that are dropped in transit. Generate a distinct key for every unique request and only re-use keys for retries.",
        "schema": {
          "type": "string"
        },
        "required": true
      },
      "APIVersionHeader": {
        "name": "API-Version",
        "in": "header",
        "description": "The [Forage version](ref:version-history), represented as a string with the format of a `YYYY-MM-DD` date.\n\nIf not specified in the request header, then the version defaults to the value set in the Forage dashboard.\n",
        "schema": {
          "type": "string"
        },
        "required": false
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "description": "Pass the access token in the 'Authorization' header with the format \"Bearer ${token}\", i.e. the word \"Bearer\" and your access token from the /o/token/ API, separated by whitespace.\n",
        "flows": {
          "password": {
            "tokenUrl": "/o/token/",
            "scopes": {
              "hosted_checkout": "Scope for tokens used by merchant applications which allow Forage to manage split tender processing (i.e. EBT + Credit/Debit).\n",
              "pinpad_only": "Scope for tokens used by merchant applications which manage their own split tender (i.e. Forage Checkout is used only for EBT processing).\n"
            }
          },
          "clientCredentials": {
            "tokenUrl": "/o/token/",
            "scopes": {
              "internal": "Scope for tokens used by Forage internal applications.\n",
              "pin-protected": "Scope for tokens which can access secure storage.\n",
              "disbursement": "Scope for tokens which can disburse money to merchants.\n"
            }
          }
        }
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Pass the access token in the 'Authorization' header with the format \"Bearer ${token}\", i.e. the word \"Bearer\" and your JWT bearer token from the /api/session_token/ end-point, separated by whitespace.\n"
      }
    }
  }
}
```

# Sibling pages

* [Retrieve all OrderPayments for an Order](https://docs.joinforage.app/reference/get-all-payments.md)
* [Retrieve an OrderPayment](https://docs.joinforage.app/reference/get-an-order-payment.md)
* [Cancel an OrderPayment](https://docs.joinforage.app/reference/cancel-an-order-payment.md)