Zoho Inventory API json - api

When I run a test GET call in postman I get back the following json
"code": 0,
"message": "success",
"packages": [
{
"package_id": "1041677000009727045",
"salesorder_id": "1041677000009727003",
"shipment_id": "",
"customer_id": "1041677000007872931",
"customer_name": "TEST",
"status": "not_shipped",
"package_number": "PKG-00005",
"tracking_number": "",
"is_tracking_enabled": false,
"shipping_charge": 0,
"date": "2019-02-26",
"quantity": 1,
"salesorder_number": "SO-00023",
"created_time": "2019-02-26T16:13:11-0500",
"delivery_method": "",
"last_modified_time": "2019-02-26T16:13:11-0500",
"shipment_date": "",
"is_carrier_shipment": false,
"associated_packages_count": 0
},
],
"page_context": {
"page": 1,
"per_page": 200,
"has_more_page": false,
"report_name": "zom.common.Packages",
"applied_filter": "Status.All",
"custom_fields": [],
"sort_column": "created_time",
"sort_order": "D"
}
}
My issue is that the API request does not show line_items as shown in the documentation (https://www.zoho.com/inventory/api/v1/#Packages).
Does anyone know if the line_items exist but it just can't be seen as a json (e.g. I can update them but postman just cant view them?)
Had a support ticket in with Zoho but they haven't replied.

Try retrieving one package with the postman version of:
curl https://inventory.zoho.com/api/v1/packages/{package_id}
It should display the line_items per this documentation:
https://www.zoho.com/inventory/api/v1/packages/#retrieving-a-package

Related

Sandbox access token not working [Easyship]

We have to try to integrate Easyship courier API. And We are facing the below issue.
{
"rates": [],
"messages": [
"Sorry, we couldn't find any shipping solutions based on the information provided."
]
}
For more information, I have shared the request parameter and API response.
API URL:- https://api.easyship.com/v2/rates
Request Parameter:
{
"origin_address": {
"postal_code": "91601",
"city": "Los Ángeles",
"state": "CA",
"country_alpha2": "US"
},
"destination_address": {
"postal_code": "95140",
"city": "Mount Hamilton",
"state": "CA",
"country_alpha2": "US"
},
"parcels": [
{
"total_actual_weight": 5,
"items": [
{
"quantity": 1,
"category": "mobile_phones",
"dimensions": {
"width": 10,
"height": 10,
"length": 25
},
"description": "Apple iPad",
"actual_weight": 5,
"declared_currency": "USD",
"declared_customs_value": 49500.55
}
]
}
]
}
Response Parameter:
{
"status": "failure",
"errors": [
"Sorry, we couldn't find any shipping solutions based on the information provided."
],
"request_id": "545b5f76a41e2994a13f384559dee625",
"timestamp": "2022-10-12T10:09:21.272Z"
}
Note:
This request parameter works with the production access token.
We have applied all possible solutions for this issue but didn't find anything.
Also we don't want to use the production access token because we are in the developing stage. so please please provide working with a sandbox solution.

How to add query parameters in Zoom API (GET) request?

I'm trying to get all meeting recordings saved in the cloud in a date range using using the following API:
https://marketplace.zoom.us/docs/api-reference/zoom-api/cloud-recording/recordingslist
This is the API response I'm getting in postman.
{
"from": "2021-06-01",
"to": "2021-06-02",
"page_count": 1,
"page_size": 30,
"total_records": 1,
"next_page_token": "",
"meetings": [
{
"topic": "Meeting Room",
"type": 4,
"start_time": "2021-06-02T10:00:47Z",
"timezone": "Asia/Calcutta",
"duration": 0,
"total_size": 0,
"recording_count": 0,
"recording_files": [
{
"recording_start": "2021-06-02T10:02:39Z",
"recording_end": "2021-06-02T10:05:29Z",
"file_type": "MP4",
"file_extension": "MP4",
"file_size": 3181252,
"status": "completed",
"recording_type": "shared_screen_with_speaker_view"
},
{
"recording_start": "2021-06-02T10:02:39Z",
"recording_end": "2021-06-02T10:05:29Z",
"file_type": "M4A",
"file_extension": "M4A",
"file_size": 2694678,
"status": "completed",
"recording_type": "audio_only"
}
]
}
]
}
I am unable to get all the recordings of the desired time range. The "from" and "to" parameters are not changing even after trying the below query.
https://api.zoom.us/v2//users/me/recordings?from="2020-07-01"&to="2021-06-01"
In postman use this API
https://api.zoom.us/v2/users/{{user id}}/recordings?from=2022-01-01&meeting_id={{meeting id}}
Thanks to #ajaidanial

How to add the payment transaction status in order placed by using Demandware OCAPI?

I'm developing API for the mobile app of e-commerce website which is on Demandware. I am using the OCAPI 18.8 to place an order and send the payment details to third-party payment processor which is Vantiv. I get the transaction ID and response code from Vantiv and want to update my order to store these payment transaction details into my order. But I could not find any resource in OCAPI which let me add the transaction Id and response code received from Vantiv. Below is the order which I have placed through OCAPI:
{
"_v": "18.8",
"_type": "order",
"_resource_state": "xyz",
"adjusted_merchandize_total_tax": 0,
"adjusted_shipping_total_tax": 0,
"billing_address": {
"_type": "order_address",
"city": "Boston",
"country_code": "US",
"first_name": "John",
"full_name": "John Martin",
"id": "xyz",
"last_name": "Martin"
},
"channel_type": "storefront",
"confirmation_status": "not_confirmed",
"created_by": "Customer",
"creation_date": "2018-11-20T10:37:58.055Z",
"currency": "USD",
"customer_info": {
"_type": "customer_info",
"customer_id": "xyz",
"customer_name": "Ammar Shahbaz",
"customer_no": "xyz"
},
"customer_name": "Ammar Shahbaz",
"export_status": "not_exported",
"last_modified": "2018-11-20T10:37:58.376Z",
"merchandize_total_tax": 0,
"notes": {
"_type": "simple_link",
"link": "link"
},
"order_no": "123",
"order_token": "xyz",
"order_total": 299.8,
"payment_instruments": [
{
"_type": "order_payment_instrument",
"amount": 299.8,
"payment_card": {
"_type": "payment_card",
"card_type": "Visa",
"credit_card_expired": false,
"expiration_month": 1,
"expiration_year": 2021,
"holder": "John Doe",
"masked_number": "************4240",
"number_last_digits": "4240"
},
"payment_instrument_id": "xyz",
"payment_method_id": "CREDIT_CARD"
}
],
"payment_status": "not_paid",
"product_items": [
{
"_type": "product_item",
"adjusted_tax": 0,
"base_price": 149.9,
"bonus_product_line_item": false,
"gift": false,
"item_id": "xyz",
"item_text": "Long Sleeve Sequin Shift Dress",
"price": 299.8,
"price_after_item_discount": 299.8,
"price_after_order_discount": 299.8,
"product_id": "xyz",
"product_name": "Dress",
"quantity": 2,
"shipment_id": "xyz",
"tax": 0,
"tax_basis": 299.8,
"tax_class_id": "xyz",
"tax_rate": 0,
"c_cost": 25.17,
"c_finalSale": false,
"c_outlet": false,
"c_taxClassID": "xyz"
}
],
"product_sub_total": 299.8,
"product_total": 299.8,
"shipments": [
{
"_type": "shipment",
"adjusted_merchandize_total_tax": 0,
"adjusted_shipping_total_tax": 0,
"gift": false,
"merchandize_total_tax": 0,
"product_sub_total": 299.8,
"product_total": 299.8,
"shipment_id": "xyz",
"shipment_total": 299.8,
"shipping_address": {
"_type": "order_address",
"city": "Boston",
"country_code": "US",
"first_name": "John",
"full_name": "John Martin",
"id": "xyz",
"last_name": "Martin"
},
"shipping_method": {
"_type": "shipping_method",
"description": "Order received within 5-8 business days",
"id": "xyz",
"name": "Standard",
"price": 0,
"shipping_promotions": [
{
"_type": "shipping_promotion",
"callout_msg": "Free shipping on U.S. orders of $125+",
"link": "link",
"promotion_id": "xyz",
"promotion_name": "Free Shipping With $125 Purchase"
}
],
"c_BxFlatrateFlag": false,
"c_IsBorderlinxMethod": false
},
"shipping_status": "not_shipped",
"shipping_total": 0,
"shipping_total_tax": 0,
"tax_total": 0
}
],
"shipping_items": [
{
"_type": "shipping_item",
"adjusted_tax": 0,
"base_price": 0,
"item_id": "xyz",
"item_text": "Shipping",
"price": 0,
"price_after_item_discount": 0,
"shipment_id": "xyz",
"tax": 0,
"tax_basis": 0,
"tax_class_id": "xyz",
"tax_rate": 0
}
],
"shipping_status": "not_shipped",
"shipping_total": 0,
"shipping_total_tax": 0,
"site_id": "site name",
"status": "created",
"taxation": "net",
"tax_total": 0
}
I have tried this resource
Patch /orders/{order_no}/payment_instruments/{payment_instrument_id}
{
"amount" : 299.8,
"payment_card" : {
"number":"424459xxxxxx4240",
"security_code":"121",
"holder":"John Martin",
"card_type":"Visa",
"expiration_month":1,
"expiration_year":2021
},
"payment_method_id" : "CREDIT_CARD",
"c_PaymentProcessor": "VANTIV_CREDIT",
"c_paymentTransaction": {
"custom": {
"litleAFTresponse": "Approved",
"litleAFTTxnId": "8283868xxx8288282"
}
}
}
to update my order but no success.
Please let me know if you have any suggestion. Thanks.
If you have payment auth occurring outside of commerce cloud for some reason, you may be able to handle things in custom request document attributes. Note that there's an option to skip 'authorization' in CC by the skip_authorization parameter. eg:
POST /shop/v19_3/orders/00000027/payment_instruments?skip_authorization=true HTTP/1.1
Host: example.com
Authorization:Bearer eyJfdiI6IjXXXXXX.eyJfdiI6IjEiLCJleHAXXXXXXX.-d5wQW4c4O4wt-Zkl7_fiEiALW1XXXX
Content-Type: application/json
{
"amount": 49.99,
"payment_method_id": "MY_PAYMENT_METHOD",
"c_payment_token": "tokenvaluehere==",
"c_payment_status": "payment_status"
}
Then within your dw.ocapi.shop.order.payment_instrument.afterPOST you could add attributes to the Order's PaymentInstrument via the B2C API methods which are accessible via the callback's order parameter.
You'll want to check in the beforePOST hook to ensure that the c_payment_status param is an acceptable value and if not return a Status.ERROR type of status object. Then you can actually save the properties in the afterPOST hook where the objects you'll need are already created.
For example:
exports.paymentInstrumentAfterPOST = function(order, paymentInstrumentRequest) {
const PaymentTransaction = require('dw/order/PaymentTransaction');
const Status = require('dw/system/Status');
const Transaction = require('dw/system/Transaction');
let methodId = paymentInstrumentRequest.payment_method_id;
let instruments = order.getPaymentInstruments(methodId);
let instrument = instruments[0]; // FIXME you should actually iterate over this instead; just for demo
let paymentTransaction = instrument.getPaymentTransaction();
Transaction.begin();
paymentTransaction.setTransactionID(paymentInstrumentRequest.c_payment_token);
paymentTransaction.setType(PaymentTransaction.TYPE_AUTH);
Transaction.commit();
return new Status(Status.OK);
}
For more info on customizing the payment flow, see the Orders resource documentation
Disclaimer this is all code written free-hand in StackOverflow's answer form. I have not validated that this will actually run, but I hope it provides direction.
Internally in commerce cloud the below method call sets the transaction id: paymentInstrument.paymentTransaction.setTransactionID(anTransactionId) so your assumption is correct. This field is however not exposed in the shop API. From the documentation is is clear that the authorization of the payment should be triggered by commerce cloud. this is a security constraint. It is possible to customize the API to circumvent this limitation.
The platform itself has some internal workflows that you must follow step by step to complete an order via OCAPI Rest Api. You should follow the step by step workflow or if you don't find it ask your DW architect to guide you.
As of today, the platform provides a better way to handle this requirement. Under DATA API Endpoints you have now several entires to update overall order status, payment, shipment, or even shipping address. More details under official release notes:
You can now use Data API endpoints to update orders in server-to-server use cases, such as when an order management system or payment provider initiates a change.
Use new PUT commands to update the different types of order statuses.
PUT /sites/{site_id}/orders/{order_no}/confirmation_status
PUT /sites/{site_id}/orders/{order_no}/export_status
PUT /sites/{site_id}/orders/{order_no}/external_status
PUT /sites/{site_id}/orders/{order_no}/payment_status
PUT /sites/{site_id}/orders/{order_no}/shipping_status
PUT /sites/{site_id}/orders/{order_no}/status
Use a new PUT command to update an order’s shipping address.
PUT /sites/{site_id}/orders/{order_no}/shipments/{shipment_id}/shipping_address
Use new PATCH commands to update order and payment attributes.
PATCH /sites/{site_id}/orders/{order_no}
PATCH /sites/{site_id}/orders/{order_no}/payment_instruments/{payment_instrument_id}
PATCH /sites/{site_id}/orders/{order_no}/payment_instruments/{payment_instrument_id}/transaction
source: https://help.salesforce.com/articleView?id=sf.b2c_20_2_W6833203_ocapi_order_update_endpoints_as.htm&type=5

Why does /4.0/events/ return NotFoundError in the SocialTables API?

I create several new events in my account. But when I call this endpoint - https://api.socialtables.com/4.0/events/ - I always receive a 404 response with this body:
{
"code": "NotFoundError",
"message": ""
}
If I call the legacy endpoint - https://api.socialtables.com/4.0/legacyvm3/teams/[TEAM-ID]/events - it returns both the legacy events and the new events. But it only tells me the legacy ID values. I guess that's okay, but it's confusing. It looks like I am unable to use the v4 API at all.
Follow-up from this question: Why am I getting 401 UnauthorizedError when getting a list of events using the SocialTables API?
I see it now. Don't use a trailing slash when requesting the /events route:
https://api.socialtables.com/4.0/events
Hmmm not exactly sure where the disconnect is. I just ran that endpoint with your most recent oauth token and got the following result:
[
{
"permissions": [
"CHANGE_OWNER",
"ADD_PLANNER",
"REMOVE_PLANNER",
"ADD_VIEWER",
"REMOVE_VIEWER",
"ADD_CHECKIN",
"REMOVE_CHECKIN",
"UPDATE_EVENT",
"DELETE_EVENT",
"UPDATE_GUEST",
"DELETE_GUEST",
"CREATE_GUEST",
"CHECKIN_GUEST",
"CAN_VIEW"
],
"data": {
"id": "19fdb5e0-1874-11e7-a3a0-65cadad84d84",
"name": "Test Event 5",
"type": "Athletic Event",
"description": null,
"start_epoch": 1492660800000,
"end_epoch": 1492660800000,
"archived": 0,
"deleted": 0,
"status": "ACTIVE",
"has_time": 1,
"timezone": null,
"legacy_id": 1962925,
"industry": "Corporate",
"role": "owner"
}
},
{
"permissions": [
"CHANGE_OWNER",
"ADD_PLANNER",
"REMOVE_PLANNER",
"ADD_VIEWER",
"REMOVE_VIEWER",
"ADD_CHECKIN",
"REMOVE_CHECKIN",
"UPDATE_EVENT",
"DELETE_EVENT",
"UPDATE_GUEST",
"DELETE_GUEST",
"CREATE_GUEST",
"CHECKIN_GUEST",
"CAN_VIEW"
],
"data": {
"id": "e77c8e50-1703-11e7-a3a0-65cadad84d84",
"name": "test event v4",
"type": "Ceremony",
"description": null,
"start_epoch": null,
"end_epoch": null,
"archived": 0,
"deleted": 0,
"status": "ACTIVE",
"has_time": 0,
"timezone": null,
"legacy_id": 1962858,
"industry": "Education",
"role": "owner"
}
}
]
Here's a curl of what I did minus your real token.
curl --request GET \
--url https://api.socialtables.com/4.0/events \
--header 'authorization: Bearer XXXXXXXXXXXXXXXXXXXXXX7063f'
How are you retrieving your token?

Add Account (POST) Endpoint No Longer Working in new Yodlee API

OVERVIEW
I am not sure what happened, as I have not touched my code that interacts with the Add Account endpoint in Yodlee (POST /{cobrandName}/v1/providers/{providerId}), but it has become broken (it was working as of Thursday). I am now getting this reply:
{ errorCode: 'Y400',
errorMessage: 'Null argument specified',
referenceCode: 'RB_134ae91e-4c80-4ad5-aac5-243ca428421d' }
DETAILS
I have the appropriate route params inserted into this POST /{cobrandName}/v1/providers/{providerId} and am passing a stringified JSON object as the request body (per the documentation) that looks like this:
{
"provider": [{
"id": 492,
"name": "Fidelity Investments",
"loginUrl": "https://login.fidelity.com/ftgw/Fas/Fidelity/RtlCust/Login/Init?AuthRedU",
"baseUrl": "http://www.fidelity.com/",
"favicon": "https://moneycenter.ydlstatic.com/fastlink/appscenter/siteImage.fastlink.do?access_type=APPS_CENTER_PRODUCTION&siteId=492&imageType=FAVICON",
"logo": "https://moneycenter.ydlstatic.com/fastlink/appscenter/siteImage.fastlink.do?access_type=APPS_CENTER_PRODUCTION&siteId=492&imageType=LOGO",
"status": "Supported",
"mfaType": "Multiple levels of strong authentication.",
"oAuthSite": false,
"lastModified": "2016-03-31T10:39:36Z",
"forgetPasswordUrl": "http://personal.fidelity.com/accounts/services/content/pinchange.shtml.tvsr",
"containerNames": ["tax", "investment"],
"loginForm": {
"id": 172,
"forgetPasswordURL": "http://personal.fidelity.com/accounts/services/content/pinchange.shtml.tvsr",
"formType": "login",
"row": [{
"id": 4140,
"label": "Username",
"form": "0001",
"fieldRowChoice": "0001",
"field": [{
"id": 358,
"name": "LOGIN",
"maxLength": 15,
"type": "text",
"value": "07ceb28fc8b71dc3e08126e0169022419c114e02cbca7fcfb2e11b939d805c898310d0741bcc0a76943227a38c02e66fd5a5fb132a3c0fb4c663102b9e0947c99953f15fa051ac95fdf9a3ee7d461d33ff11482a3cf973ccd3c2aba6d494deb6ddd1d0dfc89ee0bfa991bf24e19d07bd9f066bbde4fd74ed88f3808ab7420f1430b1ead362a32dd26d5b077f263c83469c37a3c8816b7eaa243f9f89dc4ad4e023642ba1aa651d4b371f613d37619279d90187d11bbd4404896d18605c028bd55461c6e11b47a8aad8ea93d483db7c1211728c9b1222a86811a106077ae5525c75f427520d52478e48f22f6ae11a21bcb42e772befa2e83570c4b4d7c3a54619",
"isOptional": false,
"valueEditable": true
}]
}, {
"id": 4139,
"label": "Password",
"form": "0001",
"fieldRowChoice": "0002",
"field": [{
"id": 357,
"name": "PASSWORD",
"maxLength": 20,
"type": "password",
"value": "285968df9ddf385b2da03d7247533dd0f7dbf6d951c0a6a92bad7701868d4941bcdfe7a41167f3bb0a47cb5ae22557444f83a641318c1985035c6e2c7e7e11a4e71ac52965ad26845ee64a13a2a61c07945870b7c009aba673e01b074fc047e9b08c20cbde0cb36a6068a9d07b4cad7a777f8f6654dd8436527d6017e3a81af68f1dbbfabc52a93a2f8423b342b243316248cebb549bed7433f77a90aae4a3c1c892a725872f77a369407741be98715b39039b547f735e92748ddd5d389c4de3082684c1f5f5b1917ceb34348010866ce6cb649d6e4dac4c45d85c4a729c67fb643c34e704278f3a15626bbe73cddf69cfe5df8bcdd5682415afe952585da800",
"isOptional": false,
"valueEditable": true
}]
}]
}
}]
}
The form values are encrypted via PKI as per the documentation, using the key provided by the appropriate API endpoint, and I have both a cobrand session token and a yodlee user session token in the authentication headers ('Authorization': 'cobSession={appToken}, userSession={token}'). I was previously receiving back the expected 'refresh info' response using the same exact structure and process. I'm trying to understand what the 'null argument' referenced in the error is.