for those who also stumbled with this error - this was because I tried to pass incorrect error code, in my case DUPLICATE_INVOICE_ID was not a valid code for /v2/checkout/orders creation API call. the list of valid codes can be found here https://developer.paypal.com/api/rest/reference/orders/v2/errors/ My mistake however was to try to use the constants from the "error" column of that table, when in fact the valid codes are listed in the "issue" column. thanks the stackoverflow community to show me the path https://stackoverflow.com/questions/74961105/paypal-mock-response-not-working-nodejs-paypal-negative-testing/74961880#74961880
... View more