Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once the document is processed, the document extractions become available for retrieval. See Document Extractions for Payment for more details.

Code Block
languagejson
//extractions can be retrieved by performing a GET request with the extractions URI:

    GET /documents/{id}/extractions

...

Find the information about the response format in the Document Extractions section.

Name

Type

Description

extractions

object

Labels to extractions mapping (specific-extractions).

candidates

object

A mapping of labels to a list of extraction-candidates.

...

Code Block
languagejson
//example response

{
   "extractions": {
       "amountToPay": {
           "box": {
               "height": 9.0,
               "left": 516.0,
               "page": 1,
               "top": 588.0,
               "width": 42.0
           },
           "entity": "amount",
           "value": "24.99:EUR",
           "candidates": "amounts"
       }
     },
     "candidates": {
       "amounts": [
         {
             "box": {
                 "height": 9.0,
                 "left": 516.0,
                 "page": 1,
                 "top": 588.0,
                 "width": 42.0
             },
             "entity": "amount",
             "value": "24.99:EUR"
         },
         {
             "box": {
                 "height": 9.0,
                 "left": 241.0,
                 "page": 1,
                 "top": 588.0,
                 "width": 42.0
             },
             "entity": "amount",
             "value": "21.0:EUR"
         }
       ]
       ...
   }
}

//example response with Return Assistant specific extractions

{
    "extractions": {
        "amountToPay": {
            "box": {
                "height": 9,
                "left": 516,
                "page": 1,
                "top": 588,
                "width": 42
            },
            "entity": "amount",
            "value": "24.99:EUR",
            "candidates": "amounts"
        },
        "amountsAreConsistent": {
            "entity": "text",
            "value": "true"
        },
        "shipment-addon": {
            "entity": "amount",
            "value": "5.00:EUR"
        },
        "discount-addon": {
            "entity": "amount",
            "value": "-5.00:EUR"
        },
        "giftcard-addon": {
            "entity": "amount",
            "value": "1.00:EUR"
        },
        "other-discounts-addon": {
            "entity": "amount",
            "value": "-1.00:EUR"
        },
        "other-charges-addon": {
            "entity": "amount",
            "value": "1.00:EUR"
        }
    },
    "compoundExtractions": {
        "lineItems": [
            {
                "artNumber": {
                    "value": "10101",
                    "entity": "text",
                    "box": {
                        "height": 7,
                        "left": 55,
                        "page": 1,
                        "top": 546,
                        "width": 100
                    }
                },
                "quantity": {
                    "value": "12",
                    "entity": "numeric"
                }
            },
            {
                "artNumber": {
                    "value": "10103",
                    "entity": "text"
                },
                "quantity": {
                    "value": "3",
                    "entity": "numeric"
                }
            }
            ...
        ]
    },
    "returnReasons": [ ... ],
    "candidates": {
        "amounts": [ ... ]
    }
}

//example response with Skonto specific extractions

{
	"extractions": {},  
	"candidates": {},   
	"compoundExtractions": { 
		"skontoDiscounts": 
			{
				"skontoDueDate": {
					"entity": "date", 
					"value": "2024-06-01",   
					"box": {		
			            "top": 1.0,   
			            "left": 1.0,   
			            "width": 28.9,   
			            "height": 32.0,   
			            "page": 1   
					}
				}, 
				"skontoDuePeriod": {
					"entity": "timeperiod", 
					"value": "2:week",   
					"box": {}	   
				}, 
				"skontoPercentageDiscounted": {
					"entity": "numeric",
					"value": "5.0",
					"box": {}  
				}, 
				"skontoAmountDiscounted": {
					"entity": "amount", 
					"value": "5.00:EUR",
					"box": {}
				}, 
				"skontoPercentageToPay": {
					"entity": "text", 
					"value": "5%",
					"box": {}
				}, 
				"skontoAmountToPay": {
					"entity": "amount", 
					"value": "100.00:EUR",
					"box": {}
				}
			} 
	}
}