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 SMS.


Through out the article we will use the configuration options clarified in the previous step "Transaction API Main Configurations" and the invoice payment workflow clarified in the first step. 



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


The Endpoint and Related Postman Collection


In this tutorial, we will rely on the PayTabs invoices API Endpoint, mentioned on the PayTabs API endpoints postman collection, which you can access from hereThe endpoint will need to be accessed with a POST request on the below-mentioned URL


Post{{domain}}/payment/payment/invoice/{{invoice_id}}/sms



Please note that not using the proper endpoint URI {{domain}} will lead to authentication issues within your responses. To find the your proper domain you can read our What Is My (Region)/(endpoint URL)? solution article.



The Minimum Required Parameters


PayTabs offers you an API request that you can use to send your invoices via SMS messages to your customers. From the postman collection, and after applying the endpoint in your code, add the invoice_id that you want to send inside your endpoint URL params, as shown in the below sample:


curl --location -g --request POST 'https://secure-egypt.paytabs.com/payment/invoice/{{invoice_id}}/sms' \
--header 'authorization: SBJNZBM2GJ-J26LHBRWLH-6TMNHNL9WM' \
--header 'Content-Type: application/json' \


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

profile_id 

INT

Accept only valid profile number

The merchant Profile ID you can get from your PayTavs dashboard. For more information please check our How to get your account information from PT2 Dashboard? solution article.

To know more about this parameter please click here.

customer_details.phone  

STRING

Valid phone number

Indicates the customer's valid phone number 

To know more about this parameter please click here.




Sample Request Payload


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


{
     "profile_id":{{profile_id}},
     "customer_details" : {
     "phone":"01550091596"
    }
}



Sample Response Payload


{
"message": "Invoice No. 2080263 sent to phone: +20 15 50091596"
}











⌂ 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.