/v1/sap/idocTakes 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
INVOIC02Responsebody entry: the invoice was taken. It carries theIdocAssignrow SAP’s port expects, withTransferIdandDbId. - 500 with a
Faultbody entry: nothing was validated and nothing was filed. Thefaultstringsays why, andsoap:Clientorsoap:Serversays 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.inis refused with asoap:Clientfault, because an IDoc read through your mapping is your own invoice data.One ofout.
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, 409request_in_progress. A key over 255 characters is 400invalid_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. |
/v1/sap/idoccurl -X POST https://api.certinvo.com/v1/sap/idoc \
-H "Authorization: Bearer $CERTINVO_API_KEY" \
-H "Content-Type: text/xml" \
--data-binary @body.txtimport { 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)