Order
An order is a customer's completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time s/he provides an email address, billing address and payment information. Orders can also be created manually from the FlickRocket api.
You should note that orders can be created through the API, but no payment information will be collected, and no payment transaction performed.
You should also note that you can change only a few of an order's attributes using the API. For example, you cannot change the items or the quantities in an order.
Authentication for new orders
When a new order is created, it is important that the customer can later access the order. Accessing the order is done via email and password, and so it is very important that the email and the password of the customer is correct. for referencing the customer, there are the following two methods:
Email/Password |
With this method, the email and clear text password of the customer is transmitted to FlickRocket. Flickrocket does not store the password but creates and stores a secure hash derived from the password. For new customers, using this method is the only way to create an order. For existing customers, the order fails if the transmitted password does not match the password hash stored by FlickRocket. Therefore it is required to check for the existance of a customer within FlickRocket before creating initial orders for a customer. |
customer_token |
With this method, a customer is referenced by a customer_token. This customer token is returned when an order is placed or as part of orders and customer objects. Threrefore it can only be stored for subsequent orders of a customer. |
Keeping credentials in sync
To make sure that acustomer can always access his order, it is essential to ensure that the customers email and password data for the application using the API interface and the FlickRocket account data ultimately granting access to the order, is always synced and up to date. Since this needs to work even between multiple shops a true two way synchonization for all email/password changes is required.
Send email/password changes to Flickrocket |
Use the customer object to send updates customer data such as email and password changes. |
Receive email/password changes from Flickrocket |
Configure Flickrocket's Data Change Sync (part of the API app) to send email/password changes of your cosutomers to a certain URL. |
Validate a new customer
Before you can create an initial order for a customer, you need to check if the custoemr already exists in FlickRocket and if the password matches Flickrocket's data. This is done via the customer object.
What can you do with Order?
The FlickRocket API lets you do the following with the Order resource. More detailed versions of these general actions may be available:
GET /api/orders.json?updated_at_min=2005-07-31T15:57:11
Retrieve a list of Orders
GET /api/orders/#{id}.json
Receive a single Order
GET /api/orders/count.json
Receive a count of all Orders
POST /api/orders.json
Create a new Order
PUT /api/orders/#{id}.json
Modify an existing Order
DELETE /api/orders/#{id}.json
Invalidate an Order from the database
Order Properties
browser_ip
|
{"browser_ip": "188.168.1.34"}
The customer's IP address when the order was placed.
|
buyer_accepts_marketing
|
{"buyer_accepts_marketing": true}
Set to true if the user has consigned to accept marketing information.
|
cancelled_at |
{"cancelled_at": null}
GMT date and time when the order was canceled.
|
checkout_id |
{"checkout_id": null}
The checkout ID for the order.
|
checkout_token |
{"checkout_token": "d0aefc55-f63b-4482-bb10-e6caea391749"}
Unique token for the checkout process for this order.
|
closed_at |
{"closed_at": "2016-04-07T16:16:17"}
GMT date and time when the order was closed.
|
confirmed |
{"confirmed": true}
Set to true when the order was confirmed.
|
created_at |
{"created_at": "2016-04-07T16:16:17"}
GMT date and time when to order was placed.
|
currency |
{"currency": "USD"}
Currency under which the order was handled.
|
customer |
"customer":
The customer data for this order
"addresses": []
One or more addresses of the customer.
address1
|
{"address1": "Heinrich-Hertz-Str. 2"}
|
address2 |
{"address2": ""}
|
city |
{"city": "Dortmund"}
|
company |
{"company": ""}
|
country |
{"country": "Germany"}
|
country_name |
{"country_name": "Germany"}
|
country_code |
{"country_code": "DE"}
|
default |
{"default": true}
|
first_name |
{"first_name": "John"}
|
id |
{"id": 159501}
|
last_name |
{"last_name": "Doe"}
|
name |
{"name": "Test"}
|
phone |
{"phone": "0231-12345678"} |
province |
{"province": ""}
|
province_code |
{"province_code": ""}
|
token |
{"token": "TCMJEOTSBEVTDLFU"}
|
zip |
{"zip": "44227"}
|
{"created_at": "2016-04-07T16:12:24"}
GMT date and time when the customer was initially created.
"default_address":
The default address of the user unless a different address was selected.
address1
|
{"address1": "Heinrich-Hertz-Str. 2"}
|
address2 |
{"address2": ""}
|
city |
{"city": "Dortmund"}
|
company |
{"company": ""}
|
country |
{"country": "Germany"}
|
country_name |
{"country_name": "Germany"}
|
country_code |
{"country_code": "DE"}
|
default |
{"default": true}
|
first_name |
{"first_name": "John"}
|
id |
{"id": 159501}
|
last_name |
{"last_name": "Doe"}
|
name |
{"name": "Test"}
|
phone |
{"phone": "0231-12345678"} |
province |
{"province": ""}
|
province_code |
{"province_code": ""}
|
token |
{"token": "TCMJEOTSBEVTDLFU"}
|
zip |
{"zip": "44227"} |
{"email": "sample@someone.com"}
The customers email address. This email address must be used by the customer to log in to the shop and players.
{"first_name": "John"}
The customer's first (given) name.
{id": 159501}
Unique ID for this customer.
{"language": "de"}
Two byte language code.
{"last_name": "Doe"}
The customer's last (family) name.
{"last_order_id": 206897}
The last order_id of the customer.
{"last_order_name": "#206897"}
The name of the last order.
{"note": ""}
Notes about this customer.
{"orders_count": 3}
The number of times the cutomer has ordered.
{"password": null}
The customer's password if customer is not identified via his token.
{"password_confirmation": null}
Same as password (used for confirmation).
{"state": "enabled"}
The status of the order. supported values are "enabled" and "disabled". Read-only.
{"token": "TCMJEOTSBEVTDLFU"}
The customer's token from this order.
{"total_spent": 0.0}
The total amount the customer has spent.
{"updated_at": "2016-04-07T16:12:24"}
GMT date and time of the last update to the customer information.
{"verified_email": false}
Is set to true when the email has been verified.
|
shipping_address |
"shipping_address": {
The shipping address for this order.
{"address1": "Heinrich-Hertz-Str. 2"}
{"address2": ""}
{"city": "Dortmund"}
{"company": ""}
{"country": "Germany"}
{"country_name": "Germany"}
{"country_code": "DE"}
{"default": true}
Is set to true if this is the defauld shipping address
{"first_name": "John"}
{"id": 0}
{"last_name": "Doe"}
{"name": "John Doe"}
{"province_code": ""}
{"province": ""}
{"token": ""}
{"zip": "44227"}
|
device_id |
{"device_id": null}
Device identifier of the device used for the order (if available)
|
discount_codes |
"discount_codes": []
Information about the discoutn codes used for this order (if any)
id |
"id": 578130
Unique ID for this discount code usage.
|
amount |
"amount": 2799 cent
The amount (in cent) represented by this discount code.
|
code |
"code": "MUL-KUH-PTF-CCE-YUS"
The code string used
|
type |
"type": "percentage"
The type of the code used. Possible values are "percentage" and "fixed_amount"
|
|
email |
{"email": "sample@someone.com"}
Identical to customer_email.
|
financial_status |
{"financial_status": "paid"}
The status of the financial transaction. The possible values are: oaid, partially_refunded, refunded
|
fulfillment_status |
{"fulfillment_status": "fulfilled"}
Indicates the fullfillment status. The possible values are: fulfilled / partial / null
Digtal content orders are set to "fulfilled" directly after the completion of the order.
|
fulfillments |
"fulfillments": []
Information about the fulfillment of the order.
{"created_at": "2016-04-14T16:10:36.0568169+02:00"}
GMT date and time the order was fulfilled.
"id": 11500
Unique identifier for this fulfillment
"line_items": [2]
An array of the line items included in this fulfillment.
|
id |
{"id": 206897}
Unique identifier for this order.
|
gateway |
{"gateway": "Manual"}
The payment gateway used for this order. Set to "Manual" if order was entered manually and no payment gateway was used.
|
landing_site |
{"landing_site": null}
The landing page on which the user arrived in the shop before the order (if available)
|
landing_site_ref |
{"landing_site_ref": null}
The site from which the customer reached the landing page (if available)
|
line_items |
"line_items": [{
A list on information about each item in the order.
{"gift_card": false}
Is set to true, if a gift certificate was used for this item.
{"grams": 0.0}
The weight of the order in grams.
{"hd": false"}
The resolution of the prdered video content (if applies)
{"id": 410996}
Unique identification of this line item.
{"license_id": 16}
The license associated to this item order. Applies to digital products only.
{"license_title": "Rental (48 hours)"}
The title of the license associated to this item order. Applies to digital products only.
{"name": "The Adventures of Sherlock Holmes / Rental (48 hours)"}
The name of the this order item.
{"price": 0.0}
The net price of this item.
{"product_exists": true}
Is set to true for existing products and fals for pre-order products.
{"product_id": "0000-2E74-D5D6-3CD7"}
The product_id of this item.
{"quantity": 2}
The quantity of how many of this item is ordered.
{"requires_shipping": false}
Set to true if this item requires physical shipment.
{"sku": ""}
Optional SKU number assigned to this item.
{"taxable": false}
Set to true if this item is taxable
{"title": "The Adventures of Sherlock Holmes"}
The title of the product.
{"total_discount": 0.0}
The total discount applied to item.
|
location_id |
{"location_id": null}
Identifies the physical store if item is sold there.
|
name |
{"name": "#206897"}
Name of the order.
|
order_number |
{"order_number": ""}
The invoice number of this order as shown as reference of the invoice.
|
po_number |
{"po_number": "PO123456"}
The PO number for this order as entered by the customer during the purchase.
|
payment_gateway_names |
{"payment_gateway_names": ["Manual"]}
The name of the payment gateway used for the payment for this order.
|
processed_at |
{"processed_at": "2016-04-07T16:16:17"}
GMT date and time whne the order was processed.
|
referring_site |
{"referring_site": null}
URL of the refferring site (if available).
|
refunds |
"refunds": []
Information about refunded items
"created_at": "2016-03-02T17:13:38"
GMT date and time the item was refunded
"id": 120879
Unique Id referecing this item refund
"note": null
Notes in regards to this item refund
"order_id": 203764
Order ID of the order from which this item refund originated
"refund_line_items": []
id |
"id" : 404815
Unique ID referencing this line item
|
quantity |
"quantity" : 1
Number of items
|
line item |
"line_item" : []
Complete line item information (see line_item for details)
|
"restock": false
Is set to true if the refunded item is automatically restocked in the stock management
"tracking_number": null
The tracking number of the refunded item's shipping (if available)
"transactions": []
Information about the transaction related to this refund.
id |
id": 120879
Unique ID to reference this payment transdaction
|
order_id |
"order_id": 203764
Order ID of the order to which this refund belongs
|
gateway |
"gateway": "TeleCash"
Name of the gateway on which the refund was performed.
|
created_at |
"created_at": "2016-03-02T13:01:53"
GMT date and time the refund transaction was handed over to the payment gateway.
|
test |
"test": false
Is set to true if this is a test transaction which does not have a real monetary effect.
|
status |
"status": "success"
The status of the refund transaction.
|
amount |
"amount": 4900
The amount of the refund in cent.
|
currency |
"currency": "EUR"
Tthe currency in which the refund was processed
|
location_id |
"location_id": null
The location from which the refund transaction was triggered in case of a physical shop.
|
customer_token |
"customer_token": "TCMJEOTSBEVTDLFU"
The customer_token referencing the customer for whom the transaction was made.
|
device_id |
"device_id": null
A device identifier for the original order (if available)
|
source_name |
"source_name": "web"
The source from which the order for the transaction originated. Can be "web" or "api".
|
"customer_token": "TCMJEOTSBEVTDLFU"
The customer_token referencing the customer for whom the transaction was made.
|
shipping_lines |
"shipping_lines": []
{"price": 0}
The shipping price of the shipment.
{"title": "Default"}
The name of the shipment method
{"tax_lines": [0]}
The tax information of the shipping method.
|
source_name |
{"source_name": "api"}
Where the order originated. Possible values are: "api", "webshop" and "in app".
|
subtotal_price |
{"subtotal_price": 0.0}
Total net price.
|
tax_lines |
"tax_lines": []
The tax information for the individual items.
{"price": 3495}
The net price of this item.
{"rate": 0}
The tax rate for this item.
|
taxes_included |
{"taxes_included": false}
Is set to true, if taxes are included.
|
test |
{"test": false}
Set to true is this is a test purchase without actual payment.
|
theme_setting_id |
{"theme_setting_id": 232}
The ThemeSetting of the theme/shop in which this order was placed.
|
total_discounts |
{"total_discounts": 0.0}
The total discount amount (incl. taxes)
|
total_line_items_price |
{"total_line_items_price": 0.0}
Total price of all line items incl. taxes (no discounts).
|
total_price |
{"total_price": 0.0}
Total price gross less discounts. The actual money charged.
|
total_tax |
{"total_tax": 0.0}
Totl taxes in this order.
|
total_weight |
{"total_weight": 0.0}
Total weight in grams.
|
updated_at |
{"updated_at": "2016-04-07T16:16:17"}
GMT date and time of the last update to the order.
|
Endpoints
GET/api/orders.json
Retrieve a list of Orders
ids |
A comma-separated list of order ids |
since_id |
Restrict results to after the specified ID |
created_at_min |
Show orders created after date (format: 2008-12-31 03:00) |
created_at_max |
Show orders created before date (format: 2008-12-31 03:00) |
financial_status |
- paid - Show only paid orders
- refunded - Show only refunded orders
- partially_refunded - Show only partially refunded orders
|
fulfillment_status |
- fulfilled - Show orders that have been shipped
- partial - Show partially shipped orders
- null - Show orders that have not yet been shipped
- any - Show orders with any fulfillment_status. (default)
|
fields |
comma-separated list of fields to include in the response |
List orders last updated after 2005-07-31T15:57:11
GET /api/orders.json?updated_at_min=2005-07-31 15:57:11 EDT -04:00
List all orders, showing only some attributes
GET /api/orders.json?fields=created_at,id,name,total_price
List of specific orders
GET /api/orders.json?ids=1073459970
List all orders after the specified ID
GET /api/orders.json?since_id=123
List all orders
GET /api/orders.json
List orders which are paid.
GET /api/orders.json?financial_status=paid
GET/api/orders/450789469.json
Retrieve a specific order
fields |
comma-separated list of fields to include in the response |
Get a representation of a single order
GET /api/orders/210797.json
View Response
{
"order": {
"id": 210797,
"email": "test-user@fluxdvd.com",
"closed_at": "2016-05-09T14:05:16",
"created_at": "2016-05-09T14:05:16",
"updated_at": "2016-05-09T14:05:16",
"theme_setting_id": 1422,
"gateway": "TeleCash",
"test": true,
"total_weight": 0,
"taxes_included": false,
"currency": "EUR",
"financial_status": "paid",
"confirmed": true,
"buyer_accepts_marketing": false,
"name": "#210797",
"total_line_items_price": 1490,
"total_price": 1490,
"subtotal_price": 1252,
"total_tax": 238,
"total_discounts": 0,
"referring_site": null,
"landing_site": null,
"cancelled_at": null,
"checkout_token": "a71ac25e-2ed0-4540-b56e-3130d1a470e8",
"location_id": null,
"source_identifier": null,
"processed_at": "2016-05-09T14:05:16",
"device_id": null,
"browser_ip": "93.197.241.96",
"landing_site_ref": null,
"order_number": "1212-10",
"discount_codes": [],
"payment_gateway_names": [
"TeleCash"
],
"source": "",
"checkout_id": 120278,
"source_name": "webshop",
"fulfillment_status": null,
"tax_lines": [
{
"price": 1252,
"rate": 19
}
],
"line_items": [
{
"id": 424819,
"product_id": "0000-9933-DFDD-90F7",
"license_id": 18,
"hd": false,
"title": "Upload test HD",
"license_title": "Download to own (permanent access and burning)",
"quantity": 1,
"grams": 0,
"sku": "",
"price": 1490,
"taxable": true,
"requires_shipping": false,
"gift_card": false,
"name": "Upload test HD / Download to own (permanent access and burning)",
"product_exists": true,
"total_discount": 0
}
],
.
.
.
.
.
.
.
.
}
}
Get only particular fields
GET /api/orders/210797.json?fields=created_at,id,name,total_price
View Response
{
"order": {
"id": 210797,
"created_at": "2016-05-09T14:05:16",
"name": "#210797",
"total_price": 1490
}
}
GET/api/orders/count.json
Retrieve a count of all the orders
created_at_min |
Count orders created after date (format: 2008-12-31 03:00) |
created_at_max |
Count orders created before date (format: 2008-12-31 03:00) |
financial_status |
paid - Only paid orders
refunded - Show only refunded orders
partially refunded - Show only partially refunded orders
any - All paid, refunded, and partially refunded orders (default) |
fulfillment_status |
fulfilled - Orders that have been shipped
partial - Partially shipped orders
null - Orders that have not yet been shipped
any - Orders with any fulfillment_status. (default) |
Count all orders
GET /api/orders/count.json
View Response
{
"count": 102
}
Count orders which are paid.
GET /api/orders/count.json?financial_status=paid
View Response
{
"count": 97
}
Retrieve a list of Orders
GET /api/orders.json?updated_at_min=2016-02-05T15:57:11
View Response
{
"orders": [
{
"id": 199325,
"email": "TestUser@FluxDVD.com",
"closed_at": "2016-02-15T15:32:06",
"created_at": "2016-02-15T15:32:06",
"updated_at": "2016-02-15T15:32:06",
"theme_setting_id": 1422,
"gateway": "TeleCash",
"test": false,
"total_weight": 0,
"taxes_included": false,
"currency": "EUR",
"financial_status": "paid",
"confirmed": true,
"buyer_accepts_marketing": true,
"name": "#199325",
"total_line_items_price": 999,
"total_price": 999,
"subtotal_price": 839,
"total_tax": 160,
"total_discounts": 0,
"referring_site": null,
"landing_site": null,
"cancelled_at": null,
"checkout_token": "7803a8d5-fb9f-406e-acce-9aecbd794b6e",
"location_id": null,
"source_identifier": null,
"processed_at": "2016-02-15T15:32:06",
"device_id": null,
"browser_ip": "93.197.235.48",
"landing_site_ref": null,
"order_number": "1212-6",
"discount_codes": [],
"payment_gateway_names": [
"TeleCash"
],
"source": "",
"checkout_id": 111206,
"source_name": "webshop",
"fulfillment_status": null,
"tax_lines": [
{
"price": 839,
"rate": 19
}
],
"line_items": [
{
"id": 396556,
"product_id": "0000-D936-4322-F165",
"license_id": 19,
"hd": false,
"title": "HD Movie create trailer from content Frame conversion",
"license_title": "Download to own (permanent access + 1 burn)",
"quantity": 1,
"grams": 0,
"sku": "",
"price": 999,
"taxable": true,
"requires_shipping": false,
"gift_card": false,
"name": "HD Movie create trailer from content Frame conversion / Download to own (permanent access + 1 burn)",
"product_exists": false,
"total_discount": 0
}
],
"shipping_lines": [],
"fulfillments": [],
"refunds": [],
"customer": {
"id": 3066,
"email": "TestUser",
"created_at": "2009-03-30T16:21:35",
"updated_at": "2009-03-30T16:21:35",
"first_name": "Test",
"last_name": "User",
"language": "de",
"orders_count": 18,
"state": "enabled",
"total_spent": 2497,
"last_order_id": 199336,
"note": "",
"verified_email": true,
"last_order_name": "#199336",
"token": "CSVJYIWIXNCPMHPN",
"default_address": {
"id": 3066,
"first_name": "Test",
"last_name": "User",
"company": "Protect Software GmbH",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"phone": "",
"language": "de",
"token": "CSVJYIWIXNCPMHPN",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": true,
"province_code": "",
"province": "",
"name": "Test User"
},
"addresses": [
{
"id": 3066,
"first_name": "Test",
"last_name": "User",
"company": "Protect Software GmbH",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"phone": "",
"language": "de",
"token": "CSVJYIWIXNCPMHPN",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": true,
"province_code": "",
"province": "",
"name": "Test User"
}
]
},
"shipping_address": null
},
{
"id": 199331,
"email": "TestUser1@fluxdvd.com",
"closed_at": "2016-03-09T13:47:18",
"created_at": "2016-03-09T13:47:18",
"updated_at": "2016-03-09T13:47:18",
"theme_setting_id": 1422,
"gateway": "TeleCash",
"test": true,
"total_weight": 0,
"taxes_included": false,
"currency": "EUR",
"financial_status": "paid",
"confirmed": true,
"buyer_accepts_marketing": true,
"name": "#199331",
"total_line_items_price": 1499,
"total_price": 1499,
"subtotal_price": 1260,
"total_tax": 239,
"total_discounts": 0,
"referring_site": null,
"landing_site": null,
"cancelled_at": null,
"checkout_token": "b7fcc57c-af17-4d7d-9213-359fd05b7c0b",
"location_id": null,
"source_identifier": null,
"processed_at": "2016-03-09T13:47:18",
"device_id": null,
"browser_ip": "93.197.227.53",
"landing_site_ref": null,
"order_number": "1212-7",
"discount_codes": [],
"payment_gateway_names": [
"TeleCash"
],
"source": "",
"checkout_id": 111212,
"source_name": "webshop",
"fulfillment_status": null,
"tax_lines": [
{
"price": 1260,
"rate": 19
}
],
"line_items": [
{
"id": 396562,
"product_id": "0000-DD6C-F305-667E",
"license_id": 19,
"hd": false,
"title": "Alex Test 01",
"license_title": "Download to own (permanent access + 1 burn)",
"quantity": 1,
"grams": 0,
"sku": "",
"price": 1499,
"taxable": true,
"requires_shipping": false,
"gift_card": false,
"name": "Alex Test 01 / Download to own (permanent access + 1 burn)",
"product_exists": true,
"total_discount": 0
}
],
"shipping_lines": [],
"fulfillments": [],
"refunds": [],
"customer": {
"id": 93628,
"email": "TestUser1@fluxdvd.com",
"created_at": "2014-01-27T12:49:35",
"updated_at": "2014-01-27T12:49:35",
"first_name": "Test",
"last_name": "User",
"language": "en",
"orders_count": 98,
"state": "enabled",
"total_spent": 523101,
"last_order_id": 199334,
"note": "",
"verified_email": true,
"last_order_name": "#199334",
"token": "WWEDWMYDVIDMSKPN",
"default_address": {
"id": 93628,
"first_name": "Test",
"last_name": "User",
"company": "Protect Software GmbH",
"address1": "Heinrich Hertz Str 2",
"address2": "Dortmund",
"zip": "44139",
"city": "Dortmund",
"phone": "",
"language": "en",
"token": "WWEDWMYDVIDMSKPN",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": true,
"province_code": "",
"province": "",
"name": "Test User"
},
"addresses": [
{
"id": 93628,
"first_name": "Test",
"last_name": "User",
"company": "Protect Software GmbH",
"address1": "Heinrich Hertz Str 2",
"address2": "Dortmund",
"zip": "44139",
"city": "Dortmund",
"phone": "",
"language": "en",
"token": "WWEDWMYDVIDMSKPN",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": true,
"province_code": "",
"province": "",
"name": "Test user"
}
]
},
"shipping_address": null
}
]
}
Receive a single Order
GET /api/orders/#{id}.json
View Response
GET /api/orders/22503.json
{
"order": {
"id": 22503,
"email": "TestUser2@fluxdvd.com",
"closed_at": "2009-10-19T15:36:44",
"created_at": "2009-10-19T15:36:44",
"updated_at": "2009-10-19T15:36:44",
"theme_setting_id": null,
"gateway": "Certificate",
"test": false,
"total_weight": 0,
"taxes_included": false,
"currency": "EUR",
"financial_status": "paid",
"confirmed": false,
"buyer_accepts_marketing": true,
"name": "#22503",
"total_line_items_price": 100,
"total_price": 0,
"subtotal_price": 84,
"total_tax": 16,
"total_discounts": 100,
"referring_site": null,
"landing_site": null,
"cancelled_at": null,
"checkout_token": "d9cc2258-77f8-42e5-8b69-96bf9e071c38",
"location_id": null,
"source_identifier": null,
"processed_at": "2009-10-19T15:36:44",
"device_id": null,
"browser_ip": "93.197.253.122",
"landing_site_ref": null,
"order_number": "1212191020091",
"discount_codes": [
{
"id": 85931,
"amount": 100,
"code": "CERT-245-9-3208234144162314934",
"type": "fixed_amount"
}
],
"payment_gateway_names": [
"Certificate"
],
"source": "",
"checkout_id": 2193,
"source_name": "webshop",
"fulfillment_status": null,
"tax_lines": [
{
"price": 84,
"rate": 19
}
],
"line_items": [
{
"id": 20993,
"product_id": "0000-12C7-AF5D-42CB",
"license_id": 55,
"hd": false,
"title": "Nitro Circus 5",
"license_title": "Export to Apple",
"quantity": 1,
"grams": 0,
"sku": "",
"price": 100,
"taxable": true,
"requires_shipping": false,
"gift_card": false,
"name": "Nitro Circus 5 / Export to Apple",
"product_exists": true,
"total_discount": 0
}
],
"shipping_lines": [],
"fulfillments": [],
"refunds": [],
"customer": {
"id": 3069,
"email": "TestUser2@fluxdvd.com",
"created_at": "2009-03-31T08:34:22",
"updated_at": "2009-03-31T08:34:22",
"first_name": "Test",
"last_name": "User",
"language": "de",
"orders_count": 25,
"state": "enabled",
"total_spent": 1495,
"last_order_id": 185831,
"note": "",
"verified_email": true,
"last_order_name": "#185831",
"token": "UVDYQJMNYVNJLGPN",
"default_address": {
"id": 3069,
"first_name": "Test",
"last_name": "User",
"company": "",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"phone": "",
"language": "de",
"token": "UVDYQJMNYVNJLGPN",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": true,
"province_code": "",
"province": "",
"name": "Test User"
},
"addresses": [
{
"id": 3069,
"first_name": "Test",
"last_name": "User",
"company": "",
"address1": "Markgrafenstr 92",
"address2": "",
"zip": "44139",
"city": "Dortmund",
"phone": "",
"language": "de",
"token": "UVDYQJMNYVNJLGPN",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": true,
"province_code": "",
"province": "",
"name": "Test User"
}
]
},
"shipping_address": null
}
}
Receive a count of all Orders
GET /api/orders/count.json
View Response
{
"count": 96
}
Create a new Order for an existing customer
POST /api/orders.json
{
"order": {
"line_items": [{
"product_id": "0000-18E6-6DFE-B051",
"license_id": 19,
"quantity": 1,
"hd": false
}, {
"product_id": "0000-B4CB-BC42-08CE",
"license_id": 16,
"quantity": 2,
"hd": false
}],
"customer": {
"token": "PWWTGAUVXXBFFSEN"
}
}
}
View Response
{
"order": {
"id": 199346,
"email": "SampleUser@fluxdvd.com",
"closed_at": "2016-04-28T15:21:36",
"created_at": "2016-04-28T15:21:36",
"updated_at": "2016-04-28T15:21:36",
"theme_setting_id": null,
"gateway": "Manual",
"test": false,
"total_weight": 0,
"taxes_included": false,
"currency": "USD",
"financial_status": "paid",
"confirmed": true,
"buyer_accepts_marketing": true,
"name": "#199346",
"total_line_items_price": 0,
"total_price": 0,
"subtotal_price": 0,
"total_tax": 0,
"total_discounts": 0,
"referring_site": null,
"landing_site": null,
"cancelled_at": null,
"checkout_token": "8c859d5b-333c-43e3-8abb-096478b5368a",
"location_id": null,
"source_identifier": null,
"processed_at": "2016-04-28T15:21:36",
"device_id": null,
"browser_ip": "93.197.233.144",
"landing_site_ref": null,
"order_number": "",
"discount_codes": [],
"payment_gateway_names": [
"Manual"
],
"source": "",
"checkout_id": 0,
"source_name": "api",
"fulfillment_status": null,
"tax_lines": [],
"line_items": [
{
"id": 396578,
"product_id": "0000-18E6-6DFE-B051",
"license_id": 19,
"hd": false,
"title": "Big Buck Bunny",
"license_title": "Download to own (permanent access + 1 burn)",
"quantity": 1,
"grams": 0,
"sku": "",
"price": 0,
"taxable": false,
"requires_shipping": false,
"gift_card": false,
"name": "Big Buck Bunny / Download to own (permanent access + 1 burn)",
"product_exists": true,
"total_discount": 0
},
{
"id": 396579,
"product_id": "0000-B4CB-BC42-08CE",
"license_id": 16,
"hd": false,
"title": "Elephants Dream",
"license_title": "Rental (48 hours)",
"quantity": 2,
"grams": 0,
"sku": "",
"price": 0,
"taxable": false,
"requires_shipping": false,
"gift_card": false,
"name": "Rental (48 hours)",
"product_exists": true,
"total_discount": 0
}
],
"shipping_lines": [],
"fulfillments": [],
"refunds": [],
"customer": {
"id": 129881,
"email": "SampleUser@fluxdvd.com",
"created_at": "2015-04-29T08:39:17",
"updated_at": "2015-04-29T08:39:17",
"first_name": "",
"last_name": "",
"language": "en",
"orders_count": 2,
"state": "enabled",
"total_spent": 0,
"last_order_id": 199346,
"note": "",
"verified_email": true,
"last_order_name": "#199346",
"token": "PWWTGAUVXXBFFSEN",
"default_address": {
"id": 129881,
"first_name": "",
"last_name": "",
"company": "",
"address1": "",
"address2": "",
"zip": "",
"city": "",
"phone": "",
"language": "en",
"token": "PWWTGAUVXXBFFSEN",
"country": "United States of America",
"country_name": "United States of America",
"country_code": "US",
"default": true,
"province_code": "",
"province": "",
"name": " "
},
"addresses": [
{
"id": 129881,
"first_name": "",
"last_name": "",
"company": "",
"address1": "",
"address2": "",
"zip": "",
"city": "",
"phone": "",
"language": "en",
"token": "PWWTGAUVXXBFFSEN",
"country": "United States of America",
"country_name": "United States of America",
"country_code": "US",
"default": true,
"province_code": "",
"province": "",
"name": " "
}
]
},
"shipping_address": null
}
}
Create a new Order together with a new customer
POST /api/orders.json
{
"order": {
"line_items": [{
"product_id": "0000-18E6-6DFE-B051",
"license_id": 19,
"quantity": 1,
"hd": false
}, {
"product_id": "0000-B4CB-BC42-08CE",
"license_id": 16,
"quantity": 2,
"hd": false
}],
"customer": {
"first_name": "Steve",
"last_name": "Lastnameson",
"email": "steve.lastnameson@fluxdvd.com",
"addresses": [{
"address1": "123 Oak St",
"city": "Ottawa",
"province": "ON",
"phone": "555-1212",
"zip": "123 ABC",
"last_name": "Lastnameson",
"first_name": "Mother",
"country": "CA"
}],
"password": "newpass",
"password_confirmation": "newpass"
}
}
}
View Response
{
"order": {
"id": 199346,
"email": "SampleUser@fluxdvd.com",
"closed_at": "2016-04-28T15:21:36",
"created_at": "2016-04-28T15:21:36",
"updated_at": "2016-04-28T15:21:36",
"theme_setting_id": null,
"gateway": "Manual",
"test": false,
"total_weight": 0,
"taxes_included": false,
"currency": "USD",
"financial_status": "paid",
"confirmed": true,
"buyer_accepts_marketing": true,
"name": "#199346",
"total_line_items_price": 0,
"total_price": 0,
"subtotal_price": 0,
"total_tax": 0,
"total_discounts": 0,
"referring_site": null,
"landing_site": null,
"cancelled_at": null,
"checkout_token": "8c859d5b-333c-43e3-8abb-096478b5368a",
"location_id": null,
"source_identifier": null,
"processed_at": "2016-04-28T15:21:36",
"device_id": null,
"browser_ip": "93.197.233.144",
"landing_site_ref": null,
"order_number": "",
"discount_codes": [],
"payment_gateway_names": [
"Manual"
],
"source": "",
"checkout_id": 0,
"source_name": "api",
"fulfillment_status": null,
"tax_lines": [],
"line_items": [
{
"id": 396578,
"product_id": "0000-18E6-6DFE-B051",
"license_id": 19,
"hd": false,
"title": "Big Buck Bunny",
"license_title": "Download to own (permanent access + 1 burn)",
"quantity": 1,
"grams": 0,
"sku": "",
"price": 0,
"taxable": false,
"requires_shipping": false,
"gift_card": false,
"name": "Big Buck Bunny / Download to own (permanent access + 1 burn)",
"product_exists": true,
"total_discount": 0
},
{
"id": 396579,
"product_id": "0000-B4CB-BC42-08CE",
"license_id": 16,
"hd": false,
"title": "Elephants Dream",
"license_title": "Rental (48 hours)",
"quantity": 2,
"grams": 0,
"sku": "",
"price": 0,
"taxable": false,
"requires_shipping": false,
"gift_card": false,
"name": "Rental (48 hours)",
"product_exists": true,
"total_discount": 0
}
],
"shipping_lines": [],
"fulfillments": [],
"refunds": [],
"customer": {
"id": 129881,
"email": "SampleUser@fluxdvd.com",
"created_at": "2015-04-29T08:39:17",
"updated_at": "2015-04-29T08:39:17",
"first_name": "",
"last_name": "",
"language": "en",
"orders_count": 2,
"state": "enabled",
"total_spent": 0,
"last_order_id": 199346,
"note": "",
"verified_email": true,
"last_order_name": "#199346",
"token": "PWWTGAUVXXBFFSEN",
"default_address": {
"id": 129881,
"first_name": "",
"last_name": "",
"company": "",
"address1": "",
"address2": "",
"zip": "",
"city": "",
"phone": "",
"language": "en",
"token": "PWWTGAUVXXBFFSEN",
"country": "United States of America",
"country_name": "United States of America",
"country_code": "US",
"default": true,
"province_code": "",
"province": "",
"name": " "
},
"addresses": [
{
"id": 129881,
"first_name": "",
"last_name": "",
"company": "",
"address1": "",
"address2": "",
"zip": "",
"city": "",
"phone": "",
"language": "en",
"token": "PWWTGAUVXXBFFSEN",
"country": "United States of America",
"country_name": "United States of America",
"country_code": "US",
"default": true,
"province_code": "",
"province": "",
"name": " "
}
]
},
"shipping_address": null
}
}
Modify an existing Order
PUT /api/orders/#{id}.json
{
"order": {
"confirmed": false,
"buyer_accepts_marketing": false
}
}
View Response
{
"order": {
"id": 199344,
"email": "TestAPI02@flickrocket.com",
"closed_at": "2016-04-27T09:15:35",
"created_at": "2016-04-27T09:15:35",
"updated_at": "2016-04-27T09:15:35",
"theme_setting_id": null,
"gateway": "Manual",
"test": false,
"total_weight": 0,
"taxes_included": false,
"currency": "USD",
"financial_status": "paid",
"confirmed": true,
"buyer_accepts_marketing": false,
"name": "#199344",
"total_line_items_price": 0,
"total_price": 0,
"subtotal_price": 0,
"total_tax": 0,
"total_discounts": 0,
"referring_site": null,
"landing_site": null,
"cancelled_at": null,
"checkout_token": "c81caf66-2d09-40b8-ac66-3403e9961d8d",
"location_id": null,
"source_identifier": null,
"processed_at": "2016-04-27T09:15:35",
"device_id": null,
"browser_ip": "93.197.224.196",
"landing_site_ref": null,
"order_number": "",
"discount_codes": [],
"payment_gateway_names": [
"Manual"
],
"source": "",
"checkout_id": 0,
"source_name": "api",
"fulfillment_status": null,
"tax_lines": [],
"line_items": [
{
"id": 396576,
"product_id": "0000-2E74-D5D6-3CD7",
"license_id": 16,
"hd": false,
"title": "The Adventures of Sherlock Holmes",
"license_title": "Rental (48 hours)",
"quantity": 2,
"grams": 0,
"sku": "",
"price": 0,
"taxable": false,
"requires_shipping": false,
"gift_card": false,
"name": "The Adventures of Sherlock Holmes / Rental (48 hours)",
"product_exists": true,
"total_discount": 0
},
{
"id": 396575,
"product_id": "0000-33B3-B888-DFED",
"license_id": 19,
"hd": true,
"title": "Sintel",
"license_title": "Download to own (permanent access + 1 burn)",
"quantity": 1,
"grams": 0,
"sku": "",
"price": 0,
"taxable": false,
"requires_shipping": false,
"gift_card": false,
"name": "Sintel / Download to own (permanent access + 1 burn)",
"product_exists": true,
"total_discount": 0
}
],
"shipping_lines": [],
"fulfillments": [],
"refunds": [],
"customer": {
"id": 154268,
"email": "TestAPI02@flickrocket.com",
"created_at": "2016-04-27T09:15:34",
"updated_at": "2016-04-27T09:15:34",
"first_name": "TestAPI02",
"last_name": "TestAPI02",
"language": "en",
"orders_count": 1,
"state": "enabled",
"total_spent": 0,
"last_order_id": 199344,
"note": "",
"verified_email": true,
"last_order_name": "#199344",
"token": "FAWXUALAAEVYDOBV",
"default_address": {
"id": 154268,
"first_name": "TestAPI02",
"last_name": "TestAPI02",
"company": "",
"address1": "Heinrich-Hertz-Str. 2",
"address2": "",
"zip": "44227",
"city": "Dortmund",
"phone": "0231-12345678",
"language": "en",
"token": "FAWXUALAAEVYDOBV",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": true,
"province_code": "",
"province": "",
"name": "TestAPI02 TestAPI02"
},
"addresses": [
{
"id": 154268,
"first_name": "TestAPI02",
"last_name": "TestAPI02",
"company": "",
"address1": "Heinrich-Hertz-Str. 2",
"address2": "",
"zip": "44227",
"city": "Dortmund",
"phone": "0231-12345678",
"language": "en",
"token": "FAWXUALAAEVYDOBV",
"country": "Germany",
"country_name": "Germany",
"country_code": "DE",
"default": true,
"province_code": "",
"province": "",
"name": "TestAPI02 TestAPI02"
}
]
},
"shipping_address": null
}
}
Invalidate an Order from the database
DELETE /api/orders/#{id}.json
View Response
DELETE /api/orders/199346.json
{}