question

mtsuggs avatar image
mtsuggs asked chrispetchey commented

Which token to use for Revoke a payment source endpoint?

I am trying to update the credit card when creating a customer and card using the "Create a customer on file" endpoint. This works great to CREATE the customer. I would like to be able to update the credit card now. I tried to call update directly but a 409 comes back from the API stating that there is already an attached credit card. With that in mind, I'm assuming I need to call revoke payment, then run the update.

The revoke API here https://docs.clover.com/reference/revoke-a-payment-source for sourceId has verbiage that states:


sourceId
string
required

Universally unique identifier (UUID) of the card data associated with a customer record.
Use Create a card-on-file customer endpoint to generate the card data identifier.


The response back from the create customer on file is:

{

"id" : "some customer id",

"object" : "customer",

"created" : 1703264188177,

"currency" : "USD",

"email" : "some email",

"name" : "some name",

"sources" : {

"object" : "list",

"data" : [ "some id" ]

},

"shipping" : {

"name" : "some name"

}

}


The only identifer i see is "some id" and that is not a UUID. How do I execute a revoke payment request in conjuction with the response of the create customer on file endpoint?

ecommerce
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

·
bryanvargas avatar image
bryanvargas answered chrispetchey commented

You can use this endpoint: { {baseUrl}}/v3/merchants/{ {merchantId}}/customers/{ {customerId}}?expand=card and the sourceID will be return and that is the UUID you will use (not the token that starts with "clv")

5 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.

chrispetchey avatar image chrispetchey commented ·
I didnt know about the "expand" parameter. Is this documented anywhere? I've been searching for this answer for ages. Thank you


0 Likes 0 ·
parquet76 avatar image parquet76 chrispetchey commented ·

Expand parameters are in the API reference and there is a section in the documentation on how to use them - https://docs.clover.com/docs/expanding-fields

0 Likes 0 ·
chrispetchey avatar image chrispetchey commented ·

I take that back :(

It doesnt work. Here's there result i get back

https://sandbox.dev.clover.com/v3/merchants/{merchantId}/customers/customerid?expand=card

{"href": "https://sandbox.dev.clover.com/v3/merchants/{merchantId}/customers/{customerId}", "id": "{customerId}", "firstName": "{firstname}", "lastName": "{lastname", "marketingAllowed": false, "customerSince": 1706873469000, "metadata": {}}

Obviously I've edited out the sensitive details

0 Likes 0 ·
parquet76 avatar image parquet76 chrispetchey commented ·
You need to look at the API reference, it's "cards" not "card".
0 Likes 0 ·
chrispetchey avatar image chrispetchey parquet76 commented ·
I realized that :)

My apologies

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