# INTERNAL\_SERVER\_ERROR when saving giftcard

**URL:** <https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561>\
**Category:** Questions\
**Tags:** customers-api\
**Created:** [December 13, 2021, 10:52pm UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561 "2021-12-13T22:52:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [December 13, 2021, 10:52pm UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/1 "2021-12-13T22:52:57Z")

</div>

Getting this response when trying to save a giftcard using `create\_customer\_card:  
Same response whether getting the nonce from the old square card form or the new web payments sdk.

```auto
<ApiResponse [{"errors":[{"category":"API_ERROR","code":"INTERNAL_SERVER_ERROR","detail":"An internal error has occurred, and the API was unable to service your request."}]}]>

```

I know that `create_customer_card` is deprecated, we’re in the process of updating to the new giftcard forms, but waiting for all of our clients to accept the new oauth permissions. It was working as expected last week, and nothing has changed on our end since then.

We’re using Square api version 9-15-2021 and have been for at least 2 months, and this just started happening now. App ID is `sq0idp-_s2HeXXDp5cKsxwQoYc4hg` (staging) or `sq0idp-_OpWFbMJ0nQp7vhmCjzoKw` (production) and merchant ID `3Q0RFH0QMQBTM`

Same result with multiple users.

---

<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:** [December 13, 2021, 11:41pm UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/2 "2021-12-13T23:41:35Z")

</div>

👋 Looks like there are more than one contact that’s associated to the gift card. Was this card number used to create multiple nonces and saved with multiple `customer_ids`?

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [December 14, 2021, 12:10am UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/3 "2021-12-14T00:10:37Z")

</div>

Yes, it’s one we use for testing. We’ve been doing that for some time and it’s never been a problem before.

---

<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:** [December 14, 2021, 12:55am UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/4 "2021-12-14T00:55:53Z")

</div>

The team is working on making the error more clear rather then being a `500` but there is a limit to the amount of customer that can be associated to a gift card with `CreateCustomerCard`. 🙂

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [December 14, 2021, 2:13am UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/5 "2021-12-14T02:13:01Z")

</div>

Thank you. Is the limit new? Or else it must be fairly high since we’ve had 5-10 ‘users’ using it for about a year. Does it count if it’s added to the same user multiple times?

---

<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:** [December 14, 2021, 5:07pm UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/6 "2021-12-14T17:07:51Z")

</div>

The limit isn’t new but it looks like you now have reached the max. I believe the same applies if the card is attached to the same customer. Is there a reason that you are attaching a single card to multiple customer profiles?

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [December 14, 2021, 5:26pm UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/7 "2021-12-14T17:26:11Z")

</div>

Gotcha. When testing with creating users/adding card functionality our devs and QA will often make new users, but we have a limited amount of credit cards to test with. For giftcards, we have to buy them, so we have a handful that we reuse, to avoid having to buy a new one each time we need to test something. We don’t generally use the sandbox as it has limited functionality compared to using an actual Square account that we use for testing and demos.

---

<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:** [December 14, 2021, 5:32pm UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/8 "2021-12-14T17:32:15Z")

</div>

Okay, that makes sense. What I do when I need to test a gift card is I’ll tender it with cash or other so it won’t register an actual card transaction. 🙂

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [December 14, 2021, 6:01pm UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/9 "2021-12-14T18:01:48Z")

</div>

Can this be done with the e-giftcards? I see where to take a payment on the dashboard, but the only option I can find for purchasing an e-giftcard is with the link, and that requires payment at the time of purchase. We don’t have physical giftcards, being as we’re developing the app for clients and aren’t a restaurant ourselves.

---

<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:** [December 14, 2021, 11:21pm UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/10 "2021-12-14T23:21:37Z")

</div>

It can’t be done with the eGift card site but you can tender an eGift card sale in the Square app if your logged into that account or with the [Gift Cards API](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api). Also with the Gift Cards API you can create a card and put a balance on it without taking a payment. 🙂

---

<div class="post-metadata">

**Author:** ![shannonf](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shannonf](https://developer.squareup.com/forums/u/shannonf)\
**Post date:** [December 14, 2021, 11:36pm UTC](https://developer.squareup.com/forums/t/internal-server-error-when-saving-giftcard/4561/11 "2021-12-14T23:36:05Z")

</div>

I’ll try that with the API, thanks! Hadn’t thought of that, it’s still fairly new to us.
