pcp-server-nodejs-sdk
Version:
[](https://sonarcloud.io/summary/new_code?id=PAYONE-GmbH_PCP-server-nodeJS-SDK) [
* @param requestId Optional X-Request-ID header value (may be null)
* @returns AuthenticationToken
*/
async getAuthenticationTokens(merchantId, requestId) {
if (!merchantId) {
throw new Error('Merchant ID is required');
}
const url = new URL(`/v1/${merchantId}/authentication-tokens`, this.getConfig().getHost());
const headers = new Headers({
'Content-Type': 'application/json',
});
if (requestId) {
headers.append('X-Request-ID', requestId);
}
const requestInit = {
method: 'POST',
headers,
// node-fetch expects null for empty body
body: null,
};
return this.makeApiCall(url.toString(), requestInit);
}
}
//# sourceMappingURL=AuthenticationApiClient.js.map