You Can Try This Following Two Method With Related Factory..
public function saveaddress(\Customapi\Api\Data\CustomerInterface $parameters)
{
// echo json_encode($parameters);exit;
// print_r($parameters);
// $postcode = isset($parameters ['postcode'])?$parameters ['postcode']:0;
if ($parameters && $parameters->getData()) {
$data=$parameters->getData();
// echo json_encod($data);exit;
if (!isset($data['email']) || !$data['email']) {
$data = array (
'data' => array (
'customer' => array (
array (
'message' => 'email paremer is missing.',
'status' => 'false'
)
)
)
);
return [$data];
}
if (isset($data['customer_id']) && $data['customer_id'])
$data['customer']= $data['customer_id'];
// echo json_encod($data);exit;
else {
$data = array (
'data' => array (
'customer' => array (
array (
'message' => 'some paremer is missing.',
'status' => 'false'
)
)
)
);
return [$data];
}
$address = $this->account->saveCustomerAddress($data);
// echo json_encod($address);exit;
return [$address];
} else {
$data = array (
'data' => array (
'customer' => array (
array (
'message' => 'some paremer is missing.',
'status' => 'false'
)
)
)
);
return [$data];
}
}
public function savebillingshipping(\Customapi\Api\Data\CheckoutInterface $parameters)
{
$enable = $enable = $this->checkEnable();
if ($enable && $parameters && count($parameters->getData())) {
$deviceObject=$this->checkout->savebillingshiping($parameters->getData());
return array($deviceObject);
} else {
return array(['success' => false]);
}
}