Versions Compared

Key

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

...

Gini supports PDF files, GIF files (non-animated), PNG files, JPEG files, TIFF files as well as plain text formats (including parsed QR codes). You can use native documents (PDF only) and scanned documents (all other supported formats).

...

The above applies both to single-page documents as well as and to each page in multi-page multipage documents.

...

Document uploading schemes

...

Partial upload should be performed in two steps: partial document upload and composite document upload. Complete

Note

Please complete Step 1

...

before moving to Step 2!

Step 1 (upload each page as a partial document)

Pages that are part of the document are referred to as partial documents. If you want to upload a page (or a page picture) that belongs to the document, your request header should additionally include Content-Type field with application/vnd.gini.v1.partial+png value or application/vnd.gini.v1.partial+pdf in case of PDF page. In case you want to submit a parsed QR code, please use application/vnd.gini.v1.partial+qr+json. The parsing of the QR field is optional. The paymentdata needs to contain the iban and paymentRecipient keys, but the values can be empty.

Request

In order to upload a page picture or a partial document, specify a different content type:

...

Code Block
languagejson
//upload a partial document

//variant for web applications running in a web browser with access token:

curl -H 'Authorization: BEARER <token>'
    --form 'file=@file.JPEG'
    -H 'Accept: application/vnd.gini.v1+json'
    -H 'Content-Type: application/vnd.gini.v1.partial+png'
    -i https://pay-api.gini.net/documents
    
//variant for other types of applications with access token:

curl -H 'Authorization: BEARER <token>'
    --data-binary '@file.JPEG'
    -H 'Accept: application/vnd.gini.v1+json'
    -H 'Content-Type: application/vnd.gini.v1.partial+png'
    -i https://pay-api.gini.net/documents?filename=file.JPEG

//or with X-User-identifier (see how to setup X-User-identifier):

curl -H 'X-User-Identifier: user1'
    --form 'file=@file.JPEG'
    -H 'Accept: application/vnd.gini.v1+json'
    -H 'Content-Type: application/vnd.gini.v1.partial+png'
    -u 'client-id:client-secret'
    -i https://pay-api.gini.net/documents
    
// variant for QR code 
curl -H 'Authorization: BEARER <token>'
    --form 'data.json={
        "qrcode": "bank://singlepaymentsepa?name=Gini%20Online%20Shop&reason=A12345-6789&iban=DE89370400440532013000&bic=GINIBICXXX&amount=47%2C65&currency=EUR",
          "paymentdata": {
            "amountToPay": "25.79:EUR",
            "paymentRecipient": "Telekom GmbH",
            "iban": "<IBAN>",
            "bic": "<BIC>",
            "paymentReference": "<REFERENCE>"
          }
      }'
    -H 'Accept: application/vnd.gini.v1+json'
    -H 'Content-Type: application/vnd.gini.v1.partial+png'
    -i https://pay-api.gini.net/documents

Step 2 (upload JSON as a composite document)

...

Code Block
//upload a composite document

//variant for web applications running in a web browser with access token:

curl -H 'Authorization: BEARER <token>'
    -H 'Accept: application/vnd.gini.v1+json'
    -H 'Content-Type: application/vnd.gini.v1.composite+json'
    -X POST -d'{...}'
    -i https://pay-api.gini.net/documents
//or

curl -H 'Authorization: BEARER <token>'
    --data-binary '@data.json'
    -H 'Accept: application/vnd.gini.v1+json'
    -H 'Content-Type: application/vnd.gini.v1.composite+json'
    -i https://pay-api.gini.net/documents
//or with X-User-identifier (see how to setup X-User-identifier):

curl -H 'X-User-Identifier: user1'
    -H 'Accept: application/vnd.gini.v1+json'
    -H 'Content-Type: application/vnd.gini.v1.composite+json'
    -u 'client-id:client-secret'
    -X POST - d'{...}'
    -i https://pay-api.gini.net/documents
    
//with post body of

{
  "partialDocuments": [
    {
      "rotationDelta": 0,
      "document": "localtion of parital doc 1"
    },
    {
      "rotationDelta": 0,
      "document": "location of partial doc 2"
    },
    ...
  ]
}

//location in form of https://pay-api.gini.net/documents/e8606210-56ed-11ea-b823-b351b84ae4b3