Professional Documents
Culture Documents
Attachment - 1578298317573110001 - Attach - 137975909564870000 - 1578298317573110001 - SalesOrders API
Attachment - 1578298317573110001 - Attach - 137975909564870000 - 1578298317573110001 - SalesOrders API
Attachment - 1578298317573110001 - Attach - 137975909564870000 - 1578298317573110001 - SalesOrders API
The Zoho Commerce API allows you to perform all the operations that you do with our web
client. Zoho Commerce API is built using REST principles which ensures predictable URLs that
makes writing applications easy. This API follows HTTP rules, enabling a wide range of HTTP
clients can be used to interact with the API. Every resource is exposed as a URL. The URL of each
resource can be obtained by accessing the API Root Endpoint.
OAuth
Zoho REST APIs uses the OAuth 2.0 protocol to authorize and authenticate calls (The above
approach of authentication via Authtoken will be deprecated soon). It provides secure access to
protect resources thereby reducing the hassle of asking for a username and password everytime
a user logs in. Follow the steps listed here, to access Zoho’s APIs using OAuth 2.0
On successful registration, you will be provided with a set of OAuth 2.0 credentials such as a
Client ID and Client Secret that are known to both Zoho and your application. Do not share this
credentials anywhere.
https://accounts.zoho.com/oauth/v2/auth?
Parameter Description
response_type * code
https://accounts.zoho.com/oauth/v2/token?
Parameter Description
grant_type* authorization_code
https://accounts.zoho.com/oauth/v2/token?
Parameter Description
grant_type refresh_token
Request Example :
https://accounts.zoho.com/oauth/v2/token?
Parameter Description
Request Example :
Access Token can be passed only in header and cannot be passed in the request param.
Header name should be Authorization
Header value should be Zoho-oauthtoken {access_token}
Organization ID
In Zoho Commerce, your business is termed as an organization. If you have multiple businesses,
you simply set each of those up as an individual organization. Each organization is an
independent Zoho Commerce Organization with it’s own organization ID, base currency, time
zone, language, contacts, reports, etc.
The parameter organization_id along with the organization ID should be sent in with every API
request to identify the organization.
The organization_id can be obtained from the GET /organizations API’s JSON response.
Alternatively, it can be obtained from the Manage Organizations page in the admin console:
Login to the Zoho Inventory admin console. Click the drop down with organization’s name as the
label and click Manage Organizations.
Request Example
RESPONSE
HTTP Methods
Zoho Commerce API uses appropriate HTTP verbs for every action.
Method Description
Using GET method, you can get the list of resources or details of a particular instance of a
resource.
To get a list of salesorders
The response structure for the salesorders API follows the below format.
SUCCESS
Other Formats
Certain APIs support csv and pdf formats as well for which the required response format needs
to be specified in the respective request’s Accept header or accept query parameter.
Date
Example: 2016-06-11T17:38:06-0700
Request Example
Response Header Example
Errors
Zoho Commerce uses HTTP status codes to indicate success or failure of an API call. In general,
status codes in the 2xx range means success, 4xx range means there was an error in the provided
information, and those in the 5xx range indicate server side errors. Commonly used HTTP status
codes are listed below.
Request Example
Response Example
FAILURE
Pagination
Zoho Commerce provides APIs to retrieve lists of products, salesorders and other resources -
paginated to 200 items by default. The pagination information will be included in the list API
response under the node name page_context.
* By default first page will be listed. For navigating through pages, use the page parameter.
* The per_page parameter can be used to set the number of records that you want to receive in
response.
Example
SUCCESS
API Call Limit
API calls are limited to provide better quality of service and availability to all the users. You can
send a maximum of 1000 API requests per day per organization during the free plan. However, if
the organization is on a paid plan you can send up to 2500 API requests per day per
organization.
SalesOrders
A sales order is a financial document that confirms an impending sale. It details the exact
quantity, price and delivery details of the products or services being sold. Perform the simple
operations mentioned below to retrieve your Sales Orders.
OAuthScope
ZohoCommerce.salesorders.ALL
Headers
Header Values
Authorization Zoho-oauthtoken
1001.c827a747d852fea057e71b1a526c69cf.
bf9e2c6d2640506d00793a215c871989
X-com-zoho-store-organizationid 58927961
Attributes
Attribute Description
salesorder_id long: Unique ID generated by the server for
the Sales Order. This is used as identifier.
salesorder_number string: The Sales Order number. This is unique
for each sales order.
date string: The date for the Sales Order.
order_status string: The current status of the Sales Order.
Allowed
Values: pending, confirmed, completed, retu
rned, cancelled and declined.
shipment_date string: Shipment date of the Sales Order.
reference_number string: Reference number of the Sales Order.
customer_id long: Unique ID generated for the customer.
This is used as an identifier.
customer_name string: Name of the customer.
currency_id long: Unique ID generated by the server for
the currency. This is used as an identifier.
currency_code string: Currency code.
currency_symbol string: The symbol for the selected currency.
total double: Total amount of the Sales Order.
is_emailed boolean: Checks whether the Sales Order has
been emailed to the customer or not.
created_time string: Time at which the Sales Order was
created.
last_modified_time string: Time at which the sales order details
were last modified.
contact_persons list: Person/Individual who represents a
company
billing_address object: Billing address of the contact.
shipping_address object: Customer's shipping address to which
the goods must be delivered.
exchange_rate double: Exchange rate of the currency, with
respect to the base currency.
discount_amount double: Discount to be applied on the Sales
Order.
discount double: The percentage of Discount applied.
discount_type string: Type of discount.
Allowed values are entity_level,item_level.
For entity_level type, discount is applied at
entity level and the node discount resides
outside the line_items node.For item_level
type, discount is applied at item level and the
node discount resides inside each line_item
under the line_items node
line_items list: A sales order can contain multiple line
items. Each line item contains item_id, name,
description, rate, quantity, unit, tax_id,
tax_name, tax_type, tax_percentage,
item_total.
shipping_charge double: Shipping charges that can be applied
to the Sales Order.
adjustment double: Adjustment on the Sales Order's
total.
adjustment_description string: Description for the adjustment.
sub_total double: Sub total of the Sales Order.
tax_total double: Tax total of the Sales Order.
taxes list: Number of taxes applied on sales order.
Each tax contains: tax_name and tax_amount.
price_precision integer: The precision level for the price's
decimal point in a Sales Order.
packages list: These are the packages created for Sales
Orders. Each package contains - package_id,
package_number, status, detailed_status,
status_message, shipment_id,
shipment_number, shipment_status, carrier,
service, tracking_number, shipment_date,
delivery_days and delivery_guarantee.
notes string: Notes for the Sales Order.
terms string: Terms for the Sales Order.
invoiced_status string: The current status of the invoice.
Allowed Values: paid, unpaid, refunded,
cancelled and declined.
shipped_status string: The current status of the package.
Allowed Values: paid, unpaid, refunded,
cancelled and declined.
payment_mode string: Mode through which payment is
made.
This can be Cash On Delivery, Razorpay,
Stripe or others. Maximum length [100].
is_offline_payment boolean: Checks whether the payment was
made offline.
List all Sales Orders
HTTP Request
GET https://commerce.zoho.com/store/api/v1/salesorders
Query Parameters
Parameter Values
filter_by Status.All, Status.Draft, Status.Confirmed,
Status.ToBePacked, Status.ToBeShipped,
Status.Shipped, Status.ToBeInvoiced,
Status.Closed, Status.Void
sort_column customer_name, salesorder_number, date,
shipment_date, total, bcy_total, created_time,
last_modified_time
sort_order A, D
page_start_from 1 to n
per_page 10,25,50,100,200
Search Nodes
Parameter Values
customer_id 3000000002259
salesorder_number_contains SO-00002
email peterparker@bowmanfurniture.com
mobile 9876543210
order_status draft,pending,confirmed,closed,void,onhold,ca
ncelled
invoiced_status null,partially_invoiced,invoiced,paid
paid_status null,unpaid,partially_paid,paid
shipped_status null,pending,partially_shipped,shipped,fulfille
d
return_status null,initiated,partially_returned,returned
return_shipment_status null,receive_pending,partially_received,receiv
ed
refund_status null,refund_pending,partially_refunded,refund
ed
is_return_waiting_for_approval true,false
is_cancel_item_waiting_for_approval true,false
Request Example
Response Example
SUCCESS
Retrieve a Sales Order
HTTP Request
GET https://commerce.zoho.com/store/api/v1/salesorders/order_id
Request Example
Response Example
SUCCESS
Update Status
Update Status
Changes the status of a Sales Order.
POST https://commerce.zoho.com/store/api/v1/salesorders/{salesorder_id}/status/{status}
Status values
Status Description
Request Example
Response Example
SUCCESS
Add Comments
HTTP Request:
POST https://commerce.zoho.com/store/api/v1/salesorders/{salesorder_id}/comments
Body Parameters
Parameter Description
Request Example
SUCCESS
FAILURE
Update address
Update Address :
HTTP Request :
PUT
https://commerce.zoho.com/store/api/v1/salesorders/{salesorder_id}/address/{address_type
}
Address types
Type Description
Body Parameters
Parameter Description
Request Example
Response Example
SUCCESS
FAILURE
Shipment Orders
Shipment Orders
A document used by an organization to specify what items or packages are to be transferred
from a storage location or warehouse to what person and to what new location is called a
shipment order. It is typically sent along with a shipment of goods so that the person receiving
them(your customer) can verify that the document correctly reflects the items that they actually
received.
Attributes
Attribute Description
salesorder_id string: Unique ID generated by the server for
the Sales Order. This is used as identifier.
Mark as Shipped
Use this API to mark your order as shipped
POST
https://commerce.zoho.com/store/api/v1/salesorders/{salesorder_id}/shipmentorders/shipp
ed
Body Params
Attribute Description
Request Example
Response Example
SUCCESS
FAILURE
Mark as Delivered
Mark as Delivered
Use this API to mark your salesorder as delivered.
POST
https://commerce.zoho.com/store/api/v1/salesorders/{salesorder_id}/shipmentorders/deliver
ed
Body Params
Attribute Description
Request Example
Request Example
SUCCESS
FAILURE
Update Shipment Order
HTTP Request:
PUT https:/commerce.zoho.com/store/api/v1/salesorders/{salesorder_id}/shipmentorders
Attributes
Attribute Description
salesorder_id string: Unique ID generated by the server for
the Sales Order. This is used as identifier.
shipment_date string: Shipment date of the Sales Order.
Request Example
Response Example
SUCCESS
FAILURE
Customer Payments
Customer Payments
A payment object describes details regarding a particular customer payment. There can be
multiple payments for a single invoice. Multiple invoices can be paid in a single payment as well.
Attributes
Attribute Description
Mark as Paid
Use this API to mark your unpaid order as paid.
POST
https://commerce.zoho.com/store/api/v1/salesorders/51128000000104005/payments
Parameters
Attribute Description
payment_mode string: Mode through which payment is made.
This can be check, cash, creditcard,
banktransfer, bankremittance,
autotransaction or others.
Maximum length [100]
amount double: Amount paid in the respective
payment.
reference_number string: Reference number generated for the
payment. A string of your choice can also be
used as the reference number. Maximum
length of the reference number [100]
Request Example
Response
SUCCESS
FAILURE
Update Payment
Update Payment
Use this API to update payment information.
PUT
https://commerce.zoho.com/store/api/v1/salesorders/{salesorder_id}/payments/{payment_id
}
Attributes
Attribute Description
Request Example
Response Example
SUCCESS
FAILURE
Refund Payment
Refund Payment
Use this API to refund your payment.
POST https://commerce.zoho.com/store/api/v1/salesorders/{salesorder_id}/refund
Parameters
Attribute Description
Request Example
Response
SUCCESS
FAILURE
Create a Sales Return
HTTP Request
POST https://commerce.zoho.com/store/api/v1/salesreturns
Query Parameters
Parameter Description
Body Parameters
Parameter Description
Request Example
SUCCESS
FAILURE
Change Status
Change Status :
HTTP Request :
POST
https://commerce.zoho.com/store/api/v1/salesreturns/{salesreturn_id}/status/{salesreturn_s
tatus}
Attributes
Attribute Description
salesreturn_id long: Unique ID generated by the server for
the Sales Return. This is used as identifier.
Statuses
Status Description
approved string: To approve the status of the
salesreturn
Request Example
Response Example
SUCCESS
FAILURE
Refund a SalesReturn
Refund a SalesReturn:
HTTP Request:
POST https://commerce.zoho.com/store/api/v1/salesreturn/{salesreturn_id}/refund
Query Parameters
Parameter Description
Body Parameters
Parameter Description
Request Example
Response
SUCCESS
FAILURE