question

sjohns avatar image
sjohns asked brianw commented

Why am I getting a 404 error when trying to see Void Payments?

I have a set up a webhook to ingest all payments but when a payment is void and I try to make a call to get the payment information I receive a 404 Not Found Error.

I receive this json from Clover :

Full JSON from Clover: {"appId":"APPID","merchants":{"myMerchant":[{"objectId":"P:myID","type":"UPDATE","ts":1705595278495}]}}

I then make a call to Clover to try to get the payment information using

https://sandbox.dev.clover.com/v3/merchants/myMerchant/payments/myID


That api call returns 404 not found. How do I get the voided payment information?


Payments
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brianw avatar image brianw commented ·

That call is the one that works for me, at least on production.

https://api.clover.com/v3/merchants/MERCHANTID/payments/PAYMENTID

Another option, that also works for me, is "get all payments" with a filter for the payment ID and a filter for voided=true.

http://api.clover.com/v3/merchants/MERCHANTID/payments?filter=id%3DPAYMENTID&filter=voided%3Dtrue

"get all payments" seems to have a default filter of "voided=false".

0 Likes 0 ·
parquet76 avatar image
parquet76 answered parquet76 commented

If that end point returns a 404, the payment has been voided. I am not sure what you are trying to do but if you need the voided payment for some reason I don't think you can use the endpoint that takes an ID. You can use the get payments endpoint and expand on "voids", you can batch pull in a single query of you want - https://docs.clover.com/docs/using-filters-to-retrieve-multiple-results-from-an-endpoint.

2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sjohns avatar image sjohns commented ·
I have used the api call mentioned above in our production environment and it returns the payment information with the void but in the sandbox environment it doesn't. I need to test the voids in sandbox to fix an issue. Any idea why it would be different between the environments?
0 Likes 0 ·
parquet76 avatar image parquet76 sjohns commented ·

That doesn't sound right.

0 Likes 0 ·
thetaimourahmed avatar image
thetaimourahmed answered

Ah, I see what's going on here! You've got a webhook set up to catch all the payments, but when you try to snag details on a voided payment, you hit a snag with a 404 Not Found Error. That's quite the pickle, isn't it? Let's untangle this together.


First things first, your webhook is doing its job by alerting you of payment updates, including voided ones. That's clear from the JSON you're getting from Clover. Now, when you're making that call to Clover's API to fetch the payment details, it's like you're fishing in a pond where the fish has already been caught and thrown back – the payment has been voided, so it's not in the usual spot anymore.


Here's what you can try:


Check the Documentation: Clover's API documentation is your treasure map here. There might be a specific endpoint or a parameter you need to use to fetch voided transactions. These can often be in a different category or require a different approach.


Use a Different Endpoint: Sometimes, APIs have separate endpoints for standard transactions and those that are voided, refunded, or otherwise altered. You might need to call a different URL to get the info on voided payments.


Include Additional Parameters: Some APIs require you to specify that you want to include voided or altered transactions in your request. This could be a query parameter in your API call.


Contact Clover Support: If all else fails, reaching out to Clover's support or developer relations can be a goldmine. They can give you the exact coordinates for the treasure you're looking for.


Check Your Access Permissions: Sometimes, you might not have the right clearance to access certain types of transactions. Make sure your API credentials have the necessary permissions.


Look into Webhook Payload: Sometimes the webhook payload itself might contain more details about the voided transaction. Ensure you're extracting all the relevant information from what Clover sends you.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community