An invoice is a document you send to your client after purchasing goods or services from you, recording the sale, and requesting payment from them. You can catch everything you need about PayTabs invoices in our what PayTabs Invoices is? solutions article.



In this article, we will walk you through the way to send PayTabs invoices to your customers via Email while initiating the invoice request. Here you will be using the "notification" object clarified in our Request Parameters | invoice (invoice) solution article to provide the customers' emails to whom you want to send this invoice once it is created.

In this article, you will be going to know about:




The Minimum Required Parameters


Here, you will be using the normal invoice request as clarified in our initiating/Creating the Invoice Payment Request solution article, and along with it you will be adding the "notification" object and providing the emails to the customers that you want the invoice to be sent to them once it is created.


To initiate a payment request using this integration type, there are minimum required parameters that need to be passed with valid information. The specification of these required parameters is clarified below:


Parameter

Data Type

Min

Max

Required

Purpose

notifications

OBJECT

Accept only emails and phone numbers arrays.

This parameter indicates the notification options through our APIs. Using this, you will be able to send the created invoice to an array of emails or phone numbers via SMS

emails

Array

0

5

This parameter indicates an array of phone numbers that the created invoice will be sent to it via SMS.





Sample Request Payload


The below sample request payload will show you how you can pass the above-mentioned parameters, which need to be passed with valid values to perform a request.


{
    "profile_id": {{profile_id}},
    "tran_type": "sale",
    "tran_class": "ecom",
    "tokenise": 2,
    "cart_currency": {{Cart_currency}},
    "cart_amount": "9.5",
    "cart_id": "cart_12345_2",
    "cart_description": "Test Description",
    "hide_shipping": true,
    "customer_ref":"CUST0101",
    "invoice": {
        "shipping_charges": 0,
        "extra_charges": 0,
        "extra_discount": 0,
        "total": 0,
        "expiry_date": "2023-10-27T13:33:00+04:00",
        "due_date": "2023-10-26T12:36:00+04:00",
       "notifications":{
                      "emails":["[email protected]","'[email protected]"]

},
        "line_items": [
            {
                "sku": "sku",
                "description": "desc",
                "url": "https://www.costacoffee.ae/whats-new/flat-white",
                "unit_cost": 9.5,
                "quantity": 1,
                "net_total": 9.5,
                "discount_rate": 0,
                "discount_amount": 0,
                "tax_rate": 0,
                "tax_total": 0,
                "total": 9.5
            }
        ]
    }
Generic

Sample Response Payload


{
    "bulk_email": [
        {
            "address": "[email protected]"
        },
        {
            "address": "[email protected]"
        }
    ],
    "invoice_id": 2775626,
    "invoice_link": "https://secure-egypt.paytabs.com/payment/request/invoice/2775626/40EAF5A43CB745B2B5C58410D4192321"
}
Generic




⌂ To get familiar with the whole process and the other steps, kindly navigate to our "The PT2 API Endpoints Integration Manual" solution article. 

And to get familiar with the rest of the steps regarding the previous step "Step 2 - Configure the integration method" kindly click here.

⇦ And to get familiar with the rest of the steps regarding the current step "Step 3 - Initiating the payment" click here

 And to navigate to the next step in the integration process "Step 4 - Accepting the payment" kindly click here.