discountAutomaticAppCreate mutation returns "Shipping functions are not yet supported"

discountAutomaticAppCreate mutation returns "Shipping functions are not yet supported"

santoninko
Shopify Partner
12 0 2

Problem

discountAutomaticAppCreate mutation returns "Shipping functions are not yet supported" error in production app, but works fine on our staging and dev environments.

Details

When running the following mutation
mutation CreateAutomaticDiscountMutation(
  $discount: DiscountAutomaticAppInput!
) {
  discountAutomaticAppCreate(automaticAppDiscount: $discount) {
    automaticAppDiscount {
      discountId
    }
    userErrors {
      code
      extraInfo
      message
      field
    }
  }
}

With the following payload

{
  "discount": {
    "functionId": "XXXXXXXXXXXXXXXX",
    "title": "Xxxxx",
    "startsAt": "2023-08-18T19:51:13.886Z"
  }
}

I get the following response

{
  "data": {
    "discountAutomaticAppCreate": {
      "automaticAppDiscount": null,
      "userErrors": [
        {
          "code": "INVALID",
          "extraInfo": null,
          "message": "Shipping functions are not yet supported",
          "field": [
            "automaticAppDiscount",
            "functionId"
          ]
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 10,
      "actualQueryCost": 10,
      "throttleStatus": {
        "maximumAvailable": 10000,
        "currentlyAvailable": 9990,
        "restoreRate": 500
      }
    }
  }
}
 
Replies 3 (3)

tobebuilds
Shopify Partner
324 19 91

The Shipping Discount Functions API is only available to stores in the checkout extensibility developer preview.

 

I recently reached out to Shopify Partners Support to ask for a timeline on when this API would be come generally available. Here's the response:

 

[NAME REDACTED] (Shopify)

Oct 27, 2023, 19:11 EDT

Hi Tobe, 
 
 [NAME REDACTED] here from Shopify Partner Support. Thank you for your email and question about our Functions Shipping Discount API.
 
You are correct here that our Functions Shipping Discount API is currently in beta and only available in the checkout extensibility developer preview. While we work to providing access to this API to a larger audience, it is expected behaviour for requests to this API on a non  checkout extensibility developer preview store to result in an error. 
 
Here while I do not have an exact timeline on when this API will be available to a larger audience, here I can recommend following our Partner news sources for updates on its availability:
 
 
 
 
Should you have any other questions about what we have discussed, please feel free to respond directly to this email or reach out to our live support channels through the support link in your partner dashboard.
 
Kind regards.
 
[NAME REDACTED] | Shopify Partner Support
Shopify News: What’s New for Shopify Partners and Developers

 

Mooh07
Shopify Partner
2 0 3

Having same error even though I believe it's in stable version and available now?

 

Not sure what the problem is.

sebizox
Shopify Partner
6 0 3

Same. From the docs this looks like it should be stable now.