Skip to content

API reference

Push an SAP IDoc as a SOAP message

Other routes API

POST/v1/sap/idoc

Takes an INVOIC02 that SAP pushes over HTTP as a SOAP message, and answers with a SOAP message.

This is a transport and nothing more. The IDoc inside the envelope is read by the one mapping your organisation froze for it, as a mapped-file conversion reads it. The invoice is validated and filed for good, and the answer says so in a form a SOAP client can read.

The workspace’s processing plan decides first: it must include conversion and keep results durably, and each invoice filed here counts one document against its quota. A plan that refuses, or a full quota, is a soap:Client fault and nothing is filed.

The invoice is filed as outbound: an IDoc read through your mapping is your own invoice data. ?direction=out may be stated. ?direction=in is refused with a soap:Client fault, and nothing is filed.

Point an SAP XML HTTP port at this URL with the SOAP protocol switched on. Send the SOAP envelope as the request body with an API key in Authorization. One IDoc per message.

The answer is always a SOAP envelope:

  • 200 with an INVOIC02Response body entry: the invoice was taken. It carries the IdocAssign row SAP’s port expects, with TransferId and DbId.
  • 500 with a Fault body entry: nothing was validated and nothing was filed. The faultstring says why, and soap:Client or soap:Server says whose end it is. SOAP 1.1 requires the 500 status for a fault, so a refusal here is a 500 where a JSON route would answer 4xx.
  • 401 with a JSON error body: no usable credential. This refusal happens before any SOAP is read.

TransferId identifies this exchange. DbId is the id the invoice was filed under, and it is empty when nothing was filed: that is the honest answer, and an id is never made up to fill it. Read GET /v1/invoices/{id} with that id for the verdict and the whole report. The reply carries no verdict itself, because SAP’s shape has no field for one.

SAP sends a message again when it did not see the answer. The same message again is answered with the invoice the first one filed, and nothing is filed twice: the message’s own bytes are its key when no Idempotency-Key is sent. A fault is not kept, so a message that was refused may be sent again once its cause is fixed.

Query parameters

  • directionstring

    Optional. The IDoc is filed as outbound whether this is omitted or out. in is refused with a soap:Client fault, because an IDoc read through your mapping is your own invoice data.

    One of out.

Headers

  • Idempotency-Keystring

    The same key and body again is answered with the first answer, and nothing is done twice. The same key with another body is 409 idempotency_key_reused; while the first is still being done, 409 request_in_progress. A key over 255 characters is 400 invalid_idempotency_key. Without a key, every request is done.

Request body

The SOAP envelope SAP sends, with the IDoc as the single entry in its Body. SOAP 1.1 and SOAP 1.2 envelopes are both read.

text/xml, required: string

Status codes

Status Meaning
200 The invoice was taken. A SOAP envelope whose Body holds INVOIC02Response.
401 No usable credential was sent (invalid_credentials). Nothing was read.
500 Nothing was validated and nothing was filed. A SOAP envelope whose Body holds a Fault. The reasons are the ones a mapped-file conversion gives for the same file, the processing plan’s refusals (no plan, conversion not included, temporary retention, a full document quota), and the ones only this door can give: the body is not a SOAP message, the Body carries a Fault rather than an IDoc, or the message carries no IDoc at all.
POST/v1/sap/idoc
Example
curl -X POST https://api.certinvo.com/v1/sap/idoc \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: text/xml" \
  --data-binary @body.txt
import { readFile } from 'node:fs/promises'

const response = await fetch(`https://api.certinvo.com/v1/sap/idoc`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
    'Content-Type': 'text/xml',
  },
  body: await readFile('body.txt'),
})
console.log(response.status, await response.json())
import os

import requests

response = requests.post(
    "https://api.certinvo.com/v1/sap/idoc",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "text/xml"},
    data=open("body.txt", "rb"),
)
print(response.status_code, response.text)
200
text/xml
The body is the file itself (text/xml).
Success response
POST
/v1/sap/idoc
Push an SAP IDoc as a SOAP message
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Headers2
›Query Parameters1
›Bodytext/xml
›Code Snippet
curl -X POST "https://api.certinvo.com/v1/sap/idoc" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close