# Payment Completes but also returns 404 - Live (API - Complete Payment)

**URL:** <https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719>\
**Category:** Questions\
**Tags:** payments-api\
**Created:** [June 7, 2021, 9:39pm UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719 "2021-06-07T21:39:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![joel.h](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/joel.h/32/824_2.png) [@joel.h](https://developer.squareup.com/forums/u/joel.h)\
**Post date:** [June 7, 2021, 9:39pm UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719/1 "2021-06-07T21:39:55Z")

</div>

I’m getting the following error when completing a payment in Live, although the payment is completing successfully (card is charged, order appears in seller dashboard):

Raw error: { “errors”: [{ “category”: “INVALID\_REQUEST\_ERROR”, “code”: “NOT\_FOUND”, “detail”: “Resource not found.” }] }

We create an order successfully, make payment with location successfully, but then the complete payment call returns a 404 even though the payment actually completes successfully.

---

<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 7, 2021, 11:53pm UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719/2 "2021-06-07T23:53:51Z")

</div>

That is odd. What’s your application Id and whats the `payment_id` for the successful payment?

---

<div class="post-metadata">

**Author:** ![joel.h](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/joel.h/32/824_2.png) [@joel.h](https://developer.squareup.com/forums/u/joel.h)\
**Post date:** [June 8, 2021, 1:09am UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719/3 "2021-06-08T01:09:14Z")

</div>

Hi Brian. The application ID is: sq0idp-Ma4zHT\_Fb7vtHT5G6whDIw  
From what I can tell I didn’t get a payment id (which makes this even stranger). The last error occurred at: 6/7/2021, 3:36:22 PM (CST) if that helps. Thanks for looking into this!

---

<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 8, 2021, 3:12pm UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719/4 "2021-06-08T15:12:20Z")

</div>

Looking at the logs it looks like the `customer_id` was null and this is why the error was returned. Was this payment created with a token generated from the SqPaymentForm or Web Payments SDK?

---

<div class="post-metadata">

**Author:** ![joel.h](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/joel.h/32/824_2.png) [@joel.h](https://developer.squareup.com/forums/u/joel.h)\
**Post date:** [June 8, 2021, 4:11pm UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719/5 "2021-06-08T16:11:31Z")

</div>

Thanks Brian. The customer ID would have been blank as it was a guest user - is this not allowed? The nonce was from the SqPaymentForm.

---

<div class="post-metadata">

**Author:** ![joel.h](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/joel.h/32/824_2.png) [@joel.h](https://developer.squareup.com/forums/u/joel.h)\
**Post date:** [June 9, 2021, 10:33pm UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719/6 "2021-06-09T22:33:09Z")

</div>

Hi @Bryan-Square - Just checking to see if you have any more info on this. Thanks!

---

<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 10, 2021, 12:08am UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719/7 "2021-06-10T00:08:21Z")

</div>

Hi @joel.h, looking at the logs for the app\_id that you provided I see two calls to `/v2/payments/{payment_id}/complete` that resulted in a BAD\_REQUEST. Also there are two payments that took place just about the exact time as the bad requests. They were successful and I see that `autocomplete` wasn’t set for those payments. Are you using `autocomplete`? If not there isn’t a need to use [CompletePayment](https://developer.squareup.com/reference/square/payments-api/complete-payment). 🙂

---

<div class="post-metadata">

**Author:** ![joel.h](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/joel.h/32/824_2.png) [@joel.h](https://developer.squareup.com/forums/u/joel.h)\
**Post date:** [June 10, 2021, 10:30am UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719/8 "2021-06-10T10:30:59Z")

</div>

I wasn’t explicitly setting autocomplete, but looking at the doc it defaults to true (which is “interesting”). This setup has been working fine with sandbox. Now I’m not getting a payment.status or a payment.card\_details.status back from the Create payment call ([https://connect.squareup.com/v2/payments](https://connect.squareup.com/v2/payments)) to verify that it’s COMPLETED or CAPTURED - I’m just getting empty values back in the response with a successful payment.

---

<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 10, 2021, 3:34pm UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719/9 "2021-06-10T15:34:45Z")

</div>

Do you have the `payment_id`s that didn’t show the details? The status and card details are supposed to be in the response.

---

<div class="post-metadata">

**Author:** ![joel.h](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/joel.h/32/824_2.png) [@joel.h](https://developer.squareup.com/forums/u/joel.h)\
**Post date:** [June 10, 2021, 9:44pm UTC](https://developer.squareup.com/forums/t/payment-completes-but-also-returns-404-live-api-complete-payment/2719/10 "2021-06-10T21:44:52Z")

</div>

I wasn’t getting a payment\_id back either. I looked deeper into the response definition and there was an issue there. The original issue was resolved by not performing the “Complete payment” call (as the “Create payment” defaulted to autocomplete=true), and the other issues were related to an invalid response body definition. Thanks for your help on this Brian!
