question

brunopalozzi avatar image
brunopalozzi asked David Marginian Deactivated commented

Save a Credit Card to Customer Using Hosted IFrame. Getting a "token_already_used" error

I'm trying to save a multipay token to a customer, but I am gettting this errow below:

{ "message" : "400 Bad Request" , "error" : { "code" : "token_already_used" , "message" : "You cannot use a clover token more than once unless it is marked as multipay." } }


Here's my workflow:

  1. Generate a token using hosted iFrame
  2. Create a customer with https://docs.clover.com/reference#handlerscreatecustomer (https://sandbox.dev.clover.com/v3/merchants/mId/customers)
  3. Add/Save the card to the customer with https://docs.clover.com/reference#handlerscreatecustomercard (https://sandbox.dev.clover.com/v3/merchants/mId/customers/customerId/cards)
  4. In Step 3, I mark the tokenType as "MULTIPAY" and get a successful result on save.

However, when I try to charge the card, I get an error.

e-commerce api
10 |2000

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

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

Please see our documentation on saving a card for future use: https://docs.clover.com/docs/ecommerce-saving-card

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.

brunopalozzi avatar image brunopalozzi commented ·

@David Marginian:

In the workflow in https://docs.clover.com/docs/ecommerce-saving-card I'd have to use OAuth access token for the requests


In the case I need to use OAuth, I'd have to submit my app for approval while moving to production?

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ brunopalozzi commented ·

"In the workflow in https://docs.clover.com/docs/ecommerce-saving-card I'd have to use OAuth access token for the requests"

Not sure why you think that, BUT, you should be using OAuth tokens anyway, using merchant tokens is prohibited in production (unless your app is for a single merchant).

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