@wppconnect/wa-js - v4.7.1
    Preparing search index...

    Function sendChargeMessage

    • Send a order message To send (prices, tax, shipping or discount), for example: USD 12.90, send them without dots or commas, like: 12900

      Parameters

      Returns Promise<SendMessageReturn>

      // Send charge with a product
      WPP.chat.sendChargeMessage('[number]@c.us', [
      { type: 'product', id: '67689897878', qnt: 2 },
      { type: 'product', id: '37878774457', qnt: 1 },
      ]

      // Send charge with a custom item
      WPP.chat.sendChargeMessage('[number]@c.us', [
      { type: 'custom', name: 'Item de cost test', price: 120000, qnt: 2 },
      ]

      // Send charge with custom options
      WPP.chat.sendChargeMessage('[number]@c.us', [
      { type: 'product', id: '37878774457', qnt: 1 },
      { type: 'custom', name: 'Item de cost test', price: 120000, qnt: 2 },
      ],
      { tax: 10000, shipping: 4000, discount: 10000 }

      // Send charge with Pix data (auto generate copy-paste pix code)
      WPP.chat.sendChargeMessage('[number]@c.us', [
      { type: 'custom', name: 'Item de cost test', price: 120000, qnt: 2 },
      ],
      {
      tax: 10000,
      shipping: 4000,
      discount: 10000,
      pix: {
      keyType: 'CPF',
      key: '00555095999',
      name: 'Name of seller',
      },
      });

      // Send a charge with Pix, payment link, boleto, and cards
      WPP.chat.sendChargeMessage('[number]@c.us', [
      { type: 'custom', name: 'Product', price: 20000, qnt: 1 },
      ], {
      paymentSettings: {
      pixCode: '000201...',
      paymentLink: 'https://example.com/pay/123',
      boletoCode: '00190...',
      cards: true,
      },
      });