niammuddin icon

flip.id API

niammuddin | PRO | 08/20/24 02:54:51 PM UTC | 0 ⭐ | 332 👁️ | Never ⏰ | []
JavaScript |

620 B

|

None

|

0 👍

/

0 👎

    const response = await fetch(`${flipApiHost}/v2/pwf/bill`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Basic ${Buffer.from(flipAPiKey + ':').toString('base64')}`,
        'idempotency-key': invoiceId
      },
      body: JSON.stringify({
        title: `${invoiceId}`,
        amount: parseInt(totalAmount),
        sender_name: customer.name,
        sender_email: customer.User.email,
        expired_date: expiredDate,
        step: '2',
        type: 'SINGLE',
        redirect_url: `${flipApiRedirect}/invoices/${invoiceId}`
      })
    });

Comments