Account billing updater
Refresh saved Visa and Mastercard details automatically on decline or on request before charging or paying out.
The account billing updater queries the card network's account updater service
to check whether a saved Visa or Mastercard card has updated details, such as a
new expiration date or replacement card number. When new details are available,
Pay.com updates the saved pm_card_ payment method in place and sends the
payment_method.updated webhook event.
An update preserves the payment method ID, so you continue charging or paying
out to the same pm_card_ identifier. Pay.com updates the card's expiration
date and, when the card number changes, its last four digits, BIN, and
fingerprint.
If you use network tokens, tokens stay current automatically when an issuer replaces a card without requiring an account updater lookup.
| Trigger | How it runs |
|---|---|
| Automatic on decline | Configure payment_method_options.card.account_billing_updater to check the card after an eligible decline and optionally retry the payment. |
| On request | Call POST /v1/payment_methods/account_billing_updater to check one card synchronously before charging or paying out. |
Automatic updates on decline
Set payment_method_options.card.account_billing_updater on a charge or hold,
or as an account default,
to query the card network automatically when an issuer declines a Visa or
Mastercard payment for a reason updated card details can resolve.
| Field | Type | Description |
|---|---|---|
enabled | boolean | Queries the card network's account updater after an eligible decline. |
retry_after_update | boolean | Retries the payment once when the update returns new details that can resolve the decline. |
billing_updater_decline_codes | array of strings | Additional decline codes that start an update, added to the default codes. |
{
"card": {
"account_billing_updater": {
"enabled": true,
"retry_after_update": true,
"billing_updater_decline_codes": ["do_not_honour"]
}
}
}Eligible declines and retry behavior
Pay.com checks the card with the account updater when either condition is met:
- The decline code is
expired_card,invalid_expiry_month,invalid_expiry_year, or one of yourbilling_updater_decline_codes. - The card network returns advice code
01(new account details available from Visa or Mastercard), regardless of the decline code.
When a decline triggers an account updater lookup, Pay.com doesn't route the payment to a fallback processor.
With retry_after_update: true, Pay.com waits for the network response and
retries the payment once when the new details can fix the decline:
- New card number: Pay.com retries after any eligible decline.
- New expiration date only: Pay.com retries only after
expired_card,invalid_expiry_month, orinvalid_expiry_year. Other declines apply to the same card number and would decline again.
The retry runs on the same charge or hold. Its final status reflects the retry
outcome, and the original declined attempt appears in retry_attempts.
When retry_after_update is false or omitted, Pay.com runs the update in the
background while the payment remains declined. If new details are returned,
Pay.com updates the payment method and sends payment_method.updated so you
can charge the card again.
On-request updates
Call POST /v1/payment_methods/account_billing_updater
to check a card with the card network's account updater before charging or
paying out. Pay.com waits for the answer, updates the payment method if the
card has new details, and returns it.
Requirements
Before you start, make sure you have:
- Your API credentials and environment base URL (sandbox:
https://api.sandbox.pay.com/v1, with ansk-pay-com-sandbox-key). - A unique
idempotency-keyheader for eachPOSTrequest. - An API key enabled for raw card data, if you send card details (
type: "card") instead of a saved payment method or a card token.
Choose the card
Set type to specify how you identify the card:
type | Request fields | Result |
|---|---|---|
source | source: a saved payment method ID (pm_card_…) or card token (tok_card_…) | Updates that payment method in place. |
token | token.id: a card token or imported card reference | Saves the card as a payment method for the customer, then updates it. |
card | card: raw card details | Saves the card as a payment method for the customer, then updates it. |
With token or card, send customer_reference_id to save the payment method
for that customer. A payment method saved this way works for both payments and
payouts. Optionally pass settlement_account to run the lookup through a
specific settlement account instead of your default for the currency.
Update the card
This request checks a saved payment method.
{
"type": "source",
"source": "pm_card_296645958265997316"
}{
"id": "pm_card_296645958265997316",
"resource": "payment_method",
"type": "card",
"customer_reference_id": "cust_ext_abc123",
"card": {
"brand": "visa",
"last4": "4242",
"exp_month": "09",
"exp_year": "2031"
}
}The endpoint returns HTTP 200 with the payment method object. When the card
network has new details, the returned card includes them and Pay.com sends
payment_method.updated. When no new details are available, or when the card
isn't Visa or Mastercard, the payment method remains unchanged.
Errors
In addition to field validation errors, the endpoint returns 400 in these
cases:
| Message | Cause |
|---|---|
Invalid source provided | source belongs to another account. |
Invalid card provided | Pay.com can't find the referenced card token. |
Refresh a card before a payout
Card payouts accept payout_method_options.card.account_billing_updater with
the same schema as payments, but a declined payout doesn't start an automatic
update. To send a payout to a card's current details, call the on-request
endpoint first and then create the payout using the same pm_card_ ID.
- 1
Refresh the saved card
Call
POST /v1/payment_methods/account_billing_updaterwith the card'spm_card_ID insource.{ "type": "source", "source": "pm_card_296645958265997316" } - 2
Create the payout
Send the payout to the same payment method with
POST /v1/payouts. Amounts are in minor units, so5000is $50.00 USD.{ "amount": 5000, "currency": "usd", "destination": "pm_card_296645958265997316" }
Webhooks
Pay.com sends the payment_method.updated event whenever an automatic or
on-request update modifies a saved card. Read the updated card details from the
event payload, or retrieve the payment method with
GET /v1/payment_methods/{id}.
See Webhooks to set up an endpoint and verify
signatures.
Next steps
- Network tokens: Keep saved cards working automatically across replacements with VTS, MDES, and AETS.
- Merchant defaults: Turn on automatic updates on decline for every payment.
- Declines: Review decline codes you can add to
billing_updater_decline_codes. - Create a payout: Send payouts to saved cards and bank accounts.