pixi Developer & Integration Documentation

pixiCreateInvoice

Description

Creates an invoice for a specified box. The procedure validates the box contents, existing invoice status, and any shipping or customer locks before triggering invoice creation. On success, returns the new invoice ID and invoice number. On failure, returns a descriptive error message.


Request Parameters

#

Name

Type

Required

Example

Description

1

BoxNr

int

1

123

The box number to create an invoice for.

2

LocId

varchar(3)

1

001

The location ID where the box is located.

3

UserName

varchar(50)

0

API

The user name to record for the invoice creation action. Defaults to API if not provided.


Request body

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dem="https://api.pixi.eu/soap/demosandbox/">
<soapenv:Header/>
<soapenv:Body>
<dem:pipiCreateInvoice>
<dem:BoxNr>123</dem:BoxNr>
<dem:LocId>001</dem:LocId>
<dem:UserName>API</dem:UserName>
</dem:pipiCreateInvoice>
</soapenv:Body>
</soapenv:Envelope>


Response


Body 1: Result set

#

Name

Type

Description

1

InvoiceId

int

Internal invoice identifier assigned by pixi. NULL on failure.

2

InvoiceNr

varchar(20)

Invoice number assigned by pixi. NULL on failure.

3

Status

varchar(50)

Result of the invoice creation. SUCCESS on success; Error on validation failure.

4

Message

varchar(200)

Empty on success. Contains a descriptive error message on failure.


Additional Notes

The procedure performs the following validations before creating the invoice:
1. BoxNr and LocId must not be NULL.
2. The box must exist at the specified location.
3. The box must contain at least one item.
4. An invoice must not already exist for the box.
5. No shipping lock (ASlocked) may be set on the shipping address of any order in the box.
6. No shipping lock (SLocked) may be set on the customer associated with the box.

Status values:
SUCCESS — invoice created successfully
Error — one of the above validations failed; see Message for details

On success, InvoiceId and InvoiceNr contain the newly created invoice details.
On failure, InvoiceId and InvoiceNr are NULL.