"Card token service not found" (404) when creating a subscription with a valid card token #362
Unanswered
RyanOliveira00
asked this question in
Q&A
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
I'm trying to create a subscription using the Mercado Pago API, but I'm consistently encountering the error
"Card token service not found"
with a404
status code. I've followed the documentation and implemented all the necessary steps, but the issue persists.Here’s what I’ve done so far:
Generated a Card Token:
I used the Mercado Pago SDK on the frontend to generate a card token. The token is created successfully, and I pass it to the backend.
Created or Fetched a Customer:
I check if a customer exists using their email. If not, I create a new customer using the
MercadoPagoCustomer.create
method. The customer is created successfully, and I receive a validcustomerId
.Linked the Card to the Customer:
I use the
MercadoPagoCustomer.createCard
method to link the card token to the customer. This step also succeeds, and I receive a validcardResponse.id
.Created the Subscription:
Finally, I attempt to create a subscription using the
MercadoPagoPreApproval.create
method. However, this step fails with the error"Card token service not found"
and a404
status code.Code Snippet:
Here’s the relevant part of my code:
Error Details:
The error occurs when calling
MercadoPagoPreApproval.create
. Here’s the full error response:Additional Information:
5031 4332 1540 6351
123
11/2025
customerId
andcardResponse.id
are both valid and correctly returned by the API.cardToken
is not expired and is correctly passed to the backend.Questions:
"Card token service not found"
error occurring even though the card token is valid and linked to the customer?MercadoPagoPreApproval.create
method in the sandbox environment?Environment:
https://api.mercadopago.com
Beta Was this translation helpful? Give feedback.
All reactions