# Got error, 'An internal error has occurred, and the API was unable to service your request.',

**URL:** <https://developer.squareup.com/forums/t/got-error-an-internal-error-has-occurred-and-the-api-was-unable-to-service-your-request/9856>\
**Category:** Questions\
**Tags:** subscriptions-api\
**Created:** [June 26, 2023, 7:50am UTC](https://developer.squareup.com/forums/t/got-error-an-internal-error-has-occurred-and-the-api-was-unable-to-service-your-request/9856 "2023-06-26T07:50:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![randhir](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@randhir](https://developer.squareup.com/forums/u/randhir)\
**Post date:** [June 26, 2023, 7:50am UTC](https://developer.squareup.com/forums/t/got-error-an-internal-error-has-occurred-and-the-api-was-unable-to-service-your-request/9856/1 "2023-06-26T07:50:42Z")

</div>

I have check the object, all fields are correct but got this issue again and again. I have check the card-nonce as well.  
The api call is like-

const subscriptionCreate = await subscriptionsApi.createSubscription({  
idempotencyKey: (  
Math.floor(Math.random() \* 9 + 1) + Date.now() + (Math.random() + 1).toString(36).substring(7)  
).toString(),  
locationId: ‘L9XW524DZCRAS’,  
planId: response.result.catalogObject.id,  
customerId: ‘JSFD4BD1RAMNFZYYKQC26ZZE98’,  
cardId: ‘cnon:CBASjhdys3rTyaCm-MMllm2kTsY’  
});

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [June 26, 2023, 4:42pm UTC](https://developer.squareup.com/forums/t/got-error-an-internal-error-has-occurred-and-the-api-was-unable-to-service-your-request/9856/2 "2023-06-26T16:42:39Z")

</div>

What’s your application ID? Also `cnon:CBASjhdys3rTyaCm-MMllm2kTsY` isn’t a valid `card_id`. That’s a `source_id` that’s used to create the card on file with the Cards API. You’ll first need to call [CreateCard](https://developer.squareup.com/reference/square/cards-api/create-card) with the `source_id`. Then use the Square generated `card_id` to create the subscription. 🙂
