Replace credit card for subscription
POST/subscriptions/:code/replace-card
Generate a replacement credit card for a subscription's purchase order. Within 28 days of the current card's expiry this is the ordinary follow-up card, sized for the next subscription period, and the request body may be omitted. Earlier than that it is an early replacement (for a compromised or wrongly locked card): a reason is required, and the new card inherits only the replaced card's remaining limit rather than opening a new period. Returns the new card's code and masked details so the client can reveal it once via the Payrails display SDK. Pass replaces_credit_card_code (the card the client currently shows) to make the call safe to retry: if that card has already been replaced, its successor is returned instead of a second card being issued.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 429
- 500
Replacement card generated
Bad request - invalid subscription code or malformed body
Unauthorized - no authenticated user
Forbidden - no access to this subscription
Subscription not found
Conflict - reason required for early replacement, budget exhausted, or no headroom on the replaced card
Too many requests - rate limited by the API firewall; wait out the Retry-After delay before retrying
Response Headers
Delay in seconds a client must wait before retrying the request
Internal server error