I have created a webapi.xml in module vault:

<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    <route url="/V1/vault/items" method="GET">
        <service class="Magento\Vault\Api\PaymentTokenManagementInterface" method="getListByCustomerId"/>
            <resource ref="self" />
            <parameter name="customerId" force="true">%customer_id%</parameter>


Give this type of error :-

this is a result:"message": "Internal Error. Details are available in Magento log file. Report ID: webapi-5b7c371e39aa0" }

in my log file i see this error: -

main.CRITICAL: Report ID: webapi-5b7c371e39aa0; Message: Class \Magento\Vault\Api\Data\PaymentTokenSearchResultsInterfa does not exist {"exception":"     
     [object] (Exception(code: -1): Report ID: webapi-5b7c371e39aa0; Message: Class      \\Magento\\Vault\\Api\\Data\\PaymentTokenSearchResultsInterfa does not exist at /<dir>/vendor/magento/framework/Webapi/ErrorProcessor.php:205, ReflectionException(code: -1): Class \\Magento\\Vault\\Api\\Data\\PaymentTokenSearchResultsInterfa does not exist at /<dir>/vendor/magento/framework/Reflection/MethodsMap.php:155)"} []

Can help me?

2 Answers 2


Looks like there is an issue in Magento 2 core.

 * Lists payment tokens that match specified search criteria.
 * @param int $customerId Customer ID.
 * @return \Magento\Vault\Api\Data\PaymentTokenSearchResultsInterface Payment token search result interface.
 * @since 100.1.0
public function getListByCustomerId($customerId);

return value is \Magento\Vault\Api\Data\PaymentTokenSearchResultsInterface but actually it returns \Magento\Vault\Api\Data\PaymentTokenInterface[]. So set correct return type fix the issue.

Here you can check working sample https://github.com/troublediehard/mma-customapi


We needed to import tokens into the vault using the rest Api, so we knocked this module together: https://packagist.org/packages/zero1/vault-web-api hopefully it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.