How do you create a subscription plan with 'STATIC' pricing with the Catalog API

Hi there

I am trying to create a subscription plan with static pricing according to the documentation here, following the documentation, I am still unable to create a subscription with static pricing. All the examples have some phase that includes a relative price item, none are solely static.

Here is my request to the UpsertCatalogObject endpoint.

curl https://connect.squareup.com/v2/catalog/object \
  -X POST \
  -H 'Square-Version: 2024-09-19' \
  -H 'Authorization: Bearer MY_TOKEN_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "59f628e3-e030-4221-8b3f-1f51a1ace4e1",
    "object": {
      "id": "#AYCB",
      "type": "SUBSCRIPTION_PLAN",
      "subscription_plan_data": {
        "name": "AYCB Weekday Pass!",
        "phases": [
          {
            "cadence": "MONTHLY",
            "ordinal": 0,
            "pricing": {
              "price_money": {
                "amount": 3800,
                "currency": "USD"
              },
              "type": "STATIC"
            }
          }
        ]
      }
    }
  }'

When I go to retrieve the object, I get this response

{
  "object": {
    "type": "SUBSCRIPTION_PLAN",
    "id": "UHTQ3IMXLOQEOT5WHITHH4PX",
    "updated_at": "2024-10-11T19:28:48.054Z",
    "created_at": "2024-10-11T19:28:48.089Z",
    "version": 1728674928054,
    "is_deleted": false,
    "present_at_all_locations": true,
    "subscription_plan_data": {
      "name": "AYCB Weekday Pass!"
    }
  }
}

There’s no pricing information saved when retrieving it. What exactly am I doing wrong?

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Build a Simple Catalog
Square Developer
Catalog API

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

The issue you’re encountering is due to the incorrect placement of the “pricing” object in your request. The “pricing” object should be nested within the “subscription_plan_data” object, not the “phases” array.

Here’s how your request should look:

{
  "idempotency_key": "59f628e3-e030-4221-8b3f-1f51a1ace4e1",
  "object": {
    "id": "#AYCB",
    "type": "SUBSCRIPTION_PLAN",
    "subscription_plan_data": {
      "name": "AYCB Weekday Pass!",
      "phases": [
        {
          "cadence": "MONTHLY",
          "ordinal": 0
        }
      ],
      "pricing": {
        "price_money": {
          "amount": 3800,
          "currency": "USD"
        },
        "type": "STATIC"
      }
    }
  }
}

In this corrected request, the “pricing” object is directly under “subscription_plan_data”, and the “phases” array only contains the “cadence” and “ordinal” properties. This should correctly create your subscription plan with static pricing.

This answer was reviewed by @Bryan-Square.