src/test/java/com/squareup/connect/api/CustomersApiTest.java
@Test
    public void createCustomerTest() throws ApiException {
        CreateCustomerRequest body = new CreateCustomerRequest()
            .givenName("Amelia")
            .familyName("Earhart")
            .emailAddress("Amelia.Earhart@example.com")
            .address(new Address()
                .addressLine1("500 Electric Ave")
                .addressLine2("Suite 600")
                .locality("New York")
                .administrativeDistrictLevel1("NY")
                .postalCode("20003")
                .country("US")
            )
            .phoneNumber("1-555-555-0122")
            .referenceId("YOUR_REFERENCE_ID")
            .note("a customer");

        CreateCustomerResponse response = api.createCustomer(body);

        assertTrue(response.getErrors().isEmpty());
        assertNotNull(response.getCustomer().getId());
    }
/**
     * CreateCustomer
     *
     * Creates a new customer for a business, which can have associated cards on file.  You must provide __at least one__ of the following values in your request to this endpoint:  - &#x60;given_name&#x60; - &#x60;family_name&#x60; - &#x60;company_name&#x60; - &#x60;email_address&#x60; - &#x60;phone_number&#x60;  This endpoint does not accept an idempotency key. If you accidentally create a duplicate customer, you can delete it with the [DeleteCustomer](#endpoint-deletecustomer) endpoint.
     *
     * @throws ApiException
     *          if the Api call fails
     */
CreateCustomer
Creates a new customer for a business, which can have associated cards on file.

@throws ApiException
if the Api call fails
CreateCustomer Creates a new customer for a business which can have associated cards on file . @throws ApiException if the Api call fails
@Test
    public void createCustomerTest() throws ApiException {
        CreateCustomerRequest body = new CreateCustomerRequest()
            .givenName("Amelia")
            .familyName("Earhart")
            .emailAddress("Amelia.Earhart@example.com")
            .address(new Address()
                .addressLine1("500 Electric Ave")
                .addressLine2("Suite 600")
                .locality("New York")
                .administrativeDistrictLevel1("NY")
                .postalCode("20003")
                .country("US")
            )
            .phoneNumber("1-555-555-0122")
            .referenceId("YOUR_REFERENCE_ID")
            .note("a customer");
        CreateCustomerResponse response = api.createCustomer(body);
        assertTrue(response.getErrors().isEmpty());
        assertNotNull(response.getCustomer().getId());
    }
@ Test public void createCustomerTest ( ) throws ApiException { CreateCustomerRequest body = new CreateCustomerRequest ( ) . givenName ( "Amelia" ) . familyName ( "Earhart" ) . emailAddress ( "Amelia.Earhart@example.com" ) . address ( new Address ( ) . addressLine1 ( "500 Electric Ave" ) . addressLine2 ( "Suite 600" ) . locality ( "New York" ) . administrativeDistrictLevel1 ( "NY" ) . postalCode ( "20003" ) . country ( "US" ) ) . phoneNumber ( "1-555-555-0122" ) . referenceId ( "YOUR_REFERENCE_ID" ) . note ( "a customer" ) ; CreateCustomerResponse response = api . createCustomer ( body ) ; assertTrue ( response . getErrors ( ) . isEmpty ( ) ) ; assertNotNull ( response . getCustomer ( ) . getId ( ) ) ; }
CreateCustomer
 Creates a new customer for a business, which can have associated cards on file.
CreateCustomer Creates a new customer for a business which can have associated cards on file .