We support barcoding on both sent and received faxes.   We can write barcodes in DataMatrix, but we can read DataMatrix as well as PDF417.

NOTE: In general, barcodes should be kept smaller than 400 pixels (2 inches height and width) for DataMatrix and 800 pixels (4 inches height and width) for PDF417.  In most cases, a barcode of 100 pixels (1/2 inch height and width) is sufficient (for DataMatrix, which is our standard format) in size to contain all of the data you will be passing and still be read.

If you want us to read bar codes on faxes that are coming into your Sfax account, you need to make sure your account is enabled for Inbound Barcode reading.  To confirm that, you can contact Support.

  • Use &OptionalParams &BarcodeOption – This parameter is used only to pass information to create a barcode on outgoing-fax pages.
  • BarcodeData= - Is a string value used to create the barcode data; additional barcodes can be passed, using the same parameter BarcodeData in a separate BarcodeOption set.
  • BarcodeX= - ???
  • BarcodeY=  - These are both integer values to determine the x-and-y coordinate position on a page to place the barcode(s). A 8.5 X 11 page is 1700 X 2200 pixels. (We recommend placing the barcode 50 pixels or more from the edge of the page.)
  • BarcodePage=  - Is an integer value used to determine what page(s) to place the barcode(s) on.
  • BarcodeScale=  - Is preset to size 3 but can be passed as an additional parameter to change the sizing of the barcode. The sizes available are 3, 4, 5, 6, 7, 8, 9, 20, 30, and 40.

Code Sample:

Example Barcode Parameters for API

In this example, we pass two barcodes on the same page: 

"&BarcodeOption=" + "BarcodeData=", HttpUtility.UrlEncode(barcode1) + ";" + "BarcodeX=", HttpUtility.UrlEncode(barcode1x) + ";" + "BarcodeY=", HttpUtility.UrlEncode(barcode1y) + ";" + "BarcodePage=", HttpUtility.UrlEncode(barcodepage) + ";" + "BarcodeScale=", HttpUtility.UrlEncode(barcodescale),                "&BarcodeOption=" + "BarcodeData=", HttpUtility.UrlEncode(barcode2) + ";" + "BarcodeX=", HttpUtility.UrlEncode(barcode2x) + ";" + "BarcodeY=", HttpUtility.UrlEncode(barcode2y) + ";" + "BarcodePage=", HttpUtility.UrlEncode(barcodepage) + ";" + "BarcodeScale=", HttpUtility.UrlEncode(barcodescale),

Sample Encoded URL with Barcode Parameters


Use Case Example

Two faxes are sent to two physicians at the same office: One regards patient Joseph Curry; the other,  patient R.L. The front-desk person at the physicians’ office returns both documents in the same fax and mixes up the pages as shown below.

However, when the outbound fax has completed then, assuming callbacks are enabled, Sfax can:

  • Send you data associated with the account, including callback data to let you know a fax has arrived into your account. 
  • And, if there is barcode data, you can use the FaxId, along with an InboundFaxInfo request to retrieve the barcode data—and/or you may also use the DownloadInbounFaxasPdf or DownloadInboundFaxasTif to download the fax. (For the example shown above, the barcode data is being presented as: patient name l patient ID l document ID l page 1l total number of pages l recipient l recipient fax number.)
  • Because a patient ID, document ID, and page numbers are included in in the barcode of each document page, it will indicate how the document should be ordered; and you can also confirm that you received all pages.


  • Placement of the barcodes: You should test with your specific documents to find the best placement for the bar code(s). The larger the bar code, the more success in reading it when it comes back in.
  • Size: Due to the nature of faxing, there tends to be quite a bit of degradation, especially when documents are printed, scanned, and faxed multiple times. However, we see more success in using size BarcodeScale=5 or higher.

How to Prepare Out-Going Faxes

Sent Fax #1: Plan of Care Document (SendFax Request, with Barcode Options and Cover Page)

&RecipientName=Dr. Bob
&BarcodeOption=BarcodeX=1500;BarcodeY=1500;BarcodeScale=5;BarcodePage=1;BarcodeData=Curry,Joseph|1465148|13345|1|1|Dr. Bob|855443600
&OptionalParams=CoverPageName=default;CoverPageFromName=Hospital Care;CoverPageFromPhone=1-888-555-1111;CoverPageSubject=Plan Of Care for Curry,Joseph;CoverPageReference=1465148 a file attachment. This is what the fax will look like when it goes out (including the Fax cover page).

Sent Fax #2: Visit Note

SendFax Request (with Barcode Options and Cover Page)

&RecipientName=Dr. Brown
&BarcodeOption=BarcodeX=1500;BarcodeY=2000;BarcodeScale=5;BarcodePage=1;BarcodeData=R.,L.|1564885|13346|1|3|Dr. Brown|855443600
&BarcodeOption=BarcodeX=1500;BarcodeY=2000;BarcodeScale=5;BarcodePage=2;BarcodeData=R.,L.|1564885|13346|2|3|Dr. Brown|855443600
&BarcodeOption=BarcodeX=1500;BarcodeY=2000;BarcodeScale=5;BarcodePage=3;BarcodeData=R.,L.|1564885|13346|3|3|Dr. Brown|855443600
&OptionalParams=CoverPageName=default;CoverPageFromName=Hospital Care;CoverPageFromPhone=1-888-555-1111;CoverPageSubject=Visit Notes for R.,L.;CoverPageReference=1564885 a file attachment. This is what this fax will look like when it goes out:

What Fax Info Looks Like When It Comes In

If you have fax callbacks configured, this is the info you'll get:

Inbound Fax Callback data
Inbound Fax Callback data

You can tell that this fax has barcode data associated with it, because &hasbarcodedata=1.  You can then come back to us and get the info associated with this fax (which includes barcode data), using this service method:

InboundFaxInfo Response

<FaxDateUtc>10/21/2015 9:28:24 PM</FaxDateUtc>
<BarcodeData>R.,L.|1564885|13346|1|3|Dr. Brown|855443600</BarcodeData>
<BarcodeData>Curry,Joseph|1465148|13345|1|1|Dr. Bob|855443600</BarcodeData>
<BarcodeData>R.,L.|1564885|13346|2|3|Dr. Brown|855443600</BarcodeData>
<BarcodeData>R.,L.|1564885|13346|3|3|Dr. Brown|855443600</BarcodeData>

If you would rather poll us than configure the fax callbacks, you can use the ReceiveInboundFax method call in the  Service Methods Documentation.  If you would then like to download the fax, you can use one of the Download Service methods listed in the  Service Methods Documentation. If you would like help with your proof of concept, please give us a call at  877-493-1015 and select Sales.