Quantcast
Channel: Square Developer Forums - Latest topics
Viewing all articles
Browse latest Browse all 1325

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

$
0
0

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?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1325

Trending Articles