You are here

public function MailchimpEcommerce::addCustomer in Mailchimp 8

Same name in this branch
  1. 8 lib/mailchimp-api-php/src/MailchimpEcommerce.php \Mailchimp\MailchimpEcommerce::addCustomer()
  2. 8 lib/mailchimp-api-php/tests/src/MailchimpEcommerce.php \Mailchimp\Tests\MailchimpEcommerce::addCustomer()

Adds a new customer to a store.

Parameters

string $store_id: The ID of the store.

array $customer: An associative array of customer information.

  • id (string) A unique identifier for the customer.
  • email_address (string) The customer's email address.
  • opt_in_status (boolean) The customer's opt-in status. This value will never overwrite the opt-in status of a pre-existing Mailchimp list member, but will apply to list members that are added through the e-commerce API endpoints.

bool $batch: TRUE to create a new pending batch operation.

Return value

object The API customer response object.

See also

http://developer.mailchimp.com/documentation/mailchimp/reference/ecommer...

1 call to MailchimpEcommerce::addCustomer()
MailchimpEcommerce::addCustomer in lib/mailchimp-api-php/tests/src/MailchimpEcommerce.php
@inheritdoc
1 method overrides MailchimpEcommerce::addCustomer()
MailchimpEcommerce::addCustomer in lib/mailchimp-api-php/tests/src/MailchimpEcommerce.php
@inheritdoc

File

lib/mailchimp-api-php/src/MailchimpEcommerce.php, line 467

Class

MailchimpEcommerce
Mailchimp Ecommerce library.

Namespace

Mailchimp

Code

public function addCustomer($store_id, $customer, $batch = FALSE) {
  $tokens = [
    'store_id' => $store_id,
  ];
  return $this
    ->request('POST', '/ecommerce/stores/{store_id}/customers', $tokens, $customer, $batch);
}