POST
/
Import
/
ocrDocumentJson
/
{typeResult}
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

requestToken
string
header
required

Most endpoints require an organization token. Some endpoints require an application token, and those endpoints are noted.

Path Parameters

typeResult
string
required

The type of object to create in Payabli. Accepted values are bill and invoice.

Example:

"bill"

Body

Contains details about a file. See See fileObject Object Model for a complete reference.

ftype
enum<string> | null

The MIME type of the image file (if content is provided).

Available options:
pdf,
jpg,
jpeg,
png,
gif
Example:

"pdf"

filename
string | null

The name of the attached file.

Example:

"my-doc.pdf"

furl
string | null

Optional url provided to show or download the file remotely.

Example:

"https://mysite.com/my-doc.pdf"

fContent
string | null

Content of file, Base64-encoded. Ignored if furl is specified.

Example:

"TXkgdGVzdCBmaWxlHJ==..."

Response

200 - application/json

Success

isSuccess
boolean

Boolean indicating whether the operation was successful. A true value indicates success. A false value indicates failure.

Example:

true

responseText
string | null

Response text for operation: 'Success' or 'Declined'.

Example:

"Success"

responseCode
integer | null

Code for the response. Learn more in API Response Codes.

Example:

1

responseData
object | null

Object containing the response data.

pageIdentifier
string | null

Auxiliary validation used internally by payment pages and components.

Example:

null

Was this page helpful?