JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr# CustomerApi You can use the APIs below to interface with Xendit's `CustomerApi`. To start using the API, you need to configure the secret key and initiate the client instance. ```php createCustomer($idempotency_key, $for_user_id, $customer_request); print_r($result); } catch (\Xendit\XenditSdkException $e) { echo 'Exception when calling CustomerApi->createCustomer: ', $e->getMessage(), PHP_EOL; echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL; } ``` ## `getCustomer()` Function ```php getCustomer($id, $for_user_id): \Customer\Customer ``` Get Customer By ID Retrieves a single customer object For detail explanations, see this link: https://developers.xendit.co/api-reference/#get-customer | Name | Value | |--------------------|:-------------:| | Function Name | `getCustomer` | | Request Parameters | [GetCustomerRequestParams](#request-parameters--GetCustomerRequestParams) | | Return Type | [**\Xendit\Customer\Customer**](Customer/Customer.md) | ### Request Parameters - GetCustomerRequestParams |Name | Type | Required |Default | |-------------|:-------------:|:-------------:|-------------| | **id** | **string** | ☑️ | | | **for_user_id** | **string** | | | ### Usage Example ```php getCustomer($id, $for_user_id); print_r($result); } catch (\Xendit\XenditSdkException $e) { echo 'Exception when calling CustomerApi->getCustomer: ', $e->getMessage(), PHP_EOL; echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL; } ``` ## `getCustomerByReferenceID()` Function ```php getCustomerByReferenceID($reference_id, $for_user_id): \Customer\GetCustomerByReferenceID200Response ``` GET customers by reference id Retrieves an array with a customer object that matches the provided reference_id - the identifier provided by you For detail explanations, see this link: https://developers.xendit.co/api-reference/#get-customer-by-reference-id | Name | Value | |--------------------|:-------------:| | Function Name | `getCustomerByReferenceID` | | Request Parameters | [GetCustomerByReferenceIDRequestParams](#request-parameters--GetCustomerByReferenceIDRequestParams) | | Return Type | [**\Xendit\Customer\GetCustomerByReferenceID200Response**](Customer/GetCustomerByReferenceID200Response.md) | ### Request Parameters - GetCustomerByReferenceIDRequestParams |Name | Type | Required |Default | |-------------|:-------------:|:-------------:|-------------| | **reference_id** | **string** | ☑️ | | | **for_user_id** | **string** | | | ### Usage Example ```php getCustomerByReferenceID($reference_id, $for_user_id); print_r($result); } catch (\Xendit\XenditSdkException $e) { echo 'Exception when calling CustomerApi->getCustomerByReferenceID: ', $e->getMessage(), PHP_EOL; echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL; } ``` ## `updateCustomer()` Function ```php updateCustomer($id, $for_user_id, $patch_customer): \Customer\Customer ``` Update End Customer Resource Function to update an existing customer. For a detailed explanation For detail explanations, see this link: https://developers.xendit.co/api-reference/#update-customer | Name | Value | |--------------------|:-------------:| | Function Name | `updateCustomer` | | Request Parameters | [UpdateCustomerRequestParams](#request-parameters--UpdateCustomerRequestParams) | | Return Type | [**\Xendit\Customer\Customer**](Customer/Customer.md) | ### Request Parameters - UpdateCustomerRequestParams |Name | Type | Required |Default | |-------------|:-------------:|:-------------:|-------------| | **id** | **string** | ☑️ | | | **for_user_id** | **string** | | | | **patch_customer** | [**PatchCustomer**](Customer/PatchCustomer.md) | | | ### Usage Example ```php updateCustomer($id, $for_user_id, $patch_customer); print_r($result); } catch (\Xendit\XenditSdkException $e) { echo 'Exception when calling CustomerApi->updateCustomer: ', $e->getMessage(), PHP_EOL; echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL; } ``` [[Back to README]](../README.md)