Update the payment method on a subscription
PUT
/api/subscriptions/{id}/payment-method
const url = 'https://api.usegro.co/api/subscriptions/example/payment-method';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"payment_method_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.usegro.co/api/subscriptions/example/payment-method \ --header 'Content-Type: application/json' \ --data '{ "payment_method_id": "example" }'Switches the subscription’s payment method to one of the customer’s existing Shopify payment methods. The new payment method must already exist on the customer in Shopify (use the available list returned by GET /payment-method).
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
payment_method_id
required
ID of the customer’s Shopify payment method to switch to
string
Example generated
{ "payment_method_id": "example"}Responses
Section titled “Responses”Payment method updated
Media typeapplication/json
object
success
required
boolean
Example generated
{ "success": true}Invalid request — missing payment_method_id, no Shopify contract, or update failed
Media typeapplication/json
Example
{ "error": "Payment method ID is required"}