@param string $customerId
@param array  $data
@param array  $headers

@throws Exception

@return array|string
426036
public function createSubscriptionEstimate(string $customerId, array $data, array $headers = [])
    {
        $url = $this->url('customers/%s/create_subscription_estimate', $customerId);

        return $this->post($url, $data, $headers);
    }
292319
public function addCouponCodes(string $id, array $data, array $headers = [])
    {
        $url = $this->url('coupon_sets/%s/add_coupon_codes', $id);

        return $this->post($url, $data, $headers);
    }
144589
public function create(array $card, $customerId = null) {
        $expiryMonth    = str_pad($card['expiryMonth'], 2, '0', STR_PAD_LEFT);
        $expiryYear     = $card['expiryYear'];
        $expiresAt      = $this->getExpirationDate($expiryMonth, $expiryYear);
        $ccType         = $this->ccTypeAdapter->getFromGateway($card['paymentMethod']);

        /** @var PaymentTokenInterface $paymentToken */
        $paymentToken = $this->creditCardTokenFactory->create();
        $paymentToken->setExpiresAt($expiresAt);

        if( array_key_exists('id', $card) ) {
            $paymentToken->setGatewayToken($card['id']);
        }

        $tokenDetails = [
            'type'              => $ccType,
            'maskedCC'          => $card['last4'],
            'expirationDate'    => $expiryMonth . '/' . $expiryYear,
        ];

        $paymentToken->setTokenDetails($this->convertDetailsToJSON($tokenDetails));
        $paymentToken->setIsActive(true);
        $paymentToken->setPaymentMethodCode(ConfigProvider::CODE);

        if($customerId) {
            $paymentToken->setCustomerId($customerId);
        }

        $paymentToken->setPublicHash($this->generatePublicHash($paymentToken));

        return $paymentToken;
    }
906465
public static function toListObj($customers_data)
    {
        $customers = array();
        if(!empty($customers_data['customers'][0]['id'])){
            foreach ($customers_data['customers'] as $customer) {
                $customers[] = (object) $customer;
            }
        }
        $return = new StdClass;
        $return->customers = $customers;

        return $return;
    }
615030
public function recordRefund(string $id, array $data, array $headers = [])
    {
        $url = $this->url('invoices/%s/record_refund', $id);

        return $this->post($url, $data, $headers);
    }
271869
public function move(array $data, array $headers = [])
    {
        $url = $this->url('customers/move');

        return $this->post($url, $data, $headers);
    }
177820
public function createForId($customerId, array $options = [], array $filters = [])
    {
        $this->parentId = $customerId;

        return parent::rest_create($options, $filters);
    }
76980
public function get($customerId, $optParams = array()) {
      $params = array('customerId' => $customerId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Customer($data);
      } else {
        return $data;
      }
    }
568213
public function beforeDeleteById(
        \Magento\Customer\Api\CustomerRepositoryInterface $subject,
        $customerId
    ) {
        $this->deleteSnaps($customerId);
        $this->deleteChange($customerId);
        $result = [$customerId];
        return $result;
    }
1250626
public function addChargeAtTermEnd(string $id, array $data, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/add_charge_at_term_end', $id);

        return $this->post($url, $data, $headers);
    }
308581
public function updateCustomerData($customerId, $updateData)
    {
        return $this->getCustomerModel()->getCustomer($customerId)
            ->setUpdateData($updateData)
            ->save();
    }
1201651
public function findAddress($customerId, $addressId)
    {
        $response = $this
            ->createQueryBuilder('c')
            ->select(
                ['c', 'a']
            )
            ->innerJoin('c.addresses', 'a')
            ->where('c.id = :customerId')
            ->andWhere('a.id = :addressId')
            ->setParameter('customerId', $customerId)
            ->setParameter('addressId', $addressId)
            ->setMaxResults(1)
            ->getQuery()
            ->getResult();

        if (!empty($response)) {
            /**
             * @var CustomerInterface $customer
             */
            $customer = reset($response);
            $addresses = $customer->getAddresses();
            if ($addresses) {
                return $addresses->first();
            }
        }

        return false;
    }
1263517
public function void(string $id, array $data, array $headers = [])
    {
        $url = $this->url('invoices/%s/void', $id);

        return $this->post($url, $data, $headers);
    }
1179387
public function updatePaymentMethod(string $id, array $data, array $headers = [])
    {
        $url = $this->url('customers/%s/update_payment_method', $id);

        return $this->post($url, $data, $headers);
    }
1277755
public function overrideBillingProfile(string $id, array $data, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/override_billing_profile', $id);

        return $this->post($url, $data, $headers);
    }
291863
public function retrieveCustomer($customer_id)
    {
        list($response, $statusCode, $httpHeader) = $this->retrieveCustomerWithHttpInfo ($customer_id);
        return $response; 
    }
18291
public function recordPayment(string $id, array $data, array $headers = [])
    {
        $url = $this->url('invoices/%s/record_payment', $id);

        return $this->post($url, $data, $headers);
    }