YellowCube Create Customer Order (WAB)

For each customer order, the distance seller will send a purchase order to YellowCube. For all ordered articles, a corresponding article must be submitted to the master data and physically transferred to the warehouse.

In addition, the available stock (YAFS stock) must be sufficient. Otherwise, the order is rejected. The distance seller receives a goods issue confirmation (WAR) from YellowCube whenever a WAB is issued.

An order contains the following information:

Parameter formats
For a comprehensive documentation of parameters and formats, please consult the YellowCube SOAP Interface manual.

Order Header

The OrderHeader is mandatory and contains identifiers for the depositor and the customer order.

$order = new Order();
$order->setOrderHeader(new OrderHeader(
    '0000040730',   // DepositorNo
    \uniqid('yc'),  // CustomerOrderNo
    date('Ymd')     // CustomerOrderDate

Partner Address

$partner = new Partner();
    ->setPartnerReference('LiiP AG')
    ->setName1('We Name')
    ->setName2('c/o Cailler')
    ->setPOBox('po box')


Order Position

The PosNo is a incrementing integer like 10, 20, 30.

$position = new Position();
    ->setShortDescription('loral Pasty Daisie');


Additional Services

For a complete list of additional services, please consult the YellowCube Interface Manual.

    ->addValueAddedService(new AdditionalShippingServices())
    ->addValueAddedService(new BasicShippingServices(BasicShippingServices::ECO))
    ->addValueAddedService(new DeliveryInstructions('ZAW3219;ZAW3222'))
    ->addValueAddedService(new DeliveryLocation('Last house in the street.'))
    ->addValueAddedService(new DeliveryPeriodeCode(DeliveryPeriodeCode::MORNING))
    ->addValueAddedService(new DeliveryTimeFrom('13:00'))
    ->addValueAddedService(new DeliveryTimeTo('15:00'))
    ->addValueAddedService(new DeliveryTimeJIT('14:00'))
    ->addValueAddedService(new DeliveryDate(date('Ymd', strtotime('+4 days'))))
    ->addValueAddedService(new CODAmount('150.00')) // COD amount in CHF (Cash on 153.45 Delivery).
    ->addValueAddedService(new CODAccountNo('010683242'))
    ->addValueAddedService(new CODRefNo('897201301070000097673'))
    ->addValueAddedService(new FrightShippingFlag('1')) // Yes, fright consignment (small consignments).
    ->addValueAddedService(new FloorNo('3'))
    ->addValueAddedService(new NotificationType(NotificationType::EMAIL))
    ->addValueAddedService(new NotificationServiceCode('2'));

Order Documents

You can add documents to your order by using the addOrderDocument() method. It is advised to use the Doc::fromFile() factory method which reads the provided file and base64-encodes it.

$exampleDocument = YellowCube\WAB\Doc::fromFile(
    'LS',  // DocType
    'pdf', // DocMimeType
    '../../../../../order/example-file.pdf' // FilePath


To create a customer order, create an Order object and pass it to YellowCube\Service::createYCCustomerOrder($order).

$service = new YellowCube\Service(Config::testConfig());
$response = $service->createYCCustomerOrder($order);

echo "Successfully created order with reference {$response->getReference()}" . PHP_EOL . PHP_EOL;


When running this code a GEN_Response is returned.

Successfully created order with reference 14286

YellowCube\GEN_Response Object
    [EventTimestamp:protected] => 2015-04-14T09:30:02Z
    [MessageType:protected] => WAB
    [StatusCode:protected] => 10
    [StatusType:protected] => S
    [StatusText:protected] => File received
    [Reference:protected] => 14286
    [Reference1:protected] => 
    [Reference2:protected] => 
    [Reference3:protected] => 
    [Reference4:protected] => 

The reference can be used to receive a customer order status.