question

devsharma avatar image
devsharma asked David Marginian Deactivated commented

Clover charges API not working


This API returns the below response but the customer token is valid for 2023-01-18

stdClass Object
(
    [message] => 404 Not Found
    [error] => stdClass Object
        (
            [code] => invalid_request
            [message] => Please provide a valid source or token.
        )

)
REST APIAPI Token
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented
7 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.

We are already sending the source
My Request with sample data: {"amount": 10, "currency":"USD","source":"123"}

0 Likes 0 ·

Source "123" is not a valid source, the "source" must be a card token (or a customer uuid that has a card on file). To obtain a card token you would generally use the iFrame - https://docs.clover.com/docs/clover-iframe-integrations.

0 Likes 0 ·
devsharma avatar image devsharma David Marginian ♦♦ ·

I'm sending a valid token on my request. In this community all chat is open, so we are passing dummy tokens here

0 Likes 0 ·
Show more comments
Rob McGarry avatar image
Rob McGarry answered David Marginian Deactivated edited

David Marginian - is there a way to share our actually call request data securely with support to have them look at it and help troubleshoot this?

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.

In this case, I don't believe that is necessary as I believe my last comment will set you straight:

If you were passing a valid token the request would work, so you will need to provide more details about how the token is being generated, etc. One scenario I have seen a 404 is when the token wasn't generated for the correct developer app/merchant. This can happen if you obtain a PAKMS key with an access token that doesn't have the same ownership of the access token you are using to make the charge.

Note: I have seen the above happen when developers were using a merchant token to make the PAKMS call and then using an OAuth token to make the payment call, or vice-versa. Why developers would do this? I don't know. Remember, merchant tokens should not be used in production.

If it doesn't, you can provide the following in a moderator's only comment here:

1) The environment this is happening in (sandbox, prod).

2) The merchant id

3) Your app id

4) ~ time of call including timezone, and amount

0 Likes 0 ·

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