Orders

Orders endpoints may be used to report customer transactions as they happen. These are used within Poplar for attribution reporting and to enable existing customers to be easily suppressed within your campaigns.

You can monitor this API integration from the Transactions Page of the dashboard. We provide basic diagnostic information and the ability to purge any transactional data stored within your account.

Submit Order

POST https://api.heypoplar.com/v1/order

https://api.heypoplar.com/v1/order

Use this endpoint to report a new transaction or order In addition to the required fields, at least one of the following must be provided: shipping_address, billing_address, customer_email_sha256, or customer_email

Headers

Request Body

{
  "id": "d32f3be1-b376-4802-99cb-6fa1fc529aca",
  "order_id": "9ca6e9ab-9de6-4491-82c3-8730e2aedfbb",
  "currency": "USD",
  "total": "126.0",
  "customer": {
    "id": "27876",
    "email_sha256": "b043f7b1894189c3591ed2514fcf901ec0de715e8c0c981b893e7d3778d318d4"
  },
  "metadata": {
    "firstTimeOrder": "true"
  },
  "order_items": [
    {
      "category": [
        "Grocery",
        "Fruit"
      ],
      "description": "Handcrafted Wooden Pants",
      "identifier": "88fcae48-b6f3-41d5-826d-1f7ec2a108ba",
      "metadata": {
        "productMaterial": "Cotton"
      },
      "price": "0.0",
      "quantity": 1,
      "total": "504.0"
    },
    {
      "category": [
        "Health",
        "Sports",
        "Toys"
      ],
      "description": "Tasty Plastic Bike",
      "identifier": "94820c46-644e-408f-8f61-4e057a148c5e",
      "metadata": {},
      "price": "483.0",
      "quantity": 1,
      "total": "297.0"
    }
  ],
  "shipping_address": {
    "company": null,
    "address_1": "03055 Williamson Gardens",
    "address_2": "Suite 249",
    "city": "South Maritzaville",
    "state_name": "TN",
    "postal_code": "10843"
  },
  "billing_address": {
    "company": null,
    "address_1": "59184 Henri Canyon",
    "address_2": null,
    "city": null,
    "state_name": "",
    "postal_code": "36670-7309"
  },
  "order_date": "2019-09-05T14:06:42Z"
}

Shipping & Billing Address

Shipping and billing address objects should contain the following fields:

Order Items

You may provide order item details with an order. This is optional, however this data is used to add additional dimensions to our reporting.

Metadata

Optional metadata may be provided with Orders and Order Items. This data is used to enhance reporting. For example, you may wish to include a flag which indicates a customer's first time order or segment.

  • The metadata object should consist of key : value pairs.

  • You are permitted up to 10 different keys.

  • Each key should be a string, up to 40 characters in length.

  • Values should string, number or boolean types, limited to a maximum length of 200 characters.

We've pre-defined the following keys for advanced reporting.

If you'd like to have this data in your reports, you must name them exactly as they appear above. For example, if you name the key nb instead of new_buyeryour reports will NOT show the information.

Customers (Orders API)

When you submit transactions to the Orders API we will also automatically create an audience called "Customers (Orders API)" that will include customers of the orders. The audience will contain two records for each order submitted one with the shipping address, and one with the billing address.

This list is useful when you are mailing prospecting campaigns and want to suppress existing customers that have been submitted to the Orders API. (note unless you have submitted all historical orders it will not be a complete customer list) You cannot mail this audience as a one time send.

Delete Order

DELETE https://api.heypoplar.com/v1/order/:order_id

https://api.heypoplar.com/v1/order/:order_id

Deletes the specified order by ID.

Path Parameters

Headers

{
    // Response
}

Edit Order

POST https://api.heypoplar.com/v1/order/:order_id

https://api.heypoplar.com/v1/order/:order_id

Allows updates to be made to the specified order. This method accepts the same parameters as order submission, with the exception of order_id - this cannot be changed.

Path Parameters

Headers

{
    // Response
}

Last updated