HomeGuidesReference↗ Forage Dashboard
Log In
Reference

Update a PaymentMethod

A PATCH request to /payment_methods/{payment_method_ref}/ modifies information about an existing PaymentMethod. You can add a customer_id if it was not set when the PaymentMethod was created, or update whether the card is reusable.

Returns a PaymentMethod object if the operation is successful.

Path Params
string
required

A unique reference hash for the Forage PaymentMethod, returned when the PaymentMethod was created.

Body Params

The information to update about a PaymentMethod.

boolean

Whether the PaymentMethod can be reused. If false, then the PaymentMethod can only be used for a single transaction.

string
length ≤ 64

A unique ID for the end customer associated with the payment method. customer_id can only be set once and can't be changed, so this param only applies if the PaymentMethod doesn't yet include a customer_id. If you try to update the customer_id field after it has already been set, then the API throws an error.

You must build with Forage Version 2023-05-15 or later to use customer_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.

Headers
string
required

An OAuth 2.0 authentication token that validates the request. Send a POST to the /o/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>.

string
required

A unique merchant ID that Forage provides during onboarding, as in 123ab45c67. The Merchant ID can be found in the Forage sandbox or production dashboard.

Pass a Merchant-Account header to create a PaymentMethod associated with a specific merchant account for routing and reporting purposes. This header does not restrict PaymentMethods to a single merchant account. PaymentMethods are tenant-scoped and can be used across all merchant accounts within the same tenant.

Responses

Language
Credentials
OAuth2
URL
LoadingLoading…
Response
Choose an example:
application/json