code: private function getContactIdentifier(Identity $orderIdentity)
      {
          $order = $this->client->request('GET', 'orders/' . $orderIdentity->getAdapterIdentifier());
  
          $relations = array_filter($order['relations'], function (array $relation) {
              return $relation['referenceType'] === 'contact';
          });
  
          if (empty($relations)) {
              return null;
          }
  
          $contactRelation = array_shift($relations);
  
          return $contactRelation['referenceId'];
      }
docs: @param Identity $orderIdentity
  
  @return null|int