# Orders

This is an object representing a customer's order. Every order has a cart comprised of one or more ordered products that determine the amount of the order to be charged. Those products may be printable tickets, physical goods or donations.

# The order object

# Attributes

  • id integer - Globally unique identifier for the object
  • number string - Order number, unique for client
  • organization string - Company/organization name
  • first_name string - First name
  • middle_name string - Optional middle name
  • last_name string - Last name
  • email string - Email address
  • phone string - Phone number
  • address1 string - Street address
  • address2 string - Optional second line of address
  • city string - City
  • region string - State/Region/Province (two character ISO 3166-2 (opens new window) code) expandable
  • country string - Country (two character ISO 3166-1 alpha-2 (opens new window) code) expandable
  • sub_total integer - A positive integer representing the sub-total of the order in the smallest currency unit (opens new window) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99)
  • product_fees integer - A positive integer representing the product/ticket fees for the order in the smallest currency unit (opens new window)
  • merchant_fees integer - A positive integer representing the merchant fees for the order in the smallest currency unit (opens new window)
  • fee_total integer - A positive integer equal to the sum of all fees for the order in the smallest currency unit (opens new window)
  • discount_total integer - A positive integer representing the discounted amount for the order in the smallest currency unit (opens new window) if a coupon was applied
  • grand_total integer - A positive integer representing the final amount charged for the order in the smallest currency unit (opens new window)
  • token string - Globally unique identifier for the order (UUID)
  • referred_by string - How did the user hear about the event
  • transaction_id string - Unique identifier from merchant for the order's payment
  • customer_id string - Unique identifier from merchant for the order's customer
  • status integer - Status code for the order
  • status_name string - Status name for the order
  • ordered_products array - Contents of the order's cart on a per-product basis expandable
  • uploads array - Uploaded files attached to the order, if any expandable
  • coupon integer | object - Coupon applied to the order, if any expandable
  • currency integer | object - Currency of the order's payment expandable
  • client integer | object - ID of the client that this order belongs to expandable
  • event integer | object - ID of the event that this order belongs to expandable
  • created_at integer - Unix timestamp at which the order was first created
  • updated_at integer - Unix timestamp at which the order was last updated
  • completed_at integer - Unix timestamp at which the order was completed
  • shipped_at integer - Unix timestamp at which the order was shipped
  • cancelled_at integer - Unix timestamp at which the order was cancelled
  • refunded_at integer - Unix timestamp at which the order was refunded

# Statuses

  1. Incomplete - Cart has been created but payment has not yet been made
  2. Complete - Order is complete and payment has been processed
  3. Shipped - Order has been shipped
  4. Cancelled - Order has been cancelled and tickets are unredeemable
  5. Refunded - Order has been cancelled, tickets are unredeemable and a full refund has been issued

# Example object

{
    "id": 23917,
    "number": "ABCD-EVT3-175",
    "first_name": "Joe",
    "middle_name": null,
    "last_name": "Event",
    "email": "joe@event.com",
    "phone": "(555) 555-5555",
    "address1": "1400 Lincoln Ave",
    "address2": "#7",
    "city": "Los Angeles",
    "postal_code": "90013",
    "region": "CA",
    "country": "US",
    "sub_total": 5000,
    "product_fees": 350,
    "merchant_fees": 186,
    "fee_total": 536,
    "discount_total": 300,
    "grand_total": 5236,
    "token": "e5e4de0e-5082-4b53-8f54-833084e01a70",
    "referred_by": "Facebook",
    "transaction_id": "pi_1Dor642eZvKYlo2C96OeaLE5",
    "customer_id": "cus_Jpjiu3VIaWAoTr",
    "status": 1,
    "status_name": "Complete",
    "ordered_products": [
        {
            "id": 482350,
            "name": "GA Ticket",
            "price": 1000,
            "product_fees": 75,
            "merchant_fees": 33,
            "fee_total": 108,
            "discount_total": 0,
            "quantity": 2,
            "amount": 2000,
            "order": 23917,
            "product": 41941,
            "coupon": null,
            "created_at": 1626043169,
            "updated_at": 1626043169,
        },
        {
            "id": 482352,
            "name": "VIP Ticket",
            "price": 3000,
            "product_fees": 200,
            "merchant_fees": 96,
            "fee_total": 296,
            "discount_total": 300,
            "quantity": 1,
            "amount": 3000,
            "order": 23917,
            "product": 41942,
            "coupon": 5123,
            "created_at": 1626043169,
            "updated_at": 1626043169,
        }
    ],
    "uploads": [],
    "coupon": 5123,
    "currency": 1,
    "client": 735,
    "event": 9614,
    "created_at": 1626043169,
    "updated_at": 1626018869,
    "completed_at": 1626018869,
    "shipped_at": null,
    "cancelled_at": null,
    "refunded_at": null,
}

# Retrieve an order

Retrieves the details of an existing order by the unique order identifier.

# Parameters

none

# Returns

Returns an order if a valid identifier was provided, and returns an error otherwise.

# Example request

# GET /v1/orders/23917

curl https://api.ee4.events/v1/orders/23917 \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc:

# Example response

{
    "id": 23917,
    "number": "ABCD-EVT3-175",
    "first_name": "Joe",
    "middle_name": null,
    "last_name": "Event",
    "email": "joe@event.com",
    "phone": "(555) 555-5555",
    "address1": "1400 Lincoln Ave",
    "address2": "#7",
    "city": "Los Angeles",
    "postal_code": "90013",
    "region": "CA",
    "country": "US",
    "sub_total": 5000,
    "product_fees": 350,
    "merchant_fees": 186,
    "fee_total": 536,
    "discount_total": 300,
    "grand_total": 5236,
    "token": "e5e4de0e-5082-4b53-8f54-833084e01a70",
    "referred_by": "Facebook",
    "transaction_id": "pi_1Dor642eZvKYlo2C96OeaLE5",
    "customer_id": "cus_Jpjiu3VIaWAoTr",
    "status": 1,
    "status_name": "Complete",
    "ordered_products": [
        {
            "id": 482350,
            "name": "GA Ticket",
            "price": 1000,
            "product_fees": 75,
            "merchant_fees": 33,
            "fee_total": 108,
            "discount_total": 0,
            "quantity": 2,
            "amount": 2000,
            "order": 23917,
            "product": 41941,
            "coupon": null,
            "created_at": 1626043169,
            "updated_at": 1626043169,
        },
        {
            "id": 482352,
            "name": "VIP Ticket",
            "price": 3000,
            "product_fees": 200,
            "merchant_fees": 96,
            "fee_total": 296,
            "discount_total": 300,
            "quantity": 1,
            "amount": 3000,
            "order": 23917,
            "product": 41942,
            "coupon": 5123,
            "created_at": 1626043169,
            "updated_at": 1626043169,
        }
    ],
    "uploads": [],
    "coupon": 5123,
    "currency": 1,
    "client": 735,
    "event": 9614,
    "created_at": 1626043169,
    "updated_at": 1626018869,
    "completed_at": 1626018869,
    "shipped_at": null,
    "cancelled_at": null,
    "refunded_at": null,
}

# Create an order

Create a new order. After the order is created, update the order with user-supplied information and any cart changes. When payment is ready to be processed, complete the order.

# Parameters

  • products array required - Cart contents where the array key is the product ID and the value is the quantity
  • currency string | integer - Currency of the order, defaults to USD (1) if ommitted
  • client_id integer required - ID of the client that this order belongs to
  • event_id integer - ID of the event that this order belongs to, defaults to the next upcoming event if ommitted

# Returns

Returns an order if creation was successful, and returns an error otherwise.

# Example request

# POST /v1/orders

curl https://api.ee4.events/v1/orders \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d client_id=735 \
  -d event_id=9614 \
  -d currency=usd \
  -d "products[41941]"=2
  -d "products[41942]"=1

# Example response

{
    "id": 23917,
    "number": "ABCD-EVT3-175",
    "sub_total": 5000,
    "product_fees": 350,
    "merchant_fees": 186,
    "fee_total": 536,
    "discount_total": 300,
    "grand_total": 5236,
    "token": "e5e4de0e-5082-4b53-8f54-833084e01a70",
    "customer_id": "cus_Jpjiu3VIaWAoTr",
    "status": 0,
    "status_name": "Incomplete",
    "ordered_products": [
        {
            "id": 482350,
            "name": "GA Ticket",
            "price": 1000,
            "product_fees": 75,
            "merchant_fees": 33,
            "fee_total": 108,
            "discount_total": 0,
            "quantity": 2,
            "amount": 2000,
            "order": 23917,
            "product": 41941,
            "coupon": null,
            "created_at": 1626043169,
            "updated_at": 1626043169,
        },
        {
            "id": 482352,
            "name": "VIP Ticket",
            "price": 3000,
            "product_fees": 200,
            "merchant_fees": 96,
            "fee_total": 296,
            "discount_total": 300,
            "quantity": 1,
            "amount": 3000,
            "order": 23917,
            "product": 41942,
            "coupon": 5123,
            "created_at": 1626043169,
            "updated_at": 1626043169,
        }
    ],
    "uploads": [],
    "coupon": null,
    "currency": 1,
    "client": 735,
    "event": 9614,
    "created_at": 1626043169,
    "updated_at": null,
    "completed_at": null,
    "shipped_at": null,
    "cancelled_at": null,
    "refunded_at": null,
}

# Update an order

Updates order properties/cart contents without completing. When payment is ready to be processed, complete the order.

# Parameters

  • organization string - Company/organization name
  • first_name string - First name
  • middle_name string - Optional middle name
  • last_name string - Last name
  • email string - Email address
  • phone string - Phone number
  • address1 string - Street address
  • address2 string - Optional second line of address
  • city string - City
  • region string - State/Region/Province (two character ISO 3166-2 (opens new window) code) expandable
  • country string - Country (two character ISO 3166-1 alpha-2 (opens new window) code) expandable
  • referred_by string - How did the user hear about the event
  • products array required - Cart contents where the array key is the product ID and the value is the quantity
  • currency string | integer - Currency of the order, defaults to USD (1) if ommitted
  • client_id integer required - ID of the client that this order belongs to
  • event_id integer - ID of the event that this order belongs to, defaults to the next upcoming event if ommitted

# Returns

Returns the order.

# Example request

# POST /v1/orders/23917

curl https://api.ee4.events/v1/orders/23917 \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d first_name="Joe" \
  -d last_name="Event" \
  -d email="joe@event.com" \
  -d phone="(555) 555-5555" \
  -d "products[41941]"=2
  -d "products[41942]"=0

# Example response

{
    "id": 23917,
    "number": "ABCD-EVT3-175",
    "sub_total": 2000,
    "product_fees": 150,
    "merchant_fees": 66,
    "fee_total": 216,
    "discount_total": 0,
    "grand_total": 2216,
    "token": "e5e4de0e-5082-4b53-8f54-833084e01a70",
    "customer_id": "cus_Jpjiu3VIaWAoTr",
    "status": 0,
    "status_name": "Incomplete",
    "ordered_products": [
        {
            "id": 482350,
            "name": "GA Ticket",
            "price": 1000,
            "product_fees": 75,
            "merchant_fees": 33,
            "fee_total": 108,
            "discount_total": 0,
            "quantity": 2,
            "amount": 2000,
            "order": 23917,
            "product": 41941,
            "coupon": null,
            "created_at": 1626043169,
            "updated_at": 1626043169,
        }
    ],
    "uploads": [],
    "coupon": null,
    "currency": 1,
    "client": 735,
    "event": 9614,
    "created_at": 1626043169,
    "updated_at": 1626043800,
    "completed_at": null,
    "shipped_at": null,
    "cancelled_at": null,
    "refunded_at": null,
}

# Delete an order

Permanently deletes an order. It cannot be undone. Also immediately deletes all of the products in the order's cart.

If the refund attribute is set and the order status is not incomplete, a refund will be processed for the amount of the order.

# Parameters

  • refund boolean - Refund the payment if one has been made

# Returns

Returns an object with a deleted parameter on success. If the order ID does not exist, this call returns an error.

Unlike other objects, deleted orders can still be retrieved through the API, in order to be able to track the history of customers while still removing their credit card details and preventing any further operations to be performed.

# Example request

# DELETE /v1/orders/23917

curl https://api.ee4.events/v1/orders/23917 \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d refund=0 \
  -X DELETE

# Example response

{
    "id": 23917,
    "object": "order",
    "refund": null,
    "refunded_at": null,
    "deleted": true
}

# List all orders

Returns a list of orders created. The orders are returned in sorted order, with the most recent orders appearing first.

# Parameters

  • limit integer optional - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
  • customer_id string optional - Only return orders for the customer specified by this customer ID.
  • created_at string optional - A filter on the list based on the object created_at field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with the following options:
    • created_at.gt string optional - Return results where the created_at field is greater than this value.
    • created_at.gte string optional - Return results where the created_at field is greater than or equal to this value.
    • created_at.lt string optional - Return results where the created_at field is less than this value.
    • created_at.lte string optional - Return results where the created_at field is less than or equal to this value.
  • ending_before string optional - A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.
  • starting_after string optional - A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.
  • customer_id string optional - Only return orders for the customer specified by this customer ID.
  • event_id integer optional - Only return orders belonging to the specified event.

# Returns

A dictionary with a data property that contains an array of up to limit orders, starting after order starting_after. Each entry in the array is a separate order object. If no more orders are available, the resulting array will be empty. If you provide a non-existent order ID, this call returns an error.

# Example request

# GET /v1/orders

curl https://api.ee4.events/v1/orders \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d limit=3 \
  -G

# Example response

{
    "object": "list",
    "url": "/v1/orders",
    "has_more": false,
    "data": [
        {
            "id": 23917,
            "number": "ABCD-EVT3-175",
            "first_name": "Joe",
            "middle_name": null,
            "last_name": "Event",
            "email": "joe@event.com",
            "phone": "(555) 555-5555",
            "address1": "1400 Lincoln Ave",
            "address2": "#7",
            "city": "Los Angeles",
            "postal_code": "90013",
            "region": "CA",
            "country": "US",
            "sub_total": 5000,
            "product_fees": 350,
            "merchant_fees": 186,
            "fee_total": 536,
            "discount_total": 300,
            "grand_total": 5236,
            "token": "e5e4de0e-5082-4b53-8f54-833084e01a70",
            "referred_by": "Facebook",
            "transaction_id": "pi_1Dor642eZvKYlo2C96OeaLE5",
            "customer_id": "cus_Jpjiu3VIaWAoTr",
            "status": 1,
            "status_name": "Complete",
            "ordered_products": [
                {
                    "id": 482350,
                    "name": "GA Ticket",
                    "price": 1000,
                    "product_fees": 75,
                    "merchant_fees": 33,
                    "fee_total": 108,
                    "discount_total": 0,
                    "quantity": 2,
                    "amount": 2000,
                    "order": 23917,
                    "product": 41941,
                    "coupon": null,
                    "created_at": 1626043169,
                    "updated_at": 1626043169,
                },
                {
                    "id": 482352,
                    "name": "VIP Ticket",
                    "price": 3000,
                    "product_fees": 200,
                    "merchant_fees": 96,
                    "fee_total": 296,
                    "discount_total": 300,
                    "quantity": 1,
                    "amount": 3000,
                    "order": 23917,
                    "product": 41942,
                    "coupon": 5123,
                    "created_at": 1626043169,
                    "updated_at": 1626043169,
                }
            ],
            "uploads": [],
            "coupon": 5123,
            "currency": 1,
            "client": 735,
            "event": 9614,
            "created_at": 1626043169,
            "updated_at": 1626018869,
            "completed_at": 1626018869,
            "shipped_at": null,
            "cancelled_at": null,
            "refunded_at": null,
        },
        {...},
        {...}
    ]
}