Update a Payment Method

This function updates a payment-method after it already exists whether it was created through Stax.js or direct-post.

Update details of an existing payment method. This is useful for updating expiration dates, metadata, or reactivating a soft-deleted payment method.

Key Features

edit
Flexible Updates

Modify metadata or properties of a stored payment method with partial updates.

undo
Reactivation

Reactivate soft-deleted payment methods by setting deleted_at to null.

credit-card
Multi-Format Support

Supports both card and bank account payment methods.


info-circleUsage Notes

Partial Updates: You can update one or multiple fields without affecting others.

Reactivating Payment Methods: To reactivate a payment method, set deleted_at to null.

Validation: Ensure provided values are valid and in the correct format.


Response Structure

CodeResponseReason
200SuccessReturns the updated payment method object with new details.
400Bad RequestInvalid input or unmodifiable fields provided.
401UnauthorizedAuthentication failed.
404Unprocessable EntityPayment method with the specified ID does not exist.

exclamation-triangleImportant Considerations

Data Integrity: Avoid making changes that could invalidate the payment method.

Customer Notification: Consider notifying customers if their payment method details have changed.

Security: Do not include sensitive information (e.g., full card number) in the update.

❗️

You cannot modify:

  • card_number
  • card_cvv
  • bank_account
  • bank_routing
  • nickname (this value is auto generated)
  • customer_id

TO make these changes, you must create a new payment method. For a new customer_id you would need to create a new customer and payment method.

Path Params
string
required
Query Params
boolean

1 or 0 (true or false)

string

Name of the customer.

int32

Last four digits of the payment method to be modified.

string

10 character max. null is acceptable.

string

4 digits of the expiry date.

boolean
string

255 character max. If supplied, MUST have a value, it is not nullable.

string
enum

If supplied, MUST have a value, it is not nullable.

Allowed:
string
enum

If supplied, MUST have a value, it is not nullable.

Allowed:
meta
array of strings

Note this will overwrite all data currently in the meta field.

meta
string

Max 255 characters. Null is accepted. This field may be used for AVS.

string

Max 255 characters. Null is accepted.

string

Max 255 characters. Null is accepted.

string

Two character state.Null is accepted.

string

Max 16 characters. Null is accepted. This field may be used for AVS.

string

Use country 3 character code. Null is accepted.

Responses

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json