Internal Server Error in subscription api

I’m getting 500 error but seems like my all configs are correct
could you give me solution asap ?

 const response = await squareBackendClient.catalogApi.listCatalog(
      undefined,
      "SUBSCRIPTION_PLAN",
    );

    const data =
      response.result.objects[0].subscriptionPlanData
        ?.subscriptionPlanVariations[0].subscriptionPlanVariationData;

    const planVariationId =
      response.result.objects[0].subscriptionPlanData
        ?.subscriptionPlanVariations[0].id;

    console.log(data);

    const {
      result: { errors },
    } = await squareBackendClient.subscriptionsApi.createSubscription({
      idempotencyKey: uuid(),
      locationId: env.NEXT_PUBLIC_SQUARE_LOCATION_ID,
      planVariationId: planVariationId,
      customerId: user.squareCustomerId,
      cardId: cardInfo?.id,
      phases: [
        {
          ordinal: 0n,
          orderTemplateId: "HEE4MRRVXPGFHC3ZXKL57HHH",
        },
      ],
    });

this is data of console

{
[backend]   name: 'Yolohealth Exclusive Monthly',
[backend]   phases: [
[backend]     {
[backend]       uid: 'HEE4MRRVXPGFHC3ZXKL57HHH',
[backend]       cadence: 'MONTHLY',
[backend]       ordinal: 0n,
[backend]       pricing: [Object]
[backend]     }
[backend]   ],
[backend]   subscriptionPlanId: '7FOAAUXOB5MSMNJATETA524X',        
[backend]   monthlyBillingAnchorDate: 1n,
[backend]   canProrate: false
[backend] }

What’s your application ID? :slightly_smiling_face:

Here is application id
sandbox-sq0idb-tj-yLTMtcNTlVm85Pucnrw

I’m seeing this error in the logs:

{
  "errors": [
    {
      "code": "CONFLICTING_PARAMETERS",
      "detail": "Phases with RELATIVE pricing type must have order templates on the phase",
      "category": "INVALID_REQUEST_ERROR"
    }
  ]
}

Do you have setup as per our guide? :slightly_smiling_face:

Yeah

this is my setup but can you see the issue ?

I’m sure cardId, customerId and location id are correct.
seems like there is problem on planVariationId, phases