Gift Card Partial Authorization not working with Mobile Payments SDK

Hello Square Support Team,

I’m currently using the Square Mobile Payments SDK v2.3.0 to process payments on iOS .

My goal is to accept partial authorization for Square Gift Cards, so that if a customer’s gift card balance is less than the total amount, the payment can still capture the available balance (e.g., $5 out of $10 requested), and then allow the user to continue paying the remaining amount with another method.

However, in my tests:

  • I have set acceptPartialAuthorization = true and autocomplete = false (as required by the documentation).

  • The merchant account is enabled for Gift Cards and is in production mode.

  • The payment attempt is made with a real Square Gift Card that has insufficient funds.

  • My code is :
    let paymentParams = PaymentParameters(

            paymentAttemptID: paymentAttemptID,
    
            amountMoney: SquareMobilePaymentsSDK.Money(
    
                amount: UInt(amount),
    
                currency: .USD
    
            ),
    
            processingMode: .autoDetect
    
        )
    
        if let tipAmount = tipAmount, tipAmount > 0 {
    
            paymentParams.tipMoney = SquareMobilePaymentsSDK.Money(
    
                amount: UInt(tipAmount),
    
                currency: .USD
    
            )
    
        }
    
        paymentParams.acceptPartialAuthorization = true
    
        paymentParams.autocomplete = false
    
        paymentParams.delayDuration = 60
    
        paymentParams.delayAction = .complete
    
        
    
        let promptParams = PromptParameters(
    
            mode: .default,
    
            additionalMethods: .all
    
        )
    
        
    
        // 获取当前最顶层的 view controller
    
        guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
    
              let window = windowScene.windows.first,
    
              let rootViewController = window.rootViewController else {
    
            lastMessage = "❌ Unable to get root view controller for payment"
    
            isProcessingPayment = false
    
            return
    
        }
    
        
    
        let presentingController = findTopViewController(from: rootViewController)
    
        
    
        MobilePaymentsSDK.shared.paymentManager.startPayment(
    
            paymentParams,
    
            promptParameters: promptParams,
    
            from: presentingController,
    
            delegate: self
    
        )
    
  • The request correctly includes these parameters in the API payload:

  • paymentParams.acceptPartialAuthorization = true is missing in the payload

    content-length: 1494
    accept-language: en-us
    square-version: 2022-12-14
    content-type: application/json
    accept-encoding: gzip
    accept: application/json
    user-agent: Mozilla/5.0 (iPhone16,2; CPU iPhone OS 26.1 like Mac OS X; en-us) Version/2.3.0 com.squareup.readersdk/6761001 PointOfSaleSDK/6.76.1

    {
    

    “revenue_association_tags”: “[redacted]”,
    “amount_money”: {
    “amount”: 4315,
    “currency”: “USD”
    },
    “idempotency_key”: “501D5932-07F3-442D-A0F3-”,
    “device_details”: “[redacted]”,
    “delay_duration”: “PT0H1M”,
    “geo_location”: “[redacted]”,
    “peripheral_metadata”: “[redacted]”,
    “delay_action”: “COMPLETE”,
    “card_present_options”: “[redacted]”,
    “source_id”: “[redacted]”,
    “autocomplete”: false,
    “location_id”: “LGNF7V8G9NBNN”
    }

Return
date: Sun, 05 Oct 2025 05:03:52 GMT
content-length: 1855
square-version: 2022-12-14
x-frame-options: DENY
connection: keep-alive
content-type: application/json
strict-transport-security: max-age=31536000

{

“errors”: [
{
“code”: “INSUFFICIENT_FUNDS”,
“detail”: “Authorization error: ‘INSUFFICIENT_FUNDS’”,
“category”: “PAYMENT_METHOD_ERROR”
},
{
“code”: “GIFT_CARD_AVAILABLE_AMOUNT”,
“detail”: “246”,
“category”: “PAYMENT_METHOD_ERROR”
}
],
“payment”: {
“id”: “nbg2OfQtQLAuBTaoOH9tUwycYt9YY”,
“created_at”: “2025-10-05T05:03:51.898Z”,
“updated_at”: “2025-10-05T05:03:51.960Z”,
“amount_money”: {
“amount”: 4315,
“currency”: “USD”
},
“status”: “FAILED”,
“delay_duration”: “PT0H1M”,
“source_type”: “CARD”,
“card_details”: {
“status”: “FAILED”,
“card”: {
“card_brand”: “SQUARE_GIFT_CARD”,
“last_4”: “8304”,
“exp_month”: 12,
“exp_year”: 2099,
“cardholder_name”: “SQUARE GIFT CARD”,
“fingerprint”: “sq-1-NCGw32sN9FWsPTcgoL3Xhs_vsK9eWEHx71ACV_IKVRf7-ocHhm-”,
“card_type”: “DEBIT”,
“prepaid_type”: “PREPAID”,
“bin”: “778273”
},
“entry_method”: “SWIPED”,
“auth_result_code”: “5”,
“errors”: [
{
“code”: “INSUFFICIENT_FUNDS”,
“detail”: “Authorization error: ‘INSUFFICIENT_FUNDS’”,
“category”: “PAYMENT_METHOD_ERROR”
}
],
“device_details”: {
“device_id”: “DEVICE_VENDOR_ID:–4E4C-A273-F8EDC83E132C”,
“device_name”: “iPhone”,
“device_installation_id”: “DEVICE_VENDOR_ID:-9338-4E4C-A273-F8EDC83E132C”
},
“card_payment_timeline”: {
“authorized_at”: “2025-10-05T05:03:51.960Z”
}
},
“location_id”: “”,
“order_id”: “”,
“total_money”: {
“amount”: 4315,
“currency”: “USD”
},
“approved_money”: {
“amount”: 0,
“currency”: “USD”
},
“delay_action”: “COMPLETE”,
“delayed_until”: “2025-10-05T05:04:51.898Z”,
“device_details”: {
“device_id”: “DEVICE_VENDOR_ID:91319BD7-9338–A273-”,
“device_name”: “iPhone”,
“device_installation_id”: “DEVICE_VENDOR_ID:-9338-4E4C-A273-F8EDC83E132C”
},
“application_details”: {
“square_product”: “SQUARE_POS”,
“application_id”: “-”
},
“version_token”: “”
}
}

:waving_hand: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Build on iOS
Gift Card Payments
Tap to Pay on iPhone

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

If you remove delayAction does it work correctly? :slight_smile:

HI Bryan ,

i have just tried that , if i remove delayAction, and the result is still the same , INSUFFICIENT_FUNDS notice is showing .

{
“card_present_options”: “[redacted]”,
“device_details”: “[redacted]”,
“revenue_association_tags”: “[redacted]”,
“source_id”: “[redacted]”,
“peripheral_metadata”: “[redacted]”,
“autocomplete”: false,
“amount_money”: {
“currency”: “USD”,
“amount”: 246
},
“geo_location”: “[redacted]”,
“idempotency_key”: “63B783E5-B357-4EB2-9B0C-6F0BD9698105”,
“delay_action”: “CANCEL”,
“location_id”: “LM4PJ9VA1W6TF”,
“delay_duration”: “PT0H1M”
}

date: Mon, 06 Oct 2025 21:35:13 GMT
content-length: 1749
square-version: 2022-12-14
x-frame-options: DENY
connection: keep-alive
content-type: application/json
strict-transport-security: max-age=31536000

{

“errors”: [
{
“code”: “INVALID_ACCOUNT”,
“detail”: “Authorization error: ‘INVALID_ACCOUNT’”,
“category”: “PAYMENT_METHOD_ERROR”
}
],
“payment”: {
“id”: “Ln3XuGrlmcgmXhlTrKmhwEKapR9YY”,
“created_at”: “2025-10-06T21:35:13.469Z”,
“updated_at”: “2025-10-06T21:35:13.524Z”,
“amount_money”: {
“amount”: 246,
“currency”: “USD”
},
“status”: “FAILED”,
“delay_duration”: “PT0H1M”,
“source_type”: “CARD”,
“card_details”: {
“status”: “FAILED”,
“card”: {
“card_brand”: “SQUARE_GIFT_CARD”,
“last_4”: “5662”,
“exp_month”: 12,
“exp_year”: 2099,
“cardholder_name”: “SQUARE GIFT CARD”,
“fingerprint”: “sq-1-Q_NYfZqZY2OMzw_9bjdPmVBlpJOHJ28JW22JPj2U8unxvW6GfmW5UOn7g0OYGkjIMg”,
“card_type”: “DEBIT”,
“prepaid_type”: “PREPAID”,
“bin”: “778273”
},
“entry_method”: “SWIPED”,
“auth_result_code”: “2”,
“errors”: [
{
“code”: “INVALID_ACCOUNT”,
“detail”: “Authorization error: ‘INVALID_ACCOUNT’”,
“category”: “PAYMENT_METHOD_ERROR”
}
],
“device_details”: {
“device_id”: “DEVICE_VENDOR_ID:91319BD7-9338-4E4C-A273-F8EDC83E132C”,
“device_name”: “iPhone”,
“device_installation_id”: “DEVICE_VENDOR_ID:91319BD7-9338-4E4C-A273-F8EDC83E132C”
},
“card_payment_timeline”: {
“authorized_at”: “2025-10-06T21:35:13.524Z”
}
},
“location_id”: “”,
“order_id”: “YvvPJoTYRw2b3KdAsqpGkWw4CBJZY”,
“total_money”: {
“amount”: 246,
“currency”: “USD”
},
“approved_money”: {
“amount”: 0,
“currency”: “USD”
},
“delay_action”: “CANCEL”,
“delayed_until”: “2025-10-06T21:36:13.469Z”,
“device_details”: {
“device_id”: “DEVICE_VENDOR_ID:-9338-4E4C-A273-F8EDC83E132C”,
“device_name”: “iPhone”,
“device_installation_id”: “DEVICE_VENDOR_ID:-9338-4E4C-A273-F8EDC83E132C”
},
“application_details”: {
“square_product”: “SQUARE_POS”,
“application_id”: “sq0idp–EKbDQ”
},
“version_token”: “du5il7XdHDEDdEWvPsla6N4ckR7NNpeyYLQCjgjSrlV6o”
}
}

Hi Bryan,

have you got any idea that cause this issue? any solution for it ? Thanks :grimacing:

The team is looking into this. :slight_smile:

HI BRYAN ,
i want to reach out to see if there is any update from your team , THANKS

According to the team the issue has to do with the tip. It’s only possible to add a tip to a gift card payment if the gift card balance is sufficient to pay the order amount and tip amount combined. Otherwise, Square returns an INSUFFICIENT_FUNDS error. :slight_smile:

Hi Bryan,  i did try with no-tip call, but it turn out the same errors response.


{
  "autocomplete": false,
  "delay_duration": "PT0H1M",
  "card_present_options": "[redacted]",
  "source_id": "[redacted]",
  "idempotency_key": "F72E8576-F0F0-4F11-8115-D88C0FE9BF23",
  "revenue_association_tags": "[redacted]",
  "location_id": "*******",
  "amount_money": {
    "amount": 4425,
    "currency": "USD"
  },
  "delay_action": "CANCEL",
  "device_details": "[redacted]",
  "peripheral_metadata": "[redacted]",
  "geo_location": "[redacted]"
}



RESPONSE : 
{
  "errors": [
    {
      "code": "INSUFFICIENT_FUNDS",
      "detail": "Authorization error: 'INSUFFICIENT_FUNDS'",
      "category": "PAYMENT_METHOD_ERROR"
    },
    {
      "code": "GIFT_CARD_AVAILABLE_AMOUNT",
      "detail": "427",
      "category": "PAYMENT_METHOD_ERROR"
    }
  ],
  "payment": {
    "id": "JCPgiNdpMWQ4JEb6cywAz19CGpLZY",
    "created_at": "2025-10-16T20:13:56.938Z",
    "updated_at": "2025-10-16T20:13:57.006Z",
    "amount_money": {
      "amount": 4425,
      "currency": "USD"
    },
    "status": "FAILED",
    "delay_duration": "PT0H1M",
    "source_type": "CARD",
    "card_details": {
      "status": "FAILED",
      "card": {
        "card_brand": "SQUARE_GIFT_CARD",
        "last_4": "6357",
        "exp_month": 12,
        "exp_year": 2099,
        "cardholder_name": "SQUARE GIFT CARD",
        "fingerprint": "sq-1-5PuEkW0dD1aPK42Vz2HOm763X2MB9HhHP_IoLjkbRuF-IrZNL9kymdT8UADI4xljOw",
        "card_type": "DEBIT",
        "prepaid_type": "PREPAID",
        "bin": "778273"
      },
      "entry_method": "SWIPED",
      "auth_result_code": "5",
      "errors": [
        {
          "code": "INSUFFICIENT_FUNDS",
          "detail": "Authorization error: 'INSUFFICIENT_FUNDS'",
          "category": "PAYMENT_METHOD_ERROR"
        }
      ],
      "device_details": {
        "device_id": "DEVICE_VENDOR_ID:*****-9338-4E4C-A273-F8EDC83E132C",
        "device_name": "iPhone",
        "device_installation_id": "DEVICE_VENDOR_ID:*****-9338-4E4C-A273-F8EDC83E132C"
      },
      "card_payment_timeline": {
        "authorized_at": "2025-10-16T20:13:57.006Z"
      }
    },
    "location_id": "*******",
    "order_id": "hOfl1Txu0tHQM5HaWyg5CR06PBSZY",
    "total_money": {
      "amount": 4425,
      "currency": "USD"
    },
    "approved_money": {
      "amount": 0,
      "currency": "USD"
    },
    "delay_action": "COMPLETE",
    "delayed_until": "2025-10-16T20:14:56.938Z",
    "device_details": {
      "device_id": "DEVICE_VENDOR_ID:*****-9338-4E4C-A273-F8EDC83E132C",
      "device_name": "iPhone",
      "device_installation_id": "DEVICE_VENDOR_ID:****-9338-4E4C-A273-F8EDC83E132C"
    },
    "application_details": {
      "square_product": "SQUARE_POS",
      "application_id": "sq0idp-***-EKbDQ"
    },
    "version_token": "mKrnGUFcBASGAGMUVT4JhXmR69ND19z2JYoEcGOzGRr6o"
  }
}

Hi Bryan , i still looking a solutions of the Gift Card Payment issue , please advise, thx much