swellstores / swell-js

JS library for building storefronts and checkouts with Swell ecommerce.
https://swell.is
MIT License
138 stars 29 forks source link

[API BUG] Nested subscription.subscription or standard.standard in purchaseOptions Product #160

Closed igoraugustynski closed 6 months ago

igoraugustynski commented 6 months ago

Hi, a recent update of the API changed the nesting of the "standard" and "subscription" properties under the "purchaseOption" property of the Product. It is now double nested, i.e.:

    "purchaseOptions": {
        "subscription": {
            "subscription": {
                "plans": [
                    {
                        "name": "Monthly",
                        "description": "Mensile",
                        "price": 140,
                        "billingSchedule": {
                            "interval": "monthly",
                            "intervalCount": 1,
                            "limit": null,
                            "trialDays": 0
                        },
                        "id": "648cd0ddf5ceeb00121a05aa"
                    }
                ]
            }
        }
    },

while it has always been

    "purchaseOptions": {
        "subscription": {
              "plans": [
                  {
                      "name": "Monthly",
                      "description": "Mensile",
                      "price": 140,
                      "billingSchedule": {
                          "interval": "monthly",
                          "intervalCount": 1,
                          "limit": null,
                          "trialDays": 0
                      },
                      "id": "648cd0ddf5ceeb00121a05aa"
                  }
              ]
        }
    },

Is it a bug or is it going to stay this way? It broke our FE completely. This kind of changes shouldn't happen in a stable product.

logeshswell commented 6 months ago

@igoraugustynski We are looking into it.

igoraugustynski commented 6 months ago

I think You guys should do a rollback of the API, my customers are informing me on multiple other issues. I'm going to analyze them now but something definitely went wrong on Your side.

logeshswell commented 6 months ago

I can confirm that it's a bug at our end and I could also replicate the issue in my store.

logeshswell commented 6 months ago

We are very close to deploy a fix for it now.

igoraugustynski commented 6 months ago

That's good news. Please keep me updated so I can check on my side.

logeshswell commented 6 months ago

@igoraugustynski Fix is deployed at our end.

logeshswell commented 6 months ago

Sorry for the inconvenience. Please check and confirm if it's working fine now.

igoraugustynski commented 6 months ago

Looks fine, thanks.