# Delete Payment Link API didn't return the cancelled\_order\_id and the link didn't expire

**URL:** <https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874>\
**Category:** Questions\
**Tags:** checkout-api\
**Created:** [April 10, 2025, 6:15am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874 "2025-04-10T06:15:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [April 10, 2025, 6:15am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/1 "2025-04-10T06:15:55Z")

</div>

Hi,  
We’ve encountered a case where our customer was able to complete a payment even after the payment link was deleted using the Delete Payment Link API:

> **[DELETE /v2/online-checkout/payment-links/{id} - Square API Reference](https://developer.squareup.com/reference/square/checkout-api/delete-payment-link)**
>
> Deletes a payment link.

According to the documentation, the API response should include two pieces of information:  
 → The ID of the deleted payment link  
 → The cancelled order ID (cancelled\_order\_id)

But in this case, we only received the payment link ID in the response — the cancelled order ID was missing.

My questions:  
 → Why was the cancelled\_order\_id not returned in the response?  
 → Under what circumstances would the payment link not expire after calling this API?

Additional context:  
 → The customer initially attempted a payment, but it failed with the error “TRANSACTION\_LIMIT.” We received a payment ID with status “FAILED” in response of “orders/ORDERID-GET”

→ Our system then triggered the Delete Payment Link API.

→ However, several hours later, the customer was still able to successfully complete the payment with a different card using the same payment link. We received another payment ID in response of “orders/ORDERID-GET”

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [April 10, 2025, 6:16am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/2 "2025-04-10T06:16:29Z")

</div>

👋 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:

> **[Refund Payments](https://developer.squareup.com/docs/payments-api/refund-payments)**
>
> Learn how to process refunds with the Square Refunds API.

> **[Payments API Integration](https://developer.squareup.com/docs/pos-api/payments-integration)**
>
> Learn how to get payment details from a Point of Sale API transaction ID.

> **Additional Documentation**
>
> [Retrieve Refunds](https://developer.squareup.com/docs/refunds-api/retrieve-refunds)  
> [Retrieve Payments](https://developer.squareup.com/docs/payments-api/retrieve-payments)  
> [Cancel or Delete Invoices](https://developer.squareup.com/docs/invoices-api/cancel-delete-invoices)

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.

---

<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:** [April 10, 2025, 4:15pm UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/3 "2025-04-10T16:15:32Z")

</div>

I just tested `DeletePaymentLink` and the `order_id` was in the response. Do you have the `payment_id` of the failed payment and the `payment_id` for the successful payment? Also what’s the `order_id` of the payment link that you deleted? 🙂

---

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [April 10, 2025, 5:33pm UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/4 "2025-04-10T17:33:09Z")

</div>

Is that information safe to share here?

---

<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:** [April 10, 2025, 5:50pm UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/5 "2025-04-10T17:50:56Z")

</div>

Yes, anything that I ask for is absolutely safe to share. The one value that we ask that you never share is your access token. That is secret and should never be shared publicly. 🙂

---

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [April 11, 2025, 4:27am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/6 "2025-04-11T04:27:45Z")

</div>

Here is the order ID and the payment IDs:  
Order ID: 55kxgKvDlhOUjdwEybuMNj9oRRIZY  
Failed Payment ID: 1M3P6X1J1KaWTmNjkbr22yMFHwZZY  
Successful Payment ID: Hb23Nki1bPLlMC5WXkcdGABUDqFZY

---

<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:** [April 11, 2025, 4:45pm UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/7 "2025-04-11T16:45:01Z")

</div>

I just took a look at your [API Logs](https://developer.squareup.com/apps/sq0idp-IbtUpw5WWJkQOIPL8qTOtQ/log) and I don’t see any API calls to `DeletePaymentLink` with the order\_id: `55kxgKvDlhOUjdwEybuMNj9oRRIZY`. Are you sure it was called correctly?

---

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [April 13, 2025, 7:33am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/8 "2025-04-13T07:33:25Z")

</div>

Yes. Should I share the request and response logs with the payment link ID?

---

<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:** [April 14, 2025, 3:54pm UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/9 "2025-04-14T15:54:09Z")

</div>

Yes, that would be helpful. 🙂

---

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [April 15, 2025, 4:22am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/10 "2025-04-15T04:22:58Z")

</div>

Here are the logs:

Request:  
{“url”:“https://connect.squareup.com/v2/online-checkout/payment-links/5KCK6T4LELEP7BGW”,“type”:“DELETE”,“header”:[“Authorization: Bearer TOKEN”,“Content-Type: application/json”],“data”:null}

Respnse:  
{“id”:“5KCK6T4LELEP7BGW”}

And I just noticed that my system has sent around 1,900 delete payment link requests since 2024-10-30, and in about 90 of those requests, we didn’t receive a cancelled order ID.

---

<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:** [April 15, 2025, 5:48pm UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/11 "2025-04-15T17:48:40Z")

</div>

I’m checking with the team on this. 🙂

---

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [April 16, 2025, 1:38pm UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/12 "2025-04-16T13:38:08Z")

</div>

Just following up to see if there have been any updates?

---

<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:** [April 16, 2025, 4:29pm UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/13 "2025-04-16T16:29:45Z")

</div>

I’m still waiting on a response from the team. Just to confirm is this intermit? I see some calls with the `order_id` and others without. 🙂

---

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [April 17, 2025, 4:38am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/14 "2025-04-17T04:38:28Z")

</div>

Yes, it’s not happening with every request—only with a few requests.

---

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [April 21, 2025, 7:37am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/15 "2025-04-21T07:37:28Z")

</div>

Just following up to see if there have been any updates?

---

<div class="post-metadata">

**Author:** ![josh-square](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@josh-square](https://developer.squareup.com/forums/u/josh-square)\
**Post date:** [April 21, 2025, 1:42pm UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/16 "2025-04-21T13:42:25Z")

</div>

@kishanv We don’t have any updates yet, but we’ll let you know as soon as we do!

---

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [May 2, 2025, 4:29am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/17 "2025-05-02T04:29:52Z")

</div>

Just checking in to see if there have been any updates since our last message. We’re still looking forward to hearing from you and appreciate any information you can share. If any updates or changes are required on my end regarding this API, please let me know.

---

<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:** [May 2, 2025, 3:53pm UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/18 "2025-05-02T15:53:34Z")

</div>

How often are you seeing this behavior? 🙂

---

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [May 5, 2025, 6:04am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/19 "2025-05-05T06:04:04Z")

</div>

As stated above, it doesn’t happen with every request—only with a few requests.

> [@Delete Payment Link API didn't return the cancelled\_order\_id and the link didn't expire](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/10):
>
> Here are the logs: Request: {“url”:“https://connect.squareup.com/v2/online-checkout/payment-links/5KCK6T4LELEP7BGW”,“type”:“DELETE”,“header”:[“Authorization: Bearer TOKEN”,“Content-Type: application/json”],“data”:null} Respnse: {“id”:“5KCK6T4LELEP7BGW”} And I just noticed that my system has sent around 1,900 delete payment link requests since 2024-10-30, and in about 90 of those requests, we didn’t receive a cancelled order ID.

> [@Delete Payment Link API didn't return the cancelled\_order\_id and the link didn't expire](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/14):
>
> Yes, it’s not happening with every request—only with a few requests.

---

<div class="post-metadata">

**Author:** ![kishanv](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kishanv](https://developer.squareup.com/forums/u/kishanv)\
**Post date:** [May 14, 2025, 5:16am UTC](https://developer.squareup.com/forums/t/delete-payment-link-api-didnt-return-the-cancelled-order-id-and-the-link-didnt-expire/21874/20 "2025-05-14T05:16:17Z")

</div>

HI, It’s been more than a month. Any updates on this you can share with us? Thanks.
