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] }