score:0

Accepted answer
axios
  .post(
    "http://localhost:3001/users_courses/payment",
    {
      items: [{ id: response.data.id, quantity: 1 }],
    },
    {
      headers: {
        accessToken: localStorage.getItem("accessToken"),
      },
    }
  )
  .then(({ data: { url } }) => {
    window.location.replace(url);
    console.log(url + " this is the url");
  })
  .catch((e) => {
    console.error(e.error);
  });

Related Query

More Query from same tag