BaleMessenger icon

BaleMessenger

Interact with Bale Messenger API

Overview

The node integrates with the Bale Messenger API to send payment invoices within chats. Specifically, the Send Invoice operation under the Payment resource allows users to create and send a payment request (invoice) to a specified chat. This is useful for scenarios where you want to request payments from users directly through Bale Messenger, such as selling products or services, collecting donations, or managing subscriptions.

Practical examples:

  • An online store sending an invoice for purchased items.
  • A service provider requesting payment for booked appointments.
  • A charity organization sending donation requests.

Properties

Name Meaning
Chat ID Unique identifier of the target chat where the invoice will be sent.
Reply Markup Additional interface options for the message; can be one of: Inline Keyboard, None, Reply Keyboard, or Reply Keyboard Remove.
Reply Keyboard Custom keyboard layout with reply options (only shown if Reply Markup is set to Reply Keyboard).
Reply Keyboard Remove Options to remove the custom keyboard, including whether to remove it and whether to apply selectively.
Reply To Message ID If replying to a specific message, the ID of that original message.
Title Title of the invoice, typically the product or service name.
Description Description text for the invoice explaining what the payment is for.
Payload Internal payload string (1 to 128 bytes) used to differentiate payment requests; not visible to users.
Provider Token The token representing the payment provider or card number used to process the payment.
Prices A list of price objects, each containing a label (e.g., product name) and amount (in smallest currency unit).
Photo Url URL of a product image to include with the invoice for visual reference.

Output

The output JSON contains the response from the Bale Messenger API after attempting to send the invoice. It includes details about the sent invoice such as confirmation data returned by the API. The node does not output binary data for this operation.

Example output structure (simplified):

{
  "json": {
    // API response fields confirming invoice sent status and details
  }
}

Dependencies

  • Requires an active Bale Messenger API credential with a valid token.
  • The node uses the official Bale Messenger Bot API endpoint (https://tapi.bale.ai/bot).
  • No additional environment variables are required beyond the API credentials configured in n8n.

Troubleshooting

  • Invalid Provider Token: If the provider token is incorrect or expired, the API will reject the invoice request. Ensure the token is valid and has payment permissions.
  • Malformed Prices List: The prices must be a properly formatted JSON array of objects with label and amount. Invalid formatting will cause errors.
  • Chat ID Issues: If the chat ID is invalid or the bot lacks permission to send messages to the chat, the invoice will fail to send.
  • Reply Markup Errors: Incorrectly structured reply markup options may cause the API to reject the message. Use the provided UI options carefully.
  • API Rate Limits: Sending too many invoices in a short time may trigger rate limits; handle errors gracefully and retry later.

Common error messages usually come from the Bale Messenger API and include details on what went wrong. Check the error message and ensure all required parameters are correctly set.

Links and References

Discussion