Anlegen von Bestellungen

Anlegen von Bestellungen

Die REST-API erlaubt das direkte Anlegen einer Bestellung über die PRINT LOUNGE. Eine Bestellung kann beliebig viele Bestellpositionen enthalten. Auch umfangreiche Nutzer-, Adress- und Zusatzinformationen können direkt mitgegeben werden.

Endpunkt zur Ausführung von Personalisierungsvorgängen

POST /api/order

Parameterübersicht

Bestellebene

Parameter

Typ

Beschreibung

Parameter

Typ

Beschreibung

description

string

Beschreibung oder Titel der Bestellung

externalOrderCode

string

Externe Referenznummer (z. B. aus eigenem System)

individualOrderCode

string

Individuelle Kennzeichnung, z. B. Projektcode

orderInfo

array

Liste zusätzlicher Schlüssel-Wert-Infos (siehe unten)

orderLanguage

string

Sprachkennung (z. B. de, en)

orderNumber

string

Fortlaufende Bestellnummer (wird automatisch vergeben)

orderStatus

int

Interner Statuscode für Produktionsfortschritt

priceTransactionFee

int

Transaktionsgebühr (in Cent, optional)

remark

string

Freitext / Bemerkung zur Bestellung

shipping

object

Versandinformationen (optional)

shopUser

object

Benutzerinformationen (siehe unten)

Wird in der API-Anfrage keine ID übertragen, dafür aber ein Benutzername und eine E-Mail-Adresse wird automatisch ein neuer Benutzer angelegt oder ein passender Benutzer mit der hinterlegten E-Mail-Adresse verwendet.

status

int

Bestellstatus (1 = aktiv etc.)

statusPaid

int

Zahlungsstatus

usedBudget

int

Verwendetes Budget (optional)

vatId

string

Umsatzsteuer-ID (optional)

Lieferadresse (deliverAddress)

Parameter

Typ

Beschreibung

Parameter

Typ

Beschreibung

company1

string

Firmenzeile 1

company2

string

Firmenzeile 2

country

string

Länderkürzel (z. B. DE)

countryCode

string

ISO-Code (optional)

department

string

Abteilung

email

string

E-Mail-Adresse

fax

string

Faxnummer

firstName

string

Vorname

lastName

string

Nachname

name

string

Name gesamt (wenn firstName/lastName nicht genutzt werden)

street

string

Straße + Hausnummer

telephone

string

Telefonnummer

title

string

Anrede oder Titel

town

string

Ort

zip

string

Postleitzahl

(Gleiches gilt für invoiceAddress)

Bestellpositionen (items[])

Parameter

Typ

Beschreibung

Parameter

Typ

Beschreibung

article.id

int

Artikel-ID

article.sapNumber

string

Artikelnummer

orderCartInfo[]

array

Array aus { name: string, value: string }

personalizationData

object

Personalisierungsdaten, z. B. { "email": "..." }

quantity

int

Menge der Position

status

string

Status der Position (z. B. OK)

title

string

Titel / Name der Position

total

int

Gesamtpreis in Cent

Dieser Betrag wird automatisch anhand der übertragenen Menge berechnet. Wird eine ungültige Menge übergeben, gibt die API eine Fehlermeldung zurück.

type

int

Typ der Position (1 = regulär etc.)

Zusatzinfos zur Bestellung (orderInfo[])

Parameter

Typ

Beschreibung

Parameter

Typ

Beschreibung

name

string

Bezeichnung

data

mixed

Beliebige Daten (z. B. JSON, Text)

Beispiel-Request

Bei der Anlage einer Bestellposition kann zur Ermittlung des Artikels entweder die ID (article.id), oder aber die Artikelnummer (article.sapNumber) angegeben werden (ab Release 8.20.x verfügbar).

{ "externalOrderCode": "API-XXX-1", "orderLanguage": "de", "remark": "Test-API-Bestellung", "shopUser": { "userName": "ApiTestUser", "group": { "id": 294329 }, "address": { "email": "apitest@example.dev", "companyData": { "main": "Testfirma GmbH" } } }, "deliverAddress": { "company1": "Testfirma GmbH", "firstName": "Max", "lastName": "Mustermann", "street": "Musterstraße 1", "zip": "12345", "town": "Musterstadt", "country": "DE", "email": "lieferung@example.dev" }, "items": [ { "title": "Flyer A5", "article": { "id": 178730, "sapNumber": "EXAMPLE-ARTICLE" }, "quantity": 500, "total": 12400, "type": 1, "status": "OK", "personalizationData": { "email": "personalisierung@example.dev" }, "orderCartInfo": [ { "name": "Kampagne", "value": "Sommer2025" } ] } ], "status": 1 }

Rückgabe / Response

Das Response-Objekt enthält die vollständige Bestellung, , den HTTP-Statuscode sowie eventuell aufgetretene Fehler. Im Erfolgsfall wird der Statuscode 200 mit leeren Error-Angaben zurückgegeben, im Fehlerfall werden die Fehler möglichst detailliert aufgeführt.

{ "order": { "id": 923857, "shop": { "id": 1234, "client": { "id": 2011, "masterId": null }, "name": "development", "company": "Example Company™", "address": { "companyData": null, "name": null, "street": "Infinity Loop 42", "city": "Exampleton", "postalCode": "47877", "country": null, "countryCode": "DE", "email": "support@lead-print.com", "phone": null, "mobile": null, "fax": null, "web": null }, "priceIncludesVat": false, "saveCartPermanently": true, "templateDirectory": "printbridge", "cssDirectory": "_1234", "status": 1, "emailSenderAddress": null }, "shopUser": { "id": 1, "shop": { "id": 1234, "client": { "id": 2011, "masterId": null }, "name": "development", "company": null, "address": null, "priceIncludesVat": null, "saveCartPermanently": null, "templateDirectory": null, "cssDirectory": null, "status": null, "emailSenderAddress": null }, "userName": "testuser", "firstName": "Max", "lastName": "Muster", "roleLevel": 59, "group": { "id": 294329, "shop": { "id": 1234, "client": { "id": 2011, "masterId": null }, "name": "development", "company": null, "address": null, "priceIncludesVat": null, "saveCartPermanently": null, "templateDirectory": null, "cssDirectory": null, "status": null, "emailSenderAddress": null }, "name": "", "customerNumber": null, "status": null, "prefilledInvoiceAddress": null, "hideArticlePrices": false }, "address": { "companyData": { "main": "Random Company", "second": "", "third": "" }, "name": { "first": "Max", "last": "Muster", "long": "Max Mustermann", "title": "" }, "street": "", "city": "Willich", "postalCode": "47877", "country": "Deutschland", "countryCode": "DE", "email": "", "phone": "", "mobile": "", "fax": "", "web": "" }, "invoiceAddress": { "companyData": { "main": "", "second": "", "third": "" }, "name": { "first": null, "last": null, "long": "", "title": null }, "street": "", "city": "", "postalCode": "", "country": "", "countryCode": null, "email": null, "phone": "", "mobile": null, "fax": null, "web": null }, "customFields": { "1": "Testbild2Wert", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "" }, "status": "OK", "customerNumber": "DEMOCSTMNMBR", "lastLogin": { "date": "2025-01-09 11:15:10.000000", "timezone_type": 3, "timezone": "Europe/Berlin" }, "lastPasswordChangeDate": null, "showEvaluation": false, "costCenter": "", "jobTitle": null, "infomailEnabled": false, "infomailRecipient": "" }, "orderCode": "XVQURW", "orderDate": null, "externalOrderCode": "API-XXX-1", "individualOrderCode": null, "orderNumber": 714, "invoiceNumber": "", "description": null, "total": null, "totalWithoutVat": null, "totalWithVat": null, "priceTransactionFee": null, "vat": null, "deliverAddress": { "company1": "Testcompany", "company2": null, "company3": null, "name": null, "firstName": null, "lastName": null, "title": null, "street": null, "zip": null, "town": null, "country": null, "countryCode": null, "email": null, "department": null, "telephone": null, "fax": null }, "invoiceAddress": null, "payment": null, "status": 1, "orderStatus": 61, "statusPaid": null, "mdate": null, "cdate": { "date": "2025-09-18 10:47:27.969138", "timezone_type": 3, "timezone": "Europe/Berlin" }, "uploadPath": null, "shipping": null, "usedBudget": null, "vatId": null, "settings": null, "orderInfo": [ { "id": 0, "shop": null, "name": "createdByApi", "data": "{\"remote_address\":\"\",\"timestamp\":1758185247}", "order": null, "modifyDate": null }, { "id": 0, "shop": null, "name": "createdByApi", "data": 1, "order": null, "modifyDate": null } ], "orderLanguage": null, "remark": "1-test@api", "md5": "" }, "orderItems": [], "shop": { "id": 1234, "client": { "id": 2011, "masterId": null }, "name": "development", "company": null, "address": null, "priceIncludesVat": null, "saveCartPermanently": null, "templateDirectory": null, "cssDirectory": null, "status": null, "emailSenderAddress": null }, "errors": [], "httpStatus": 200 }