Skip to main content

Quotes API

  1. Overview
  2. List of endpoints
  3. Error codes
  4. Retrieve all quotes
  5. Retrieve a quote by ID
  6. Approve a quote
  7. Reject a quote
  8. Get the order ID for a quote

1. Overview​

The Zakeke Quotes API is a collection of endpoints designed to manage quotes within the Zakeke ecosystem. These APIs allow you to retrieve quotation requests submitted by customers, approve or reject them, and retrieve the associated order ID once a quote has been approved.

2. List of endpoints​

The following are the endpoints available for the Quotes API.

Please Note

All the endpoints have the following base url: https://api.zakeke.com/


warning

All API calls need to be authenticated and authorized via an S2S-type oAuth token. For all the details see the Authentication and Authorization section.


MethodEndpointDescription
GET/v2/quotesRetrieve a paginated list of quotes starting from the most recent ones.
GET/v2/quotes/{quoteId}Retrieve a quote by specifying the ID.
POST/v2/quotes/{quoteId}/approveApprove a quote and create the associated order.
POST/v2/quotes/{quoteId}/rejectReject a quote.
GET/v2/quotes/getOrderIDGet the order ID associated with an approved quote.

In the following sections we will provide details of each endpoint with a description of the information they provide and the operations they perform.

3. Error codes​

In RESTful API calls, such as those made to Zakeke, HTTP status codes are crucial for indicating the outcome of API requests. Codes in the 2xx range signify successful operations, 4xx errors denote client-side issues, and 5xx errors indicate server-side problems. This system allows developers to quickly identify and address issues with API interactions, enhancing the efficiency of integrating with Zakeke's services.

For certain status codes, Zakeke includes an error message in the response body to elucidate the cause of the error. This is particularly useful when a single status code, like 404 Not Found or 400 Bad Request, could indicate various issues. These messages help developers pinpoint the specific problem, facilitating a more efficient troubleshooting process when integrating with Zakeke's APIs.

4. Retrieve all quotes​

This endpoint returns a paginated list of quotes submitted by customers, starting from the most recent ones.

Request​

GET https://api.zakeke.com/v2/quotes

The following are the parameters you can use in query string:

ParameterData typeDescription
pageSizeintegerThe page size of the result. Default is 15.
pageNumberintegerThe number of the page to return. The first page will have pageNumber = 1. Default is 1.
statusintegerFilter quotes by status ID.
dateFromdatetimeFilter quotes created on or after this date.
dateTodatetimeFilter quotes created on or before this date.
formDatastringFilter quotes by form data content.
attributionTypestringFilter quotes by attribution type.
attributionIDstringFilter quotes by attribution ID.
warning

Use pagination parameters and an optimal page size to maintain good performance when running the API.

Response​

The API call returns a JSON array with the following structure:

[
{
"quoteID": 0,
"statusID": 0,
"status": "string",
"amount": 0,
"shippingAmount": 0,
"additionalAmount": 0,
"additionalAmountLabel": "string",
"modelPrice": 0,
"variantName": "string",
"quantity": 0,
"customerCode": "string",
"visitorCode": "string",
"formData": "string",
"createdOn": "2024-01-01T00:00:00Z",
"attributionType": "string",
"attributionID": "string"
}
]

Each item of the array represents a quote and its properties have the following meaning:

PropertyData typeDescription
quoteIDintegerUnique identifier of the quote.
statusIDintegerNumeric identifier of the quote status.
statusstringHuman-readable status of the quote (e.g. Pending, Approved, Rejected).
amountdecimalThe quoted amount.
shippingAmountdecimalThe shipping amount for the quote.
additionalAmountdecimalAny additional amount applied to the quote.
additionalAmountLabelstringLabel describing the additional amount.
modelPricedecimalThe base product price.
variantNamestringName of the product variant.
quantityintegerThe quantity requested by the customer.
customerCodestringThe customer identifier on your ecommerce.
visitorCodestringThe visitor identifier on your ecommerce.
formDatastringThe form data submitted by the customer with the quote request.
createdOndatetimeDate and time the quote was created.
attributionTypestringThe type of attribution for the quote.
attributionIDstringThe attribution identifier for the quote.

Furthermore, when using pagination parameters, the response also returns the following two custom headers:

ParameterData typeDescription
X-Total-CountintegerThe total number of quotes matching the criteria.
X-Has-More-PagesbooleanThere is a page following the current one.

Naturally, HTTP headers have textual content but they can be interpreted in the indicated data type.

HTTP Response Codes​

CodeNameDescription
200OKAPI Call completed successfully. The response body contains the quote list.
401UnauthorizedUnauthorized user. Check the token used for the call.
403ForbiddenUnauthenticated user. Check the token used for the call.

Examples​

Example 1 Get the first 20 quotes.

curl -X GET https://api.zakeke.com/v2/quotes?pageSize=20&pageNumber=1 \
-H "Accept: application/json" \
-H "Authorization: Bearer <Access-Token>"

The response will have the body with the first 20 quotes and the following custom headers:

X-Total-Count: "35" X-Has-More-Pages: "True"

Example 2 Get pending quotes created after a specific date.

curl -X GET "https://api.zakeke.com/v2/quotes?pageSize=10&pageNumber=1&status=1&dateFrom=2024-01-01" \
-H "Accept: application/json" \
-H "Authorization: Bearer <Access-Token>"

5. Retrieve a quote by ID​

This endpoint allows you to obtain the full details of a quote by specifying its ID.

Request​

GET https://api.zakeke.com/v2/quotes/{quoteId}

The quoteId parameter is the unique identifier of the quote in Zakeke.

Response​

The API call returns a JSON object with the following structure:

{
"quoteID": 0,
"statusID": 0,
"status": "string",
"amount": 0,
"shippingAmount": 0,
"additionalAmount": 0,
"additionalAmountLabel": "string",
"modelPrice": 0,
"variantName": "string",
"quantity": 0,
"customerCode": "string",
"visitorCode": "string",
"formData": "string",
"additionalInformations": "string",
"orderDocID": "string",
"designDocID": "string",
"compositionDocID": "string",
"createdOn": "2024-01-01T00:00:00Z",
"attributionType": "string",
"attributionID": "string"
}

The response includes all properties from the list endpoint, plus the following additional fields:

PropertyData typeDescription
additionalInformationsstringAdditional information associated with the quote.
orderDocIDstringThe order document identifier, if the quote has been approved and an order has been created.
designDocIDstringThe design document identifier associated with the quote.
compositionDocIDstringThe composition document identifier associated with the quote.

HTTP Response Codes​

CodeNameDescription
200OKAPI Call completed successfully. The response body contains the requested quote.
401UnauthorizedUnauthorized user. Check the token used for the call.
403ForbiddenUnauthenticated user. Check the token used for the call.
404Not FoundNo quote was found with the ID that matches the request.

Examples​

curl -X GET https://api.zakeke.com/v2/quotes/12345 \
-H "Accept: application/json" \
-H "Authorization: Bearer <Access-Token>"

6. Approve a quote​

This endpoint allows you to approve a quote. When a quote is approved, the associated order is automatically created in Zakeke.

Request​

POST https://api.zakeke.com/v2/quotes/{quoteId}/approve

The quoteId parameter is the unique identifier of the quote to approve.

Response​

The API call returns a JSON object with the following structure:

{
"quoteID": 0,
"status": "string",
"orderID": "string"
}

where:

PropertyData typeDescription
quoteIDintegerThe unique identifier of the quote.
statusstringThe updated status of the quote after approval.
orderIDstringThe identifier of the order created as a result of the approval.

HTTP Response Codes​

CodeNameDescription
200OKAPI Call completed successfully. The quote has been approved and the order created.
401UnauthorizedUnauthorized user. Check the token used for the call.
403ForbiddenUnauthenticated user. Check the token used for the call.
404Not FoundNo quote was found with the ID that matches the request.
409ConflictThe quote cannot be approved because it is in an invalid state (e.g. already approved or rejected).

Examples​

curl -X POST https://api.zakeke.com/v2/quotes/12345/approve \
-H "Accept: application/json" \
-H "Authorization: Bearer <Access-Token>"

7. Reject a quote​

This endpoint allows you to reject a quote.

Request​

POST https://api.zakeke.com/v2/quotes/{quoteId}/reject

The quoteId parameter is the unique identifier of the quote to reject.

Response​

The API call returns a JSON object with the following structure:

{
"quoteID": 0,
"status": "string",
"orderID": null
}

where:

PropertyData typeDescription
quoteIDintegerThe unique identifier of the quote.
statusstringThe updated status of the quote after rejection.
orderIDstringWill be null for rejected quotes as no order is created.

HTTP Response Codes​

CodeNameDescription
200OKAPI Call completed successfully. The quote has been rejected.
401UnauthorizedUnauthorized user. Check the token used for the call.
403ForbiddenUnauthenticated user. Check the token used for the call.
404Not FoundNo quote was found with the ID that matches the request.
409ConflictThe quote cannot be rejected because it is in an invalid state (e.g. already approved or rejected).

Examples​

curl -X POST https://api.zakeke.com/v2/quotes/12345/reject \
-H "Accept: application/json" \
-H "Authorization: Bearer <Access-Token>"

8. Get the order ID for a quote​

This endpoint allows you to retrieve the order ID associated with an approved quote.

Request​

GET https://api.zakeke.com/v2/quotes/getOrderID?quoteId={quoteId}

The quoteId query parameter is the unique identifier of the quote.

Response​

The API call returns a JSON object with the following structure:

{
"quoteID": 0,
"orderID": "string"
}

where:

PropertyData typeDescription
quoteIDintegerThe unique identifier of the quote.
orderIDstringThe identifier of the order associated with the approved quote.
warning

This endpoint only returns a result for approved quotes that have an associated order. If the quote has not been approved yet, a 400 Bad Request response will be returned.

HTTP Response Codes​

CodeNameDescription
200OKAPI Call completed successfully. The response body contains the order ID.
400Bad RequestThe quote has no associated order. Only approved quotes have an order.
401UnauthorizedUnauthorized user. Check the token used for the call.
403ForbiddenUnauthenticated user. Check the token used for the call.
404Not FoundNo quote was found with the ID that matches the request.

Examples​

curl -X GET "https://api.zakeke.com/v2/quotes/getOrderID?quoteId=12345" \
-H "Accept: application/json" \
-H "Authorization: Bearer <Access-Token>"