You are here

public function MailchimpEcommerce::addOrder in Mailchimp 8

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

Add a new order to a store.

Parameters

string $store_id: The ID of the store.

string $id: A unique identifier for the order.

array $customer: Associative array of customer information.

  • id (string): A unique identifier for the customer.

array $order: Associative array of order information.

  • currency_code (string): The three-letter ISO 4217 currency code.
  • order_total (float): The total for the order.
  • lines (array): An array of the order's line items.

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

Return value

object The API order response object.

See also

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

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

File

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

Class

MailchimpEcommerce
Mailchimp Ecommerce library.

Namespace

Mailchimp

Code

public function addOrder($store_id, $id, array $customer, array $order, $batch = FALSE) {
  $tokens = [
    'store_id' => $store_id,
  ];
  $parameters = [
    'id' => $id,
    'customer' => (object) $customer,
  ];
  $parameters += $order;
  return $this
    ->request('POST', '/ecommerce/stores/{store_id}/orders', $tokens, $parameters, $batch);
}