niammuddin

flip.id API

Aug 20th, 2024
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     const response = await fetch(`${flipApiHost}/v2/pwf/bill`, {
  2.       method: 'POST',
  3.       headers: {
  4.         'Content-Type': 'application/json',
  5.         'Authorization': `Basic ${Buffer.from(flipAPiKey + ':').toString('base64')}`,
  6.         'idempotency-key': invoiceId
  7.       },
  8.       body: JSON.stringify({
  9.         title: `${invoiceId}`,
  10.         amount: parseInt(totalAmount),
  11.         sender_name: customer.name,
  12.         sender_email: customer.User.email,
  13.         expired_date: expiredDate,
  14.         step: '2',
  15.         type: 'SINGLE',
  16.         redirect_url: `${flipApiRedirect}/invoices/${invoiceId}`
  17.       })
  18.     });
Add Comment
Please, Sign In to add comment