# Square Afterpay/Clearpay Refund

**URL:** <https://developer.squareup.com/forums/t/square-afterpay-clearpay-refund/20239>\
**Category:** Questions\
**Tags:** sandbox, web-payments-sdk, refunds-api\
**Created:** [December 23, 2024, 12:42pm UTC](https://developer.squareup.com/forums/t/square-afterpay-clearpay-refund/20239 "2024-12-23T12:42:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![the\_one\_dev](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@the\_one\_dev](https://developer.squareup.com/forums/u/the_one_dev)\
**Post date:** [December 23, 2024, 12:42pm UTC](https://developer.squareup.com/forums/t/square-afterpay-clearpay-refund/20239/1 "2024-12-23T12:42:55Z")

</div>

I have implemented Square Afterpay/Clearpay inside my ticketing portal. And related to the place order everything is working fine. But Now when I try to refund the order Specifically from placed from the Afterpay payment option it throws api error with status code of 500. For the refund I am using this [endpoint](https://developer.squareup.com/explorer/square/refunds-api/refund-payment).

If I try to hit this endpoint with the order total amount then throws error of (Refund amount exceeds then the order total.) and If I try to add the lesser amount or the amount which is equal to the installment which user has paid then it Throws status code 500 error. And Surprisingly When I check with this endpoint [https://developer.squareup.com/explorer/square/refunds-api/list-payment-refunds](https://developer.squareup.com/explorer/square/refunds-api/list-payment-refunds)

Then for that particular order it shows pending status.

can you please guide me so I can implement in correct way and I can enable the Full payment and partial payment with Square API endpoint for the Afterpay.

---

<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:** [February 11, 2025, 5:33pm UTC](https://developer.squareup.com/forums/t/square-afterpay-clearpay-refund/20239/3 "2025-02-11T17:33:59Z")

</div>

What’s your application ID and what’s the `payment_id` that’s throwing the `5xx`? 🙂
