Tax lines won't automatically generate in Shopify API order - rest

I am posting the following to the Shopify API order endpoint:
{
"order": {
"email": "some#email.com",
"financial_status": "paid",
"fulfillment_status": null,
"send_receipt": true,
"send_fulfillment_receipt": true,
"note": "Created by somename",
"line_items": [
{
"variant_id": 21718275463,
"quantity": 1,
"price": 99,
"requires_shipping": true,
"product_id": 6820646151
},
{
"variant_id": 21717700871,
"quantity": 1,
"price": 1000,
"requires_shipping": true,
"product_id": 6820646151
},
{
"variant_id": 21717690055,
"quantity": 1,
"price": 555,
"requires_shipping": true,
"product_id": 6821668807
}
],
"processing_method": "offsite",
"shipping_address": {
"first_name": "Chris",
"address1": "10101 Musick Road",
"phone": "9999999999",
"city": "St. Louis",
"zip": "63123",
"province": "MO",
"country": "United States",
"last_name": "Becker",
"name": "Chris Becker",
"country_code": "US",
"province_code": "MO"
},
"source_name": "somename",
"taxes_included": false,
"shipping_lines": [
{
"title": "standard",
"price": 0.00,
"code": null,
"source": "brand owner on shopify",
"carrier_identifier": null,
"tax_lines": null
}
],
"tags": "some Order"
}
}
and receiving a response without tax lines that are filled. I have seen on the shopify forum that the taxlines are supposed to then be automatically
calculated and filled by shopify. I tried doing it with a customer as well but that didn't work either.

The Orders API will not auto-calculate the taxes but if your app knows how much they are then you can include this data using tax_lines and total_tax:
{
"order": {
"line_items": [{
"title": "Big Brown Bear Boots",
"price": 74.99,
"quantity": 3,
"tax_lines": [{
"price": 13.50,
"rate": 0.06,
"title": "State tax"
}]
}],
"total_tax": 13.50
}
}

Related

PayPal API returns SUBSCRIPTION_CANNOT_HAVE_QUANTITY even though Plan has quantity_supported set

Using PayPal's current API I've created a simple Product:
{
"id" : "A-001",
"name": "A Service",
"description": "Video streaming service",
"type": "SERVICE",
"category": "SOFTWARE"
}
Also created a Plan, which is tiered based on Quantity
{
"product_id" : "A-001",
"name": "Default Plan",
"description": "Plan with regular and trial payment definitions.",
"quantity_supported" : true,
"billing_cycles": [
{
"frequency": {
"interval_unit": "MONTH",
"interval_count": 1
},
"tenure_type": "TRIAL",
"sequence": 1,
"total_cycles": 1
},
{
"frequency": {
"interval_unit": "MONTH",
"interval_count": 1
},
"tenure_type": "REGULAR",
"sequence": 2,
"total_cycles": 12,
"pricing_scheme": {
"pricing_model" : "TIERED",
"version" : 1,
"tiers": [{
"starting_quantity": 1,
"ending_quantity": 499,
"amount": { "currency_code":"USD", "value":0.55}
},
{
"starting_quantity": 500,
"ending_quantity": 999,
"amount": { "currency_code":"USD", "value":0.5}
},
{
"starting_quantity": 1000,
"ending_quantity": 2499,
"amount": { "currency_code":"USD", "value":0.46}
},
{
"starting_quantity": 2500,
"amount": { "currency_code":"USD", "value":0.37}
}
]
}
}
],
"payment_preferences": {
"auto_bill_outstanding": true,
"setup_fee": {
"value": "10",
"currency_code": "USD"
},
"setup_fee_failure_action": "CONTINUE",
"payment_failure_threshold": 3
},
"taxes": {
"percentage": "10",
"inclusive": false
}
}
Now, I try to create a Subscription to the Plan:
{
"plan_id": "P-16786052YT8021220MAMUCDY",
"start_time": "2021-03-01T00:00:00Z",
"quantity": "20",
"shipping_amount": {
"currency_code": "USD",
"value": "0.00"
},
"subscriber": {
"name": {
"given_name": "John",
"surname": "Doe"
},
"email_address": "customer#example.com",
"shipping_address": {
"name": {
"full_name": "John Doe"
},
"address": {
"address_line_1": "2211 N First Street",
"address_line_2": "Building 17",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131",
"country_code": "US"
}
}
},
"application_context": {
"brand_name": "walmart",
"locale": "en-US",
"shipping_preference": "SET_PROVIDED_ADDRESS",
"user_action": "SUBSCRIBE_NOW",
"payment_method": {
"payer_selected": "PAYPAL",
"payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED"
},
"return_url": "https://example.com/returnUrl",
"cancel_url": "https://example.com/cancelUrl"
}
}
But I get an Error response:
{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "658174d246c0b",
"details": [
{
"issue": "SUBSCRIPTION_CANNOT_HAVE_QUANTITY",
"description": "Subscription can't have quantity as the plan does not support quantity."
}
],
"links": [
{
"href": "https://developer.paypal.com/docs/api/v1/billing/subscriptions#UNPROCESSABLE_ENTITY",
"rel": "information_link",
"method": "GET"
}
]
}
Why do I get this error when my Plan clearly states "quantity_supported" : true, ?
In my case I had forgotten to modify the PayPal-Request-Id from a previous Plan creation (which didn't allow Quantity), so the Plan with details above wasn't being created

Checkout.js + Server-Side -> country_code and phone issues using REST API /v1/payments/payment

Without avail, I cannot get the country_code (CA) or phone to fill up after successfully calling create payment.
Country always show up as "United States" and Phone is "+1".
With or without shipping_address, shipping_preference: NO_SHIPPING. Using so-called examples (which might be outdated or not correctly documented), and the API documentation, which would be great to have examples included...
This is the create-payment query in json. I'm getting the same structure back with the following additions:
id:PAY-xxx
state:created
phone in payer_info (but no country_code as expected from the API)
created_time
...and...
PayPal's links in links.
Which indicate that the call was successful.
Either I should ditch "/v1/payments/payment" for something else I'm not aware of, or Paypal API is not up-to-date.
----- json create-payment query -----
{
"intent": "sale",
"payer": {
"payment_method": "paypal",
"payer_info": {
"email": "<snip>",
"first_name": "Bob",
"last_name": "Smith",
"billing_address": {
"line1": "1 notre dame",
"line2": "",
"city": "Montreal",
"country_code": "CA",
"postal_code": "H1H 1H1",
"phone": "011862212345678",
"state": "QC"
}
}
},
"application_context": {
"brand_name": "Server-side Test",
"locale": "fr_CA",
"landing_page": "Billing"
},
"transactions": [
{
"description": "The payment transaction description.",
"invoice_number": "5b5a38cb35bb7",
"custom": "merchant custom data",
"payment_options": {
"allowed_payment_method": "INSTANT_FUNDING_SOURCE"
},
"amount": {
"total": "5.75",
"currency": "CAD",
"details": {
"subtotal": "5",
"tax": "0.75"
}
},
"item_list": {
"items": [
{
"name": "item 1",
"description": "item 1 description",
"quantity": "1",
"price": "1",
"tax": "0.15",
"currency": "CAD"
},
{
"name": "item 2",
"description": "item 2 description",
"quantity": "2",
"price": "2",
"tax": "0.6",
"currency": "CAD"
}
],
"shipping_address": {
"recipient_name": "Bob Smith",
"line1": "1 notre dame",
"line2": "",
"city": "Montreal",
"country_code": "CA",
"postal_code": "H1H 1H1",
"phone": "011862212345678",
"state": "QC"
}
}
}
],
"redirect_urls": {
"return_url": "http:\/\/<snip>\/return.php",
"cancel_url": "http:\/\/<snip>\/cancel.php"
}
}

uber RUSH API sandbox deliveries is_fragile value incorrect, bug?

While experimenting with the uber deliveries API sandbox I noticed that when I POST to https://sandbox-api.uber.com/v1/deliveries to create delivery of a new item with item[]."is fragile": true, that the response from the sandbox incorrectly shows item[]."is fragile": false. At least I think this is incorrect, I didn't see it listed as a known limitation of the sandbox. Is this a bug?
More information:
OS: Ubuntu 16.04.1 LTS
Client: Postman 4.9.0
POST request to URL https://sandbox-api.uber.com/v1/deliveries
POST /v1/deliveries HTTP/1.1
Host: sandbox-api.uber.com
Authorization: [redacted]
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: [redacted]
{
"items": [
{
"title": "Fragile Item",
"quantity": 1,
"price": 30,
"is_fragile": true,
"currency_code": "USD",
}
],
"dropoff": {
"location": {
"address": "530 W 113th Street",
"address_2": "Floor 2",
"city": "New York",
"country": "US",
"postal_code": "10025",
"state": "NY"
},
"contact": {
"first_name": "Alice",
"last_name": "Dropoff",
"email": "tomb#cryptocracy.net",
"phone": {
"number": "+19177447934",
"sms_enabled": "true",
},
}
},
"pickup": {
"location": {
"address": "636 W 28th Street",
"address_2": "Floor 2",
"city": "New York",
"country": "US",
"postal_code": "10001",
"state": "NY"
},
"contact": {
"first_name": "Bob",
"last_name": "Pickup",
"email": "tomb#cryptocracy.net",
"phone": {
"number": "+19177447934",
"sms_enabled": "true",
},
},
},
}
Response from the sandbox:
{
"status": "processing",
"dropoff": {
"eta": 12,
"signature_required": false,
"contact": {
"first_name": "Alice",
"last_name": "Dropoff",
"send_sms_notifications": true,
"send_email_notifications": true,
"phone": {
"sms_enabled": true,
"number": "+19177447934"
},
"email": "tomb#cryptocracy.net"
},
"special_instructions": "",
"location": {
"city": "New York",
"country": "US",
"longitude": -73.963863,
"state": "NY",
"postal_code": "10025",
"address_2": "Floor 2",
"address": "530 W 113th Street",
"latitude": 40.805264
},
"signature_image": {
"url": "",
"expires_at": "-62135596800"
},
"courier_notes": {}
},
"fee": 5,
"quote_id": "c7e135da-957e-40b7-a2c5-5d468dc1d686",
"courier": null,
"items": [
{
"weight": 0,
"title": "Bottle 3",
"price": 30,
"is_fragile": false,
"height": 0,
"width": 0,
"length": 0,
"currency_code": "USD",
"quantity": 1
}
],
"created_at": 1480961485,
"delivery_id": "21b1b8de-2cea-4bc4-a316-2fd7598787c7",
"pickup": {
"eta": 7,
"signature_required": false,
"contact": {
"first_name": "Bob",
"last_name": "Pickup",
"send_sms_notifications": true,
"send_email_notifications": true,
"phone": {
"sms_enabled": true,
"number": "+19177447934"
},
"email": "tomb#cryptocracy.net"
},
"special_instructions": "",
"location": {
"city": "New York",
"country": "US",
"longitude": -74.0064109,
"state": "NY",
"postal_code": "10001",
"address_2": "Floor 2",
"address": "636 W 28th Street",
"latitude": 40.7527293
},
"signature_image": {
"url": "",
"expires_at": "-62135596800"
},
"courier_notes": {}
},
"order_reference_id": "",
"tracking_url": "https://api.uber.com/v1/sandbox/map",
"currency_code": "USD"
}
This seems to be a bug in the Uber sandbox environment for the Deliveries API.

Whats are some real time data sources?

I'm working on a demo on real-time visualization and I'm trying to think out of the box. Looks like any big data real-time demo is on twitter or traffic data. Are there any other options out there that publish real-time data (for free)?
Thanks
Just some thoughts:
Environmental Datasets
As stated by the other comment, have a look to weather, forecast (or similar services).
Space data
What about data from the Universe?
Flights
Here's some real time flight tracking data: the evaluation plan is limited but free.
Social Networks
Twitter Streaming API, Facebook RealTime Updates API (in case you hyave already an app on the social Network), Foursquare
Energy production
Various energy production (real-time and quasi real-time) data.
On these ones probably you have to fiddle around the pages to track the sources of the data, sorry.
Website traffic
Google Analytics RealTime API (for your registered websites)
Money
Bitcoin transactions, Stock Market API
More?
And here and here an "not-so-updated" list of other Real-Time API services (some free, some others not).
Have you considered environmental datasets?
For one, there are near real time (say, hourly or 15m) data on streamflow and water quality. There's also a wealth of weather data served up via NOAA NCDC and APIs. How about some bouy data?
Seeing this post reminded me that there's lots of flight tracking data out there which could be fun to visualize too.
You can find real-time data sources at www.hooksdata.io. Using a query language you can specify what data you need and then add a webhook URL where you want to receive the data or just pull the data anytime.
API DOCS: https://www.hooksdata.io/docs/api/introduction/
Available data sources with examples:
RSS:
Input:
SELECT * FROM RSS('http://feeds.feedburner.com/TechCrunch/')
TwitterUserTimeline:
Input:
SELECT * FROM TwitterUserTimeline('Techstars')
Output:
{ "_entity_type": "tweet", "_id": "tweet_976733289221210112", "contributors": null, "coordinates": null, "created_at": "Thu Mar 22 08:12:17 +0000 2018", "entities": { "hashtags": [ { "indices": [ 121, 132 ], "text": "3Dprinting" } ], "symbols": [], "urls": [], "user_mentions": [ { "id": 117789943, "id_str": "117789943", "indices": [ 3, 19 ], "name": "StanleyBlack&Decker", "screen_name": "StanleyBlkDeckr" }, { "id": 14277276, "id_str": "14277276", "indices": [ 61, 71 ], "name": "techstars", "screen_name": "techstars" } ] }, "favorite_count": 0, "favorited": false, "geo": null, "id": 976733289221210112, "id_str": "976733289221210112", "in_reply_to_screen_name": null, "in_reply_to_status_id": null, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_user_id_str": null, "is_quote_status": false, "lang": "en", "metadata": { "iso_language_code": "en", "result_type": "recent" }, "place": null, "retweet_count": 7, "retweeted": false, "retweeted_status": { "contributors": null, "coordinates": null, "created_at": "Wed Mar 21 20:37:05 +0000 2018", "entities": { "hashtags": [ { "indices": [ 100, 111 ], "text": "3Dprinting" } ], "symbols": [], "urls": [ { "display_url": "twitter.com\/i\/web\/status\/9\u2026", "expanded_url": "https:\/\/twitter.com\/i\/web\/status\/976558334030442498", "indices": [ 117, 140 ], "url": "https:\/\/t.co\/6GWviWvVd1" } ], "user_mentions": [ { "id": 14277276, "id_str": "14277276", "indices": [ 40, 50 ], "name": "techstars", "screen_name": "techstars" } ] }, "favorite_count": 11, "favorited": false, "geo": null, "id": 976558334030442498, "id_str": "976558334030442498", "in_reply_to_screen_name": null, "in_reply_to_status_id": null, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_user_id_str": null, "is_quote_status": false, "lang": "en", "metadata": { "iso_language_code": "en", "result_type": "recent" }, "place": null, "possibly_sensitive": false, "retweet_count": 7, "retweeted": false, "source": "<a href=\"http:\/\/percolate.com\" rel=\"nofollow\">Percolate<\/a>", "text": "Ahead of the Stanley+Techstars program, #Techstars leaders visited us to see how we've incorporated #3Dprinting and\u2026 https:\/\/t.co\/6GWviWvVd1", "truncated": true, "user": { "contributors_enabled": false, "created_at": "Fri Feb 26 16:34:00 +0000 2010", "default_profile": false, "default_profile_image": false, "description": "Official Twitter account for Stanley Black and Decker", "entities": { "description": { "urls": [] }, "url": { "urls": [ { "display_url": "stanleyblackanddecker.com", "expanded_url": "http:\/\/stanleyblackanddecker.com", "indices": [ 0, 22 ], "url": "http:\/\/t.co\/OwfwWAucUP" } ] } }, "favourites_count": 474, "follow_request_sent": false, "followers_count": 5293, "following": false, "friends_count": 170, "geo_enabled": false, "has_extended_profile": false, "id": 117789943, "id_str": "117789943", "is_translation_enabled": false, "is_translator": false, "lang": "en", "listed_count": 136, "location": "New Britain", "name": "StanleyBlack&Decker", "notifications": false, "profile_background_color": "C0DEED", "profile_background_image_url": "http:\/\/pbs.twimg.com\/profile_background_images\/84200087\/stanley_twitter_nologos.jpg", "profile_background_image_url_https": "https:\/\/pbs.twimg.com\/profile_background_images\/84200087\/stanley_twitter_nologos.jpg", "profile_background_tile": false, "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/117789943\/1501159100", "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/534427580120571905\/qEDM5_-D_normal.jpeg", "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/534427580120571905\/qEDM5_-D_normal.jpeg", "profile_link_color": "0084B4", "profile_sidebar_border_color": "C0DEED", "profile_sidebar_fill_color": "FFD30D", "profile_text_color": "333333", "profile_use_background_image": true, "protected": false, "screen_name": "StanleyBlkDeckr", "statuses_count": 1239, "time_zone": null, "translator_type": "none", "url": "http:\/\/t.co\/OwfwWAucUP", "utc_offset": null, "verified": false } }, "source": "<a href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\">Twitter for iPhone<\/a>", "text": "RT #StanleyBlkDeckr: Ahead of the Stanley+Techstars program, #Techstars leaders visited us to see how we've incorporated #3Dprinting and ad\u2026", "truncated": false, "user": { "contributors_enabled": false, "created_at": "Mon Jul 27 04:06:55 +0000 2015", "default_profile": true, "default_profile_image": false, "description": "Humble Star", "entities": { "description": { "urls": [] } }, "favourites_count": 51, "follow_request_sent": false, "followers_count": 26, "following": false, "friends_count": 74, "geo_enabled": false, "has_extended_profile": false, "id": 3296795162, "id_str": "3296795162", "is_translation_enabled": false, "is_translator": false, "lang": "en", "listed_count": 0, "location": "", "name": "Munkhi Tse", "notifications": false, "profile_background_color": "C0DEED", "profile_background_image_url": "http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_image_url_https": "https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_tile": false, "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/3296795162\/1520835673", "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/973081082500235264\/46urpcv1_normal.jpg", "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/973081082500235264\/46urpcv1_normal.jpg", "profile_link_color": "1DA1F2", "profile_sidebar_border_color": "C0DEED", "profile_sidebar_fill_color": "DDEEF6", "profile_text_color": "333333", "profile_use_background_image": true, "protected": false, "screen_name": "Munkhitse", "statuses_count": 53, "time_zone": "Pacific Time (US & Canada)", "translator_type": "none", "url": null, "utc_offset": -25200, "verified": false } }
TwitterSearch:
Input:
SELECT * FROM TwitterSearch('Techstars')
Output:
{ "_entity_type": "tweet", "_id": "tweet_976733289221210112", "contributors": null, "coordinates": null, "created_at": "Thu Mar 22 08:12:17 +0000 2018", "entities": { "hashtags": [ { "indices": [ 121, 132 ], "text": "3Dprinting" } ], "symbols": [], "urls": [], "user_mentions": [ { "id": 117789943, "id_str": "117789943", "indices": [ 3, 19 ], "name": "StanleyBlack&Decker", "screen_name": "StanleyBlkDeckr" }, { "id": 14277276, "id_str": "14277276", "indices": [ 61, 71 ], "name": "techstars", "screen_name": "techstars" } ] }, "favorite_count": 0, "favorited": false, "geo": null, "id": 976733289221210112, "id_str": "976733289221210112", "in_reply_to_screen_name": null, "in_reply_to_status_id": null, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_user_id_str": null, "is_quote_status": false, "lang": "en", "metadata": { "iso_language_code": "en", "result_type": "recent" }, "place": null, "retweet_count": 7, "retweeted": false, "retweeted_status": { "contributors": null, "coordinates": null, "created_at": "Wed Mar 21 20:37:05 +0000 2018", "entities": { "hashtags": [ { "indices": [ 100, 111 ], "text": "3Dprinting" } ], "symbols": [], "urls": [ { "display_url": "twitter.com\/i\/web\/status\/9\u2026", "expanded_url": "https:\/\/twitter.com\/i\/web\/status\/976558334030442498", "indices": [ 117, 140 ], "url": "https:\/\/t.co\/6GWviWvVd1" } ], "user_mentions": [ { "id": 14277276, "id_str": "14277276", "indices": [ 40, 50 ], "name": "techstars", "screen_name": "techstars" } ] }, "favorite_count": 11, "favorited": false, "geo": null, "id": 976558334030442498, "id_str": "976558334030442498", "in_reply_to_screen_name": null, "in_reply_to_status_id": null, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_user_id_str": null, "is_quote_status": false, "lang": "en", "metadata": { "iso_language_code": "en", "result_type": "recent" }, "place": null, "possibly_sensitive": false, "retweet_count": 7, "retweeted": false, "source": "<a href=\"http:\/\/percolate.com\" rel=\"nofollow\">Percolate<\/a>", "text": "Ahead of the Stanley+Techstars program, #Techstars leaders visited us to see how we've incorporated #3Dprinting and\u2026 https:\/\/t.co\/6GWviWvVd1", "truncated": true, "user": { "contributors_enabled": false, "created_at": "Fri Feb 26 16:34:00 +0000 2010", "default_profile": false, "default_profile_image": false, "description": "Official Twitter account for Stanley Black and Decker", "entities": { "description": { "urls": [] }, "url": { "urls": [ { "display_url": "stanleyblackanddecker.com", "expanded_url": "http:\/\/stanleyblackanddecker.com", "indices": [ 0, 22 ], "url": "http:\/\/t.co\/OwfwWAucUP" } ] } }, "favourites_count": 474, "follow_request_sent": false, "followers_count": 5293, "following": false, "friends_count": 170, "geo_enabled": false, "has_extended_profile": false, "id": 117789943, "id_str": "117789943", "is_translation_enabled": false, "is_translator": false, "lang": "en", "listed_count": 136, "location": "New Britain", "name": "StanleyBlack&Decker", "notifications": false, "profile_background_color": "C0DEED", "profile_background_image_url": "http:\/\/pbs.twimg.com\/profile_background_images\/84200087\/stanley_twitter_nologos.jpg", "profile_background_image_url_https": "https:\/\/pbs.twimg.com\/profile_background_images\/84200087\/stanley_twitter_nologos.jpg", "profile_background_tile": false, "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/117789943\/1501159100", "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/534427580120571905\/qEDM5_-D_normal.jpeg", "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/534427580120571905\/qEDM5_-D_normal.jpeg", "profile_link_color": "0084B4", "profile_sidebar_border_color": "C0DEED", "profile_sidebar_fill_color": "FFD30D", "profile_text_color": "333333", "profile_use_background_image": true, "protected": false, "screen_name": "StanleyBlkDeckr", "statuses_count": 1239, "time_zone": null, "translator_type": "none", "url": "http:\/\/t.co\/OwfwWAucUP", "utc_offset": null, "verified": false } }, "source": "<a href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\">Twitter for iPhone<\/a>", "text": "RT #StanleyBlkDeckr: Ahead of the Stanley+Techstars program, #Techstars leaders visited us to see how we've incorporated #3Dprinting and ad\u2026", "truncated": false, "user": { "contributors_enabled": false, "created_at": "Mon Jul 27 04:06:55 +0000 2015", "default_profile": true, "default_profile_image": false, "description": "Humble Star", "entities": { "description": { "urls": [] } }, "favourites_count": 51, "follow_request_sent": false, "followers_count": 26, "following": false, "friends_count": 74, "geo_enabled": false, "has_extended_profile": false, "id": 3296795162, "id_str": "3296795162", "is_translation_enabled": false, "is_translator": false, "lang": "en", "listed_count": 0, "location": "", "name": "Munkhi Tse", "notifications": false, "profile_background_color": "C0DEED", "profile_background_image_url": "http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_image_url_https": "https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_tile": false, "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/3296795162\/1520835673", "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/973081082500235264\/46urpcv1_normal.jpg", "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/973081082500235264\/46urpcv1_normal.jpg", "profile_link_color": "1DA1F2", "profile_sidebar_border_color": "C0DEED", "profile_sidebar_fill_color": "DDEEF6", "profile_text_color": "333333", "profile_use_background_image": true, "protected": false, "screen_name": "Munkhitse", "statuses_count": 53, "time_zone": "Pacific Time (US & Canada)", "translator_type": "none", "url": null, "utc_offset": -25200, "verified": false } }
NFLGames:
Input:
SELECT * FROM NFLGames
WHERE status = 'FUTURE' and
away_team.team_name = 'New England Patriots' OR
home_team.team_name = 'New England Patriots' AND
start_datetime.countdown = 3600
SoccerGames:
Input:
SELECT * FROM SoccerGames
WHERE away_team.team_name = 'Real Madrid'
OR home_team.team_name = 'Real Madrid'
AND start_datetime.countdown = 3600
Output:
{
"matches_count": 1,
"results": [
{
"_entity_type": "SoccerGame",
"_id": "SoccerGame_490555",
"away_score": null,
"away_team": {
"_entity_type": "SoccerTeam",
"_id": "SoccerTeam_86",
"espn_id": 86,
"id": "SoccerTeam_86",
"logo_url": "http://a.espncdn.com/combiner/i?img=/i/teamlogos/soccer/500/86.png&h=500",
"team_name": "Real Madrid"
},
"competition": "Spanish Primera División",
"game_id": "490555",
"home_score": null,
"home_team": {
"_entity_type": "SoccerTeam",
"_id": null,
"team_name": "Leganes"
},
"link": "http://m.espn.go.com/soccer/gamecast?gameId=490555&lang=EN&wjb=",
"start_datetime": {
"countdown": 86970,
"datetime": "2018-02-21T17:45:00+0000",
"timestamp": 1519235100
},
"status": "FUTURE",
"timestamp": 1519235100
}
]
}
EpisodesByTVShow:
Input:
SELECT * FROM
EpisodesByTVShow(name = 'Game of Thrones')
WHERE start_datetime.countdown = 3600
Output:
{
"_entity_type": "Episode",
"_id": "Episode_4961",
"image": {
"medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2681.jpg",
"original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2681.jpg"
},
"link": "http://www.tvmaze.com/episodes/4961/game-of-thrones-1x10-fire-and-blood",
"number": 10,
"runtime": 60,
"season": 1,
"start_datetime": {
"countdown": -210591933,
"datetime": "2011-06-20T01:00:00+0000",
"timestamp": 1308531600
},
"summary": "Daenerys must realize her destiny. Jaime finds himself in an unfamiliar predicament.",
"title": "Fire and Blood",
"tvmaze_episode_id": 4961,
"tvshow": {
"_entity_type": "TVShow",
"_id": "TVShow_82",
"externals": {
"imdb": "tt0944947",
"thetvdb": 121361,
"tvrage": 24493
},
"genres": [
"Drama",
"Adventure",
"Fantasy"
],
"id": "TVShow_82",
"image": {
"medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
"original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
},
"language": "English",
"name": "Game of Thrones",
"network": {
"country": {
"code": "US",
"name": "United States",
"timezone": "America/New_York"
},
"id": 8,
"name": "HBO"
},
"officialSite": "http://www.hbo.com/game-of-thrones",
"premiered": "2011-04-17",
"rating": {
"average": 9.3
},
"runtime": 60,
"schedule": {
"days": [
"Sunday"
],
"time": "21:00"
},
"status": "Running",
"summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
"tvmaze_id": 82,
"type": "Scripted",
"updated": 1517168016,
"url": "http://www.tvmaze.com/shows/82/game-of-thrones",
"webChannel": {
"country": {
"code": "US",
"name": "United States",
"timezone": "America/New_York"
},
"id": 22,
"name": "HBO Go"
},
"weight": 99
}
}
WeatherByCity:
Input:
SELECT * FROM WeatherByCity
(name = 'San Francisco'
AND country.name = 'United States'
AND subdivision.type = 'State'
AND subdivision.name = 'California')
WHERE weather_conditions.main = 'Rain'
AND start_datetime.countdown = 86400
Output:
{
"_entity_type": "WeatherStatus",
"_id": "WeatherStatus_Geoname_5391959-1519178400",
"city": {
"_entity_type": "City",
"_id": "Geoname_5391959",
"admin1_code": "CA",
"admin2_code": "075",
"admin3_code": null,
"admin4_code": null,
"alternative_names": [
"Franciscopolis",
"Frisco",
"Gorad San-Francyska",
"Kapalakiko",
"Khiu-kim-san",
"Khiu-kîm-sân",
"Lungsod ng San Francisco",
"New Albion",
"SF",
"SFO",
"San Francisco",
"San Franciscu",
"San Francisko",
"San Fransisco",
"San Fransiskas",
"San Fransisko",
"San Frantzisko",
"San Phransisko",
"San-Francisko",
"San-Fransisko",
"Sanfrancisko",
"Sao Francisco",
"São Francisco",
"Yerba Buena",
"can pirancisko",
"jiu jin shan",
"saenpeulan",
"saenpeulansiseuko",
"saina pharansisako",
"saina phransisko",
"san f ran si s ko",
"san fan shi",
"san fransskw",
"san fransyskw",
"san fransyskۆ",
"san phransisko",
"sana phransisako ka'unti",
"sana phransisko",
"sanfuranshisuko",
"sena phransisko",
"sn prnsysqw",
"syana phransisko",
"Σαν Φρανσίσκο",
"Горад Сан-Францыска",
"Сан Франсиско",
"Сан Франциско",
"Сан-Франциско",
"Сан-Франціско",
"Սան Ֆրանցիսկո",
"סאן פראנציסקא",
"סן פרנסיסקו",
"سان فرانسسکو",
"سان فرانسيسكو",
"سان فرانسیسکو",
"سان فرانسیسکۆ",
"सॅन फ्रान्सिस्को",
"सैन फ्रांसिस्को",
"स्यान फ्रान्सिस्को",
"সান ফ্রান্সিসকো কাউন্টি",
"সান ফ্রান্সিস্কো",
"ਸੈਨ ਫਰਾਂਸਿਸਕੋ",
"சான் பிரான்சிஸ்கோ",
"శాన్ ఫ్రాన్సిస్కో",
"സാൻ ഫ്രാൻസിസ്കോ",
"සැන් ෆ්\u200dරැන්සිස්කෝ",
"ซานฟรานซิสโก",
"སན་ཧྥུ་རན་སིས་ཁོ",
"ဆန်ဖရန်စစ္စကိုမြို့",
"სან-ფრანცისკო",
"サンフランシスコ",
"三藩市",
"旧金山",
"舊金山",
"샌프란",
"샌프란시스코"
],
"ascii_name": "San Francisco",
"coordinates": "37.77493,-122.41942",
"country": {
"country_code_2": "US",
"country_code_3": "USA",
"country_numeric_code": "840",
"name": "United States",
"official_name": "United States of America"
},
"dem": "28",
"elevation": 16,
"feature_class": "P",
"feature_code": "PPLA2",
"geonameid": "5391959",
"id": "Geoname_5391959",
"modification_date": "2017-06-15",
"name": "San Francisco",
"population": 864816,
"subdivision": {
"country_code_2": "US",
"name": "California",
"subdivision_code": "US-CA",
"type": "State"
},
"timezone": "America/Los_Angeles"
},
"features": {
"clouds_percent": 44,
"humidity_percent": 83,
"pressure": {
"hPa": 1027.12,
"inHg": 30.33,
"mmHg": 770.4
},
"rain": {
"inch_hour": 0,
"mm_hour": 0
},
"snow": {
"inch_hour": 0,
"mm_hour": 0
},
"temperature": {
"celsius": 8.36,
"fahrenheit": 32
},
"wind_direction_degrees": 297.002,
"wind_speed": {
"meters_per_second": 3.42,
"miles_per_hour": 7.65
}
},
"is_current": false,
"measure_time": {
"countdown": 42931,
"datetime": "2018-02-21T03:00:00+0000",
"timestamp": 1519182000
},
"start_datetime": {
"countdown": 39331,
"datetime": "2018-02-21T02:00:00+0000",
"timestamp": 1519178400
},
"weather_conditions": [
{
"description": "scattered clouds",
"icon": "03n",
"icon_url": "http://openweathermap.org/img/w/03n",
"id": 802,
"main": "Clouds"
}
]
}
NBAGames:
Input:
SELECT * FROM NBAGames
WHERE status='FUTURE'
AND (away_team.team_name='Charlotte Hornets'
OR home_team.team_name='Charlotte Hornets')
AND start_datetime.countdown = 3600
Output:
{
"matches_count": 1,
"results": [
{
"_entity_type": "NBAGame",
"_id": "NBAGame_400975613",
"away_score": null,
"away_team": {
"_entity_type": "NBATeam",
"_id": "NBATeam_CHA",
"acronym": "CHA",
"division": "Southeast",
"id": "NBATeam_CHA",
"team_name": "Charlotte Hornets"
},
"game_id": "400975613",
"home_team": {
"_entity_type": "NBATeam",
"_id": null,
"acronym": null
},
"link": "http://espn.go.com/nba/game?gameId=400975613",
"start_datetime": {
"countdown": 137435,
"datetime": "2018-02-23T00:00:00+0000",
"timestamp": 1519344000
},
"status": "FUTURE"
}
]
}
MLBGames:
Input:
SELECT * FROM MLBGames
WHERE status = 'FUTURE'
AND (away_team.team_name = 'Toronto Blue Jays'
OR home_team.team_name = 'Toronto Blue Jays')
AND start_datetime.countdown = 3600
Output:
{
"matches_count": 1,
"results": [
{
"_entity_type": "MLBGame",
"_id": "MLBGame_400962533",
"away_score": null,
"away_team": {
"_entity_type": "MLBTeam",
"_id": "MLBTeam_TOR",
"acronym": "TOR",
"division": "AL East",
"id": "MLBTeam_TOR",
"team_name": "Toronto Blue Jays"
},
"game_id": "400962533",
"home_team": {
"_entity_type": "MLBTeam",
"_id": null,
"acronym": null
},
"link": "http://espn.go.com/nhl/gamecast?gameId=400962533",
"start_datetime": {
"countdown": 135524,
"datetime": "2018-02-23T00:00:00+0000",
"timestamp": 1519344000
},
"status": "FUTURE"
}
]
}
NHLGames:
Input:
SELECT * FROM NHLGames
WHERE status='FUTURE'
AND (away_team.team_name='New Jersey Devils'
OR home_team.team_name='New Jersey Devils')
AND start_datetime.countdown = 3600
Output:
{
"matches_count": 1,
"results": [
{
"_entity_type": "NHLGame",
"_id": "NHLGame_400962534",
"away_score": null,
"away_team": {
"_entity_type": "NHLTeam",
"_id": "NHLTeam_NJ",
"acronym": "NJ",
"division": "Metropolitan Division",
"id": "NHLTeam_NJ",
"team_name": "New Jersey Devils"
},
"game_id": "400962534",
"home_team": {
"_entity_type": "NHLTeam",
"_id": null,
"acronym": null
},
"link": "http://espn.go.com/nhl/gamecast?gameId=400962534",
"start_datetime": {
"countdown": 134517,
"datetime": "2018-02-23T00:00:00+0000",
"timestamp": 1519344000
},
"status": "FUTURE"
}
]
}
CryptoTickers:
Input:
SELECT * FROM CryptoTickers
WHERE market_cap_usd >= 18000000000
StockTickers:
SELECT * FROM StockTickers('AAPL')
WHERE close > 170
I'm been working with Ably Hub - it is a marketplace for open streaming data sources, which are either paid or free to use under different licenses.
Full disclosure: I'm a Developer Advocate for Ably but I think the resources from this marketplace might certainly help you with some cool data viz.
If you are interested in checking out an example - I built a live bitcoin price chart using one of the sources from the Ably Hub and KendoUI.

How JSON format for calling Checking out REST Api of Broadleaf commerce looks like

I have followed setting up Broadleaf to make it running by following its documentation (http://docs.broadleafcommerce.org/current/REST-Tutorials.html). I wanted to do checking out the cart using REST Api; that's, /cart/checkout. Therefore, I looked inside the code in order to understand how the JSON format being sent will look alike. By looking through the code, I found that it is required to pass the JSON data as shown following:
{
"paymentInfo": {
"id": ,
"orderId": ,
"type": ,
"address": {
"id":
"firstname":
"lastname":
"addressLine1":
"addressLine2":
"city":
"state":
"country":
"postalCode":
},
"phone": "",
"additionalFields": "",
"amount": "",
"amountItems": "",
"customerIpAddress": "",
"referenceNumber": ""
},
"referenced": {
"id": "",
"referenceNumber": "",
"type": "",
"pan": "",
"cvvCode:" "",
"expirationMonth": "",
"expirationYear": "",
"accountNumber": "",
"routingNumber": "",
"pin": ""
}
}
However, I have no idea such the JSON data looks like. Therefore, if anyone who has ever used the api, please help me by showing an example of data in order to make the request. Looking forward to the answers.
Thanks in advance.
All of our REST APIs are exposed through a 'wrapper' concept. For instance, there is a CustomerWrapper, OrderWrapper, etc. These wrappers define which properties are serialized back and forth with the REST APIs.
For your specific case, you should look at PaymentReferenceMapWrapper.
{
"id": 1751,
"status": "IN_PROCESS",
"totalTax": {
"amount": "0.00",
"currency": "INR"
},
"totalShipping": {
"amount": "0.00",
"currency": "INR"
},
"subTotal": {
"amount": "860.00",
"currency": "INR"
},
"total": {
"amount": "860.00",
"currency": "INR"
},
"customer": {
"id": 2600
},
"orderItems": [
{
"id": 1752,
"name": "abc",
"quantity": 2,
"retailPrice": {
"amount": "430.00",
"currency": "INR"
},
"salePrice": {
"amount": "430.00",
"currency": "INR"
},
"orderId": 1751,
"categoryId": 10300,
"skuId": 10212,
"productId": 10212,
"isBundle": false,
"orderItemPriceDetails": [
{
"id": 1752,
"totalAdjustmentValue": {
"amount": "0.00",
"currency": "INR"
},
"totalAdjustedPrice": {
"amount": "860.00",
"currency": "INR"
},
"quantity": 2,
"adjustments": []
}
],
"isDiscountingAllowed": true
}
],
"fulfillmentGroups": [
{
"id": 1502,
"orderId": 1751,
"total": {
"amount": "860.00",
"currency": "INR"
},
"fulfillmentGroupItems": [
{
"id": 1752,
"fulfillmentGroupId": 1502,
"orderItemId": 1752,
"totalTax": {
"amount": "0.00",
"currency": "INR"
},
"quantity": 2,
"totalItemAmount": {
"amount": "860.00",
"currency": "INR"
}
}
]
}
],
"payments": [
{
"id": 601,
"orderId": 1751,
"type": "COD",
"amount": "860.00",
"currency": "INR",
"gatewayType": "Passthrough",
"transactions": [
{
"id": 601,
"orderPaymentId": 601,
"type": "AUTHORIZE_AND_CAPTURE",
"success": true,
"amount": "860.00",
"currency": "INR"
}
]
}
]
}
This is the same json you will get from /cart?customerId="" with method GET after successfully executing /cart/checkout/payment