const url = `https://gateway-api.sandbox.paymove.io/api/pay/product/${merchantId}/subproduct/pricing`;
const body = {
price: 1000,
externalId: "order-123",
details: {
currency: "PLN",
returnUrl: "https://merchant-shop.com/payment/success",
productName: "Sports T-shirt",
customerId: "user-567",
locale: "pl-PL",
},
};
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": apiKey,
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data.redirectUrl);