HomeUser GuidesAPI Reference
Get Started
HomeAPI Reference
Authentication
Branches
Contact Groups
Contacts
Conversations
Error HandlingInvoices
Messages
Orders
Rate LimitingSDKs & Code ExamplesTemplatesTicketsAPI VersioningWABA NumbersWebhooks
User GuideAPI ReferenceInvoices

Invoices

API for sending invoices via WhatsApp

Reading time: 2 minutes

Invoices

Comprehensive API for sending invoices via WhatsApp with PDF attachment support.


Send Invoice via WhatsApp

POST{{base_url}}/invoice-message

Send a complete invoice with attached PDF file to your customer via WhatsApp.

Query Parameters

ParameterTypeRequiredDescription
phone_number_idstringYesSender phone number ID

Request Body (form-data)

ParameterTypeRequiredDescription
phonestringYesRecipient phone number in international format (e.g., 96650000000)
message_textstringYesMessage text (max 1024 characters)
header_typestringYesHeader type: TEXT, IMAGE, DOCUMENT, VIDEO, LOCATION
header_mediafileNoPDF invoice file (max 100MB)
header_valuestringNoHeader value (URL for media, text for text)
namestringNoContact name (for new contacts)
emailstringNoEmail address (for new contacts)

Tip: Use header_type="DOCUMENT" with header_media to attach a PDF invoice file.

Example Request

Example Requestbash
curl -X POST "https://api.awalchat.com/api/developer/invoice-message?phone_number_id=123456" \
-H "Accept: application/json" \
-H "X-Awal-Signature-256: sha256=abc..." \
-H "X-Timestamp: 1704124800" \
-H "X-Domain: your-workspace" \
-H "X-Client-ID: your-client-id" \
-F "phone=96650000000" \
-F "message_text=Dear Ahmed, šŸ“„ Invoice #INV-2024-001 Your invoice has been issued for 1,250 SAR..." \
-F "header_type=DOCUMENT" \
-F "header_media=@/path/to/invoice.pdf"

Example Response

Response200 OK
{
"status": true,
"message": {
  "id": 281,
  "messageId": "wamid.HBgMOTY2NTAwMDAwMDAwFQIAERgS...",
  "status": "sent",
  "date": "2024-01-15T10:30:00Z"
}
}

Message Text Example

Message Text Templatetext
Dear Ahmed,

šŸ“„ Invoice #INV-2024-001

Your invoice has been issued for 1,250 SAR dated January 15, 2024.

Invoice Details:
- Tax Amount: 125 SAR
- Total: 1,375 SAR
- Due Date: January 30, 2024

Always at your service.

Important Notes

āš ļø

Files

  • File must be in PDF format
  • Maximum file size: 100MB
  • File will be attached as message header
  • Ensure the file is readable on mobile devices
šŸ’”

Text

  • You can use Emoji in text to enhance the experience
  • Maximum length: 1024 characters
  • Use clear and organized formatting
āœ…

Best Practices

  • Use clear and sequential invoice numbers
  • Include invoice details in the text
  • Verify phone number before sending
  • Test sending on a test number first

Use Cases

1. Send Simple Invoice

curl -X POST "https://api.awalchat.com/api/developer/invoice-message?phone_number_id=123456" \
  -F "phone=96650000000" \
  -F "message_text=Your invoice is ready! šŸ“„" \
  -F "header_type=TEXT" \
  -F "header_value=Invoice #INV-001"

2. Send Invoice with PDF

curl -X POST "https://api.awalchat.com/api/developer/invoice-message?phone_number_id=123456" \
  -F "phone=96650000000" \
  -F "message_text=Your attached invoice šŸ“„" \
  -F "header_type=DOCUMENT" \
  -F "header_media=@invoice.pdf"

Error Codes

CodeDescriptionCauseSolution
400Bad RequestInvalid dataCheck sent data
413Payload Too LargeFile too largeUse file smaller than 100MB
415Unsupported Media TypeUnsupported file typeUse PDF only

Related Sections

Messages

Send WhatsApp messages of all types

View Guide
View

Orders

Manage orders and invoices

View Guide
View

Technical Support

Need help?

  • šŸ“§ Email: support@awalchat.com
  • šŸ’¬ Live Chat: Available in the dashboard
  • šŸ“± WhatsApp: Contact us directly via WhatsApp
  • šŸ“š Examples: Check Code Examples