question

qualwebs avatar image
qualwebs asked ·

Private token changing on every payment

Hello,

We are facing a strange issue with API token, Created a token for online payment and able to do payment with that. The strange thing is, After every payment, the private token getting changed automatically.

We tried 4-5 payments on sandbox, It changing everytime and returns error below

{

"message": "400 Bad Request",

"error": {

"code": "processing_error",

"message": "Keys for idempotent requests can only be used with the same parameters they were first used with.Try using a different key."

}

}


And it works only after changing the key.

Now, The question is, How to do multiple payments with this case.


Thanks,
Dev

PaymentsAPI Tokene-commerce api
10 |2000 characters needed characters left characters exceeded

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

1 Answer

· Write an Answer
David Marginian avatar image
David Marginian answered ·

I don't know what you mean by API token in this context. The message you attached indicates you are trying to use the same idempotent key with a request that was different than the original. An idempotent key is NOT and shoud NOT be the API token. It is a unique id PER transaction that should be passed to prevent duplicate transactions if the transaction needs to be retried due to network failures, etc. For example, if you initiated a charge but never received a response because the network dropped out. In this case you would retry the same request, with the same idempotency key and it would not result in a duplicate - https://docs.clover.com/docs/ecommerce-accepting-payments#using-idempotency-keys.

4 comments
10 |2000 characters needed characters left characters exceeded

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

Hi,

This private token getting changed everytime:
https://i.postimg.cc/yYVvSTgG/screenshot-1422.png

This token we are using to make payment as auth bearer token.


Thanks

0 Likes 0 ·

That token does not change.

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

Hi David,

This is the strange thing, It's changing after every payment.


0 Likes 0 ·
Show more comments

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