Update Subscription

This API endpoint allows updating a subscription by its unique ID. You must provide the subscription ID in the path parameter and a valid price ID in the request body.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will update the subscription and return a success message.
  • If the request is invalid or the subscription cannot be updated, the system will return an error message detailing the issue.
Path Parameters
  • id string
    The unique ID of the subscription to update.
Request Body Parameters
  • price_id string
    The ID of the new price to update the subscription with.
curl -X PATCH "https://api.pinghome.io/payment-cmd/v1/subscription/{id}" \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
--data '{
  "price_id": "price_1MU7isEyoIQbyvYhiIpiQlw2"
}'
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).