Document upload

You can use the API-Endpoint POST Document/Uploads.

There are two possible ways to upload a file.

Note: The maximum file size is  500.000 bytes.

The common way is to upload the file via multipart message. For more details about this please visit https://en.wikipedia.org/wiki/MIME#Multipart_messages.

Upload Via Multipart Message

Example Request
POST /api/v2/Document/Uploads HTTP/1.1
Host: connect-testing.secupay-ag.de
Accept: application/json
Accept-Charset: utf-8
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
 
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="Ident_1213.pdf"
Content-Type: application/pdf
 
 
------WebKitFormBoundary7MA4YWxkTrZu0gW-
Example Response
{
"object": "document.uploads",
"id": "DUP_XYZ",
"created": "2018-08-01T08:00:30+02:00",
"type": "application/pdf",
"name": "Invoice_123456",
"size": 61617
}

Response parameters:

Parameter

Meaning

object

always document.uploads

id

ID of uploaded file; needed for subsequent API requests

created

date time of upload

type

MIME type of content; text documents shall always use application/pdf

name

file name of the uploaded file as specified in the request header Content-Disposition

size

file size in Bytes

Upload Via JSON

The parameter content is the Base64 encoded file. (S. https://en.wikipedia.org/wiki/Base64.)

Example Request
POST /api/v2/Document/Uploads HTTP/1.1
Host: connect-testing.secupay-ag.de
Accept: application/json
Content-Type: application/json
Accept-Charset: utf-8
 
{
"content": "YmFzZTY0X2VuY29kZWRfcGRm"
}
Example Response
{
"object": "document.uploads",
"id": "DUP_XYZ",
"created": "2018-07-31T15:08:52+02:00"
}

Response parameters:

Parameter

Meaning

object

always document.uploads

id

ID of uploaded file; needed for subsequent API requests

created

date time of upload

Submit Invoice Documents 

Endpoint: POST /Payment/SecupayInvoices/assignExternalInvoicePdf/abcdefg123456/ DUP_900B357K5Y4DU5WN95XMZS85X6US43

The Method AssignExternalInvoicePdf  is used to submit invoice documents.

The Payment ID (hash) of the original transaction is required.

Example Response
{
"document": {
"id": "DUF_8Z092GGNK60KD94JPZFKYDS6C67X4C",
"mime_type": "image/png; charset=binary",
"name": "Invoice_123456.pdf",
"size": 55774,
"url": "https://api.testing.secupay-ag.de/ds_g/22842f43028d4927993e956f0cc31f0c"
}
}