Using the API Explorer and I can’t delete any subscription plan. I found a prior Question where square says they can’t be deleted… they can only be disabled via UpsertCatalogObject by setting present_at_all_locations to false. So I use the API Explorer to try to UpsertCatalogObject the Subscription Plan Variation and set the present to false, but that doesn’t work either. I fill out the API Explorer form with the minimum required information: Id, type, and present at all locations flag:
{
“errors”: [
{
“category”: “INVALID_REQUEST_ERROR”,
“code”: “INVALID_VALUE”,
“detail”: “Object of type SUBSCRIPTION_PLAN_VARIATION missing subscription_plan_variation_data field: ID="xxxxxxxxxx".”,
“field”: “subscription_plan_variation_data”
}
]
}
So I fill in the subscription plan variation info, and I get this:
{
“errors”: [
{
“category”: “INVALID_REQUEST_ERROR”,
“code”: “ARRAY_EMPTY”,
“detail”: “Repeated field must have at least one value”,
“field”: “object.subscription_plan_variation_data.phases”
}
]
}
So I fill in the phases info, and I get this:
{
“errors”: [
{
“category”: “INVALID_REQUEST_ERROR”,
“code”: “INVALID_VALUE”,
“detail”: “On existing plan xxxxxxxxxx, phases should not be added, removed, or replaced.”,
“field”: “phases”
}
]
}
This is what the final request looked like:
curl https://connect.squareup.com/v2/catalog/object
-X POST
-H ‘Square-Version: 2024-01-18’
-H 'Authorization: Bearer xxxxxxxxxx
-H ‘Content-Type: application/json’
-d ‘{
“idempotency_key”: “xxxxxxxxxx”,
“object”: {
“id”: “xxxxxxxxxx”,
“type”: “SUBSCRIPTION_PLAN_VARIATION”,
“present_at_all_locations”: false,
“subscription_plan_variation_data”: {
“name”: “Monthly Fee”,
“phases”: [
{
“cadence”: “MONTHLY”
}
]
}
}
}’
What am I doing wrong? Or is there no clean up of subscription plans?
8 posts - 2 participants