const baseUrl = "http://devtopup.pgecom.com"; const token = ""; const createPrepaidCard = async () => { try { const prepaidCardPayload = { fullName: "John Doe", amount: 0, email: "info@pgecom.com", billingAddress: { line1: "9700 Medlock Bridge Road", city: "John Creeks", country: "GA", state: "US", postal_code: "90098", }, isPhysical: false, }; const { data } = await axios({ url: `${baseUrl}/api/token/issue`, method: "POST", headers: { authorization: `Bearer ${token}`, }, data: prepaidCardPayload, }); return data; // { "prepaidUrl": "http://devtopup.pgecom.com/prepaid/467267761**** } } catch (error) { throw new Error("Error getting token"); } };