API Basics
Pay In Endpoints
- MoneyIn
- Subscription
- TokenStorage
- Invoice
- LineItem
- PaymentLink
- PaymentMethodDomain
- HostedPaymentPages
- Cloud
- Wallet: Apple Pay
Pay Out Endpoints
- MoneyOut
- Bill
Pay Ops Endpoints
- Templates
- Boarding
- Chargebacks and ACH Returns
- Entities
- Notification
- Query
- Statistic
- Export
- Import
Object Models
- Object Model References
OCR a Base64-encoded String
Use Payabli’s optical character recognition (OCR) engine on a base64-encoded file. You can use the response data to create a new bill or invoice.
curl --request POST \
--url https://api-sandbox.payabli.com/api/Import/ocrDocumentJson/{typeResult} \
--header 'Content-Type: application/json' \
--header 'requestToken: <api-key>' \
--data '{
"ftype": "png",
"filename": "invoice.png",
"furl": null,
"fContent": "iVBORw0KGgoAAAANSUhEUgAAAu4AAAQlCAMAAADePLi1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZ...I="
}'
{
"isSuccess": true,
"responseText": "Success",
"responseCode": 1,
"responseData": {
"resultData": {
"billNumber": "6654477",
"netAmount": 3000.21,
"billDate": "2024-02-01T00:00:00",
"dueDate": "2024-02-29T00:00:00",
"comments": null,
"billItems": [
{
"itemTotalAmount": 3000,
"itemTaxAmount": 0,
"itemTaxRate": 0,
"itemProductCode": null,
"itemProductName": "Paper Airplane Stock",
"itemDescription": "",
"itemCommodityCode": null,
"itemUnitOfMeasure": null,
"itemCost": 3,
"itemQty": 1000,
"itemMode": null,
"itemCategories": []
}
],
"mode": 0,
"accountingField1": null,
"accountingField2": "VBGEB-46280",
"additionalData": {
"category": "Job Supplies",
"currency_code": "USD",
"type": "invoice",
"reference_number": "VBGEB-46280"
},
"vendor": {
"vendorNumber": null,
"name1": "Paul's Paper Supply",
"name2": "Paul's Paper Supply Company",
"ein": null,
"phone": "970-222-2121",
"email": null,
"address1": "123 North 1st St",
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"mcc": null,
"locationCode": null,
"contacts": null,
"billingData": {
"id": 0,
"bankName": "",
"routingAccount": "",
"accountNumber": "",
"typeAccount": "",
"bankAccountHolderName": "",
"bankAccountHolderType": "Business",
"bankAccountFunction": 0
},
"paymentMethod": null,
"vendorStatus": 1,
"remitAddress1": null,
"remitAddress2": null,
"remitCity": null,
"remitState": null,
"remitZip": null,
"remitCountry": null,
"payeeName1": null,
"payeeName2": null,
"customerVendorAccount": null,
"internalReferenceId": null,
"customField1": null,
"customField2": null,
"additionalData": {
"web": "www.paulspaper.com"
}
}
},
"endDate": null,
"frequency": null,
"terms": null,
"status": 0,
"lotNumber": null,
"attachments": [
{
"ftype": "pdf",
"filename": "paulsPaper_sample Invoice.pdf",
"fileDescriptor": null,
"furl": null,
"fContent": "JVBERi0xLjcNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBl..."
}
]
}
}
Learn how to use our OCR engine to scrape documents and create : Use the OCR Engine
Authorizations
Most endpoints require an organization
token. Some endpoints require an application
token, and those endpoints are noted.
Path Parameters
The type of object to create in Payabli. Accepted values are bill
and invoice
.
"bill"
Body
Contains details about a file. See See fileObject Object Model for a complete reference.
The MIME type of the image file (if content is provided).
pdf
, jpg
, jpeg
, png
, gif
"pdf"
The name of the attached file.
"my-doc.pdf"
Optional url provided to show or download the file remotely.
"https://mysite.com/my-doc.pdf"
Content of file, Base64-encoded. Ignored if furl is specified.
"TXkgdGVzdCBmaWxlHJ==..."
Response
Success
Boolean indicating whether the operation was successful. A true
value indicates success. A false
value indicates failure.
true
Response text for operation: 'Success' or 'Declined'.
"Success"
Code for the response. Learn more in API Response Codes.
1
Object containing the response data.
Key-value pairs created from the document's OCR results.
Returned with all resultType
values.
User-provided unique identifier for the customer. This is typically the customer ID from your own system.
250
"3456-7645A"
Customer username for customer portal
"myusername"
Customer password for customer portal
"mypassword"
Customer Status. Possible values:
-99
Deleted0
Inactive1
Active85
Locked (typically due to multiple failed login attempts)
1
Company name
"Sunshine LLC"
Customer first name
"John"
Customer last name
"Smith"
Customer phone number
"1234567890"
Customer email address.
320
"example@email.com"
Customer address
"777 Main St"
Additional customer address
"Apt 6"
Customer city
"Miami"
Customer State
"FL"
Customer zip code
"33000"
Customer country in ISO-3166-1 alpha 2 format
See https://en.wikipedia.org/wiki/ISO_3166-1 for reference.
"US"
The shipping address.
250
"123 Walnut St"
Additional line for shipping address.
100
"STE 900"
Shipping city.
250
"Johnson City"
Shipping state or province.
"TN"
Shipping ZIP code.
50
"37619"
Shipping address country.
"US"
Customer balance.
988.44
Timezone, in UTC offset. For example, -5 is Eastern time.
-5
Additional Custom fields in format "key":"value".
List of fields acting as customer identifiers, to be used instead of CustomerNumber.
["email"]
Timestamp of when record was created, in UTC.
"2022-07-01 15:00:01"
Returned when resultType
= invoice
.
Object describing the customer/payor. Required for POST requests. Which fields are required depends on the paypoint's custom identifier settings. See PayorData Object Model for a complete reference.
The Payabli-generated unique ID for the customer.
4440
Customer/Payor first name.
250
"John"
Customer/Payor last name.
250
"Doe"
Customer's company name.
250
"Sunshine LLC"
User-provided unique identifier for the customer. This is typically the customer ID from your own system.
250
"3456-7645A"
Customer's billing address.
250
"123 Walnut Street"
Additional line for Customer's billing address.
100
"STE 900"
Customer's billing city.
250
"Johnson City"
Customer's billing state. Must be 2-letter state code for address in US.
250
"Johnson City"
Customer's billing ZIP code.
50
"37615"
Customer's billing country.
100
"US"
Customer's phone number.
50
"5555555555"
Customer's email address.
320
"example@email.com"
The shipping address.
250
"123 Walnut St"
Additional line for shipping address.
100
"STE 900"
Shipping city.
250
"Johnson City"
Shipping state or province.
"TN"
Shipping ZIP code.
50
"37619"
Shipping address country.
100
"US"
Custom dictionary of key:value pairs. You can use this field to store any data related to the object or for your system. If you are using custom identifiers, pass those in this object. Example usage:
{
"additionalData": {
"CustomIdentifier": "value",
"key2": "value2",
"key3": "value3"
}
}
{
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
List of fields acting as customer identifiers, to be used instead of CustomerNumber.
["email"]
Object describing the invoice. Required for POST requests.
Invoice number. Identifies the invoice under a paypoint.
250
"INV-2345"
Invoice date in any of the accepted formats: YYYY-MM-DD, MM/DD/YYYY.
"2024-07-01"
Invoice due date in one of the accepted formats: YYYY-MM-DD, MM/DD/YYYY.
"2024-07-01"
Type of invoice. Only 0
for one-time invoices is currently supported.
0
Indicate the date to finish a scheduled invoice cycle (`invoiceType`` = 1) in any of the accepted formats: YYYY-MM-DD, MM/DD/YYYY.
"2024-07-01"
Status for invoice.
The accepted status values are:
- 0 draft
- 1 active
- 2 partially paid
- 4 paid/complete
- 99 cancelled
0
, 1
, 2
, 4
, 99
1
Frequency of scheduled invoice.
one-time
, weekly
, every2weeks
, every6months
, monthly
, every3months
, annually
"monthly"
Payment terms for invoice. If no terms are defined, then reponse data for this field defaults to N30
.
PIA
, CIA
, UR
, NET10
, NET20
, NET30
, NET45
, NET60
, NET90
, EOM
, MFI
, 5MFI
, 10MFI
, 15MFI
, 20MFI
, 2/10NET30
, UF
, 10UF
, 20UF
, 25UF
, 50UF
"PIA"
Custom terms and conditions included in the invoice.
"Must be paid before work scheduled."
Notes included in the invoice.
"Example notes."
Tax rate in percent applied to the invoice.
2.05
Discount applied to the invoice.
10
Invoice total amount.
105
Freight/shipping amount.
10
Duty amount.
0
Purchase order number.
"PO-345"
First name of the recipient of the invoice.
"Chad"
Last name of the recipient of the invoice.
"Mercia"
Company name of the recipient of the invoice.
"ACME, INC"
The shipping address.
250
"123 Walnut St"
Additional line for shipping address.
100
"STE 900"
Shipping city.
250
"Johnson City"
Shipping state or province.
"TN"
Shipping ZIP code.
50
"37619"
Shipping address country.
"US"
Shipping recipient's contact email address.
320
"example@email.com"
Recipient phone number.
"5555555555"
Sender shipping ZIP code.
"30040"
Commodity code.
"501718"
Array of line items included in the invoice.
Array of fileContent
objects with attached documents. Max upload size is 30 MB.
Custom dictionary of key:value pairs. You can use this field to store any data related to the object or for your system. Example usage:
{
"additionalData": {
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
}
{
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
Object with options for scheduled invoices.
Flag to indicate if the scheduled invoice would include a paymentlink
Flag to indicate if the scheduled invoice would include a PDF version of invoice
Returned when resultType
= bill
"7463"
Returned when resultType
= bill
543.09
Returned when resultType
= bill
"2025-10-19T00:00:00"
Returned when resultType
= bill
"2023-03-26T00:00:00"
Returned when resultType
= bill
250
"Deposit for materials"
Returned when resultType
= bill
Item or product name. Max length of 250 characters.
250
"Materials deposit"
Item or product price per unit.
5
Quantity of item or product.
1
Item or product code. Max length of 250 characters.
250
"M-DEPOSIT"
Item or product description. Max length of 250 characters.
250
"Deposit for materials."
Item or product commodity code. Max length of 250 characters.
250
"010"
Unit of measurement. Max length of 100 characters.
100
"SqFt"
Internal class of item or product: value '0' is only for invoices , '1' for bills and, '2' common for both.
0
, 1
, 2
0
Array of tags classifying item or product.
Total amount in item or product.
Tax amount applied to item or product.
7
Tax rate applied to item or product.
0.075
Returned when resultType
= bill
0
Returned when resultType
= bill
"MyInternalId"
Returned when resultType
= bill
"MyInternalId"
"Repairs & Maintenance"
"USD"
"Your invoice"
"invoice"
Returned when resultType
= bill
"VBDAG-13395"
Returned when resultType
= bill
"2023-03-26T00:00:00"
Returned when resultType
= bill
"monthly"
Returned when resultType
= bill
"NET30"
Returned when resultType
= bill
0
Returned when resultType
= bill
"VT-3291"
The raw data from the OCR operation.
Order of element or section in container.
x >= 0
Auxiliary validation used internally by payment pages and components.
null
Was this page helpful?
curl --request POST \
--url https://api-sandbox.payabli.com/api/Import/ocrDocumentJson/{typeResult} \
--header 'Content-Type: application/json' \
--header 'requestToken: <api-key>' \
--data '{
"ftype": "png",
"filename": "invoice.png",
"furl": null,
"fContent": "iVBORw0KGgoAAAANSUhEUgAAAu4AAAQlCAMAAADePLi1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZ...I="
}'
{
"isSuccess": true,
"responseText": "Success",
"responseCode": 1,
"responseData": {
"resultData": {
"billNumber": "6654477",
"netAmount": 3000.21,
"billDate": "2024-02-01T00:00:00",
"dueDate": "2024-02-29T00:00:00",
"comments": null,
"billItems": [
{
"itemTotalAmount": 3000,
"itemTaxAmount": 0,
"itemTaxRate": 0,
"itemProductCode": null,
"itemProductName": "Paper Airplane Stock",
"itemDescription": "",
"itemCommodityCode": null,
"itemUnitOfMeasure": null,
"itemCost": 3,
"itemQty": 1000,
"itemMode": null,
"itemCategories": []
}
],
"mode": 0,
"accountingField1": null,
"accountingField2": "VBGEB-46280",
"additionalData": {
"category": "Job Supplies",
"currency_code": "USD",
"type": "invoice",
"reference_number": "VBGEB-46280"
},
"vendor": {
"vendorNumber": null,
"name1": "Paul's Paper Supply",
"name2": "Paul's Paper Supply Company",
"ein": null,
"phone": "970-222-2121",
"email": null,
"address1": "123 North 1st St",
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"mcc": null,
"locationCode": null,
"contacts": null,
"billingData": {
"id": 0,
"bankName": "",
"routingAccount": "",
"accountNumber": "",
"typeAccount": "",
"bankAccountHolderName": "",
"bankAccountHolderType": "Business",
"bankAccountFunction": 0
},
"paymentMethod": null,
"vendorStatus": 1,
"remitAddress1": null,
"remitAddress2": null,
"remitCity": null,
"remitState": null,
"remitZip": null,
"remitCountry": null,
"payeeName1": null,
"payeeName2": null,
"customerVendorAccount": null,
"internalReferenceId": null,
"customField1": null,
"customField2": null,
"additionalData": {
"web": "www.paulspaper.com"
}
}
},
"endDate": null,
"frequency": null,
"terms": null,
"status": 0,
"lotNumber": null,
"attachments": [
{
"ftype": "pdf",
"filename": "paulsPaper_sample Invoice.pdf",
"fileDescriptor": null,
"furl": null,
"fContent": "JVBERi0xLjcNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBl..."
}
]
}
}