Create customer
          Last updated: 30-Sep-2025
        
        
    Rate this article:
    
    
  
        Overview
Use the createCustomer method to add the details of a customer entity into the 2Checkout system. By default, customer status is Inactive until you assign a specific subscription to the customer. Following that action, customer status reflects the status of the attached subscription(s).
Parameters
| Parameters | Type/Description | 
|---|---|
| sessionID | Required (string) | 
| Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes. | |
| Customer | Object | 
Response
| Parameters | Type/Description | 
|---|---|
| AvangateCustomerReference | Int | 
| System-generated customer reference. | 
Request
<?php
require ('PATH_TO_AUTH');
$newCustomer = new stdClass();
$newCustomer->AvangateCustomerReference = null;
$newCustomer->ExternalCustomerReference = 'ThisIsATestReference123456';
$newCustomer->FirstName = 'NewCustomer';
$newCustomer->LastName = 'NewCustomerLastName';
$newCustomer->Company = null;
$newCustomer->FiscalCode = null;
$newCustomer->Address1 = 'Address';
$newCustomer->Address2 = null;
$newCustomer->City = 'LA';
$newCustomer->Zip = '90210';
$newCustomer->CountryCode = 'us';
$newCustomer->Phone = null;
$newCustomer->Fax = null;
$newCustomer->Email = 'newcustomer@email.com';
$newCustomer->ExistingCards = null;
$newCustomer->Enabled = null;
$newCustomer->Trial = null;
// New Credit object (optional)
$newCustomer->Credit = new stdClass();
$newCustomer->Credit->Limit = 51.0;       // float
$newCustomer->Credit->Remaining = 21.0;   // float
$newCustomer->Credit->Currency = 'EUR';   // string
$newCustomer->CustomerReference = '321';
try {
    $newCustomerInfo = $client->createCustomer($sessionID, $newCustomer);
} catch (SoapFault $e) {
    echo "newCustomerInfo: " . $e->getMessage();
    exit;
}
var_dump("newCustomerInfo", $newCustomerInfo);
    Rate this article: