# Need advice on how to implement multi payments with gift card and credit card

**URL:** <https://developer.squareup.com/forums/t/need-advice-on-how-to-implement-multi-payments-with-gift-card-and-credit-card/1651>\
**Category:** Questions\
**Tags:** orders-api, payments-api, checkout-api\
**Created:** [January 21, 2021, 9:38pm UTC](https://developer.squareup.com/forums/t/need-advice-on-how-to-implement-multi-payments-with-gift-card-and-credit-card/1651 "2021-01-21T21:38:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bubblenation](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@bubblenation](https://developer.squareup.com/forums/u/bubblenation)\
**Post date:** [January 21, 2021, 9:38pm UTC](https://developer.squareup.com/forums/t/need-advice-on-how-to-implement-multi-payments-with-gift-card-and-credit-card/1651/1 "2021-01-21T21:38:47Z")

</div>

Hi Team,

Need advice on how to implement multi payments with gift card and credit card.

I want to first charge the gift card with order money, and then charge the credit card if the gift card balance cannot fully cover the order money.

Currently I met an issue that if I try to create gift card payment with an amount of money that greater than gift card balance, API will return insufficient fund error.

I understand the error was throw on purpose, but I cannot find a way to check the gift card balance at first.

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [January 21, 2021, 9:48pm UTC](https://developer.squareup.com/forums/t/need-advice-on-how-to-implement-multi-payments-with-gift-card-and-credit-card/1651/2 "2021-01-21T21:48:07Z")

</div>

You’ll need to utilize the `accept_partial_authorization` parameter in the `CreatePayment` call: [https://developer.squareup.com/reference/square/payments-api/create-payment#request\_\_property-accept\_partial\_authorization](https://developer.squareup.com/reference/square/payments-api/create-payment#request__property-accept_partial_authorization). If you set it to true, then you can charge a Square Gift Card, and it doesn’t need to cover the full amount. For more information take a look at the [Partial amount with Square Gift Cards documentation](https://developer.squareup.com/docs/payments-api/take-payments#partial-payment-gift-card).

---

<div class="post-metadata">

**Author:** ![bubblenation](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@bubblenation](https://developer.squareup.com/forums/u/bubblenation)\
**Post date:** [January 21, 2021, 10:18pm UTC](https://developer.squareup.com/forums/t/need-advice-on-how-to-implement-multi-payments-with-gift-card-and-credit-card/1651/3 "2021-01-21T22:18:29Z")

</div>

Hi @sjosey

Yes, I did add `accept_partial_authorization: true` in request and insufficient error happened, here is my API call

```javascript
import SquareConnect from 'square-connect';

// set square access token...

const paymentApi = new SquareConnect.PaymentsApi();

paymentApi.createPayment({
      source_id: 'cnon:gift-card-nonce-insufficient-funds',
      order_id: 'xxx',
      location_id: 'xxx',
      idempotency_key: 'xxx',
      autocomplete: false,
      delay_duration: 'PT1H',
      accept_partial_authorization: true,
      amount_money: {
          amount: 524,
          currency: 'USD',
      },
})

```

Guess I cannot use the testing gift card nonce mentioned in [this page](https://developer.squareup.com/docs/testing/test-values#generating-error-states) and api will return approved payment in production?

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [January 21, 2021, 10:31pm UTC](https://developer.squareup.com/forums/t/need-advice-on-how-to-implement-multi-payments-with-gift-card-and-credit-card/1651/4 "2021-01-21T22:31:21Z")

</div>

Hm, probably correct. I imagine that test value will automatically make it fail no matter what, since that’s what it was designed to do. I think you’ll need to actually create a gift card to see this in prod.
