---
title: "POST /update_payment_method"
method: POST
path: "/update_payment_method"
tags: ["Payment Methods"]
---

# POST /update_payment_method

`POST /update_payment_method`

## Request

- Base URL: `https://api.paynearme-sandbox.com/json-api`
- URL: `https://api.paynearme-sandbox.com/json-api/update_payment_method`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `https://login.paynearme.com/oauth/token`
  - API key in query parameter `signature`

Use the <code>/update_payment_method</code> endpoint to retire or deactivate a payment method.<h2>Retiring a Payment Method</h2> When a payment method is "retired" <ul><li>The <code>payment_method_identifier</code> will not be returned in the <code>/find_order</code> or <code>/find_payment_methods</code> responses</li><li>The payment method will not display in the PayNearMe Business Portal, Agent Interface, or on the Select Payment Method screen of the Consumer Portal</li><li>The retired <code>payment_method_identifier</code> can be used in the <code>/make_payment</code> call to complete a payment.</li></ul> Use <code>retire_payment_method=true</code> to retire the payment method in either the <code>/create_payment_method</code> or <code>/update_payment_method</code> calls. To "unretire" a payment method so that it will display again in the places listed above, use <code>retire_payment_method=false</code>. <h2>Deactivating a Payment Method</h2>When a payment method is "deactivated" <ul><li>The <code>payment_method_identifier</code> will not be returned in the <code>/find_order</code> or <code>/find_payment_methods</code> responses.</li><li>The payment method will not display on the Select Payment Method screen of the Consumer Portal.</li><li>The payment method will display as <b>Inactive</b> in the PayNearMe Business Portal and Agent Interface.</li><li>The deactivated <code>payment_method_identifier</code> will automatically decline payments for all transaction attempts.</li><li>The deactivated payment method cannot be reactivated by submitting <code>deactivate_payment_method=false</code>. It can only be reactivated by re-adding it via the <code>/create_payment_method</code> endpoint.</li></ul> To deactivate a payment method, use <code>deactivate_payment_method=true</code>.

## Request body

- UpdatePaymentMethod: Use the <code>retire_payment_method</code> or <code>deactivate_payment_method</code> parameters to retire or deactivate a payment method from an order.
  - `site_identifier` string, required: Identifies your client site.
  - `timestamp` string, required: The Unix Epoch time of the call
  - `version` string, required: The version of the API. This version must match the version associated with your API key pair.
  - `signature` string: The HMAC signature that is calculated by running your API Secret Key and the alphabetized, concatenated parameters of the request payload through the SHA256 message digest algorithm. **NOTE:** This field is required when authenticating with the HMAC signature method; it is not required when authenticating with OAuth 2.0.
  - `payment_method_identifier` string: A unique, string ID that identifies a specific payment method.
  - `retire_payment_method` string: Pass <code>true</code> to indicate if you want to retire a payment method. Retired payment methods are not returned in the <code>payment_methods</code> block of the order object, but can be used for payments.
  - `deactivate_payment_method` string: Pass <code>true</code> to indicate if you want to deactivate the payment method. Deactivated payment methods are not returned in the <code>payment_methods</code> block of the order object and cannot be used for payments.

## Response `200`

Payment Method Updated

- Accounts: The Accounts object lists the customer's payment account(s) that were created for this order.
  - `payment_method_identifier` string: The unique identifier (i.e., token) for the payment method account.
  - `status` 'active' | 'inactive': The status of the payment method.
  - `name` string: The name of the account holder for the payment method.
  - `description` string: A short description of the payment method.
  - `account_type` 'Business Checking' | 'Business Savings' | 'Credit' | 'Debit' | 'Personal Checking' | 'Personal Savings' | 'PrePaid': The type of payment method account.
  - `pull-enabled` string: If set to <code>true</code>, this payment method can be used for payments.
  - `push_enabled` string: If set to <code>true</code>, this payment method can be used for disbursements.
  - `number` string: The last four digits of the account number for credit, debit, and ACH payment methods.
  - `fee_amount` number: The convenience fee amount for this payment method.
  - `fee_currency` string: USD
  - `expiration_date` string: The expiration month and year in <i>MM/YYYY</i> format for credit and debit card payment methods.
  - `card_brand` string: The brand of the card for credit and debit card payment methods.
  - `pay_pal_account_id` string: The PayPal Account ID of the client.
  - `pay_pal_account_email` string: The email used with this PayPal account.

## Other responses

- `401`: OAuth 2.0 requests only. The `Authorization` header has no Bearer token, the access token is invalid, expired, or issued for a different site, or the `site_identifier` does not match any site. The response does not say which. If the request is rejected before it reaches PayNearMe, the body may not be JSON, so detect this error by the HTTP status. HMAC-signed requests never receive this status.

## Changes

- **2026-11-03** `907541f733a3`: 1 breaking, 4 info
  - removed the success response with the status `201`
  - api operation id `update_payment_method` was added
  - the request property `signature` became optional
  - added the non-success response with the status `401`
  - …1 more

[Operation history](https://skmtc.dev/paynearme/apis/paynearme-api-v3-0/changes/update_payment_method/post.md)

---

[API](https://skmtc.dev/paynearme/apis/paynearme-api-v3-0.md) - [All operations](https://skmtc.dev/paynearme/apis/paynearme-api-v3-0/llms.txt) - [OpenAPI document](https://skmtc.dev/paynearme/apis/paynearme-api-v3-0/revisions/907541f733a3?raw)
