# How to append a customer to a newly created order?

**URL:** <https://forum.shopware.com/t/how-to-append-a-customer-to-a-newly-created-order/90806>\
**Category:** Shopware 6 (English)\
**Created:** [11. Oktober 2021 um 13:34 UTC](https://forum.shopware.com/t/how-to-append-a-customer-to-a-newly-created-order/90806 "2021-10-11T13:34:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![euroxid](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/euroxid/32/15105_2.png) [@euroxid](https://forum.shopware.com/u/euroxid)\
**Post date:** [11. Oktober 2021 um 13:34 UTC](https://forum.shopware.com/t/how-to-append-a-customer-to-a-newly-created-order/90806/1 "2021-10-11T13:34:12Z")

</div>

Based upon TestOrderpersister, this is how I create new orders:

```auto
            $order = new OrderEntity();
            $order->setUniqueIdentifier(md5($someUniqueData));

            $persister = new OrderPersister($this->orderRepository, $this->orderConverter);

            $token = Uuid::randomHex();
            $salesChannelContext = $this->salesChannelContextFactory->create($token, Defaults::SALES_CHANNEL);
            $persister->persist($cart, $salesChannelContext);

```

How can I inject the customer data (name, address…) into the order? It has a SetOrderCustomer method, but no SetCustomer() method. The aforementioned test file depends on injecting the customer data into the SaleschanenlContext, but it does so using a test-specific mock method.
