Skip to content

Create a payment method update session.

POST
/v1/recurring-payments/{reference}/payment-method-session
curl --request POST \
--url https://api.ridleypay.com/v1/recurring-payments/WOO-SUB-456/payment-method-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "success_url": "https://example.com/billing", "cancel_url": "https://example.com/billing" }'

Returns a hosted checkout_url where the customer replaces the card on file for this schedule. The new card is verified with 3DS and saved; nothing is charged. On success Ridley sends recurring.payment_method_updated. A schedule that is suspended or retrying after declines is reactivated and charged on the next processing run.

reference
required
string

The recurring payment reference.

Example
WOO-SUB-456
Media typeapplication/json
object
success_url

Where to send the customer after the card is saved. ?payment_method=updated is appended.

string
nullable
Example
https://example.com/billing
cancel_url

Where to send the customer if they cancel or verification fails. ?payment_method=failed is appended on failure.

string
nullable
Example
https://example.com/billing

Session created

Media typeapplication/json
object
data
object
id
string
type
string
attributes
object
recurring_reference
string
checkout_url
string
expires_at
string
Example
{
"data": {
"id": "cs_a1b2c3",
"type": "payment-method-sessions",
"attributes": {
"recurring_reference": "WOO-SUB-456",
"checkout_url": "https://checkout.example.com/checkout/cs_a1b2c3",
"expires_at": "2026-03-05T12:00:00.000000Z"
}
}
}

Not updatable

Media typeapplication/json
object
errors
Array<object>
object
status
string
title
string
detail
string
Example
{
"errors": [
{
"status": "422",
"title": "Unprocessable Entity",
"detail": "Cannot update the payment method of a cancelled or completed recurring payment."
}
]
}