Product Variant Creation using Graphql Api

I am creating a product and its variants in shopify using graphql api. The product is being created successfully but while creating variants for that product i am getting an error.

Internal error. Looks like something went wrong on our end.\nRequest ID: 820e76dd-755c-4253-9964-3532d4e873cb-1717672087 (include this in support requests).

Hi @mian-hasan ,

Thanks for letting us know & sharing the request Id!
It looks like it is failing due to an invalid location id.
We will make sure to improve the error messaging to reflect that.