Commerce Services: V1
Commerce Services API Reference Information
This is the complete reference for Intel® Cloud Services Platform beta Commerce Services REST Interface Version 1. This discussion assumes that you already have a basic understanding of Commerce Services REST APIs. If not, see the Intel Cloud Platform Services beta Commerce Services REST Developer's Guide.
Commerce Services API Reference Information
The following list provides basic information to help implement Commerce Services API calls:
- All developers must have an Intel® Identity Services account established and a commerce store established. See the tutorial links in the Intel Cloud Platform Services beta Commerce Services REST Developer's Guide to find out how to do this.
- Calls to execute purchases require the user to have an Intel Identity account and to have given permission to the app to access their information. Information to help user's create their accounts is provided in the End User Signup Tutorial.
- The app must place the access token for the Commerce session in the HTTP header (or in the URI) prior to executing each call. The descriptions below assume that authorization is already complete and that the app already has a valid access token.
- The Commerce Services return response status for each call in the HTTP response is in JSON (JavaScript* Object Notation) format only.
- Data transferred between apps and the Commerce Services data structure (e.g., cartStructure) is performed in JSON format.
- Limited anonymous browsing sessions by users are supported by many of the cart calls. Anonymous browsing means the user either: (1) does not have an Intel Identity account, (2) has not yet given permission to share their information with the service, or (3) the application has not provided their information. Anonymous use allows users to create carts and add items to the cart or remove them, without sharing their identities with the app.
- The term "user" in this document refers to the consumer, the person using the app to perform a commerce activity such as making a purchase.
Note: The following terms have been updated: "application authorization" has replaced "basic access", "user authorization" has replaced "extended access", and "API Management layer" has replaced "Services Gateway".
Note: Because tokens are long, in API calls we usually substitute {access_token} or {refresh_token} for the real tokens. For calls that include elements like client ID, client secret, and user ID, we usually substitute {client_id}, {client_secret}, and {user id}, and for the real elements. In some cases, like initial use, we may show the real token or element. An example access token is shown below:
2/gAAAAB-gK_mJ8IW5-PQX8LkMkHXAl4viM0vRppECIkBVmfR1SOeQgvhLQnQzrwWKnbbsW1AKBzKss6eD0H3p0HMtIwtbgFQpeiqf0hDUEQlXTbt4UpKphIcV95Gc0C3PtkgNboV1TLGCC_bu5gLFXQJGAhmB6lkcJ5UwHGyn8BxFoayTdAEAAIAAAACDjEGPraEwMdWDz5MHNkulggsPdX41i4dMrdVcQdSBOcAP9vt9n0GwVNnJljsSCOH4UNHjosPpm7iwcOfF_4i_4InxRa-jRC0RWJWMxk9Xl-Uhtdv9WlxMgNZeSrSt9ySKCtREeCxYEBI1qwrnAy4a4zZ5aXAevtiXx41T7IQGu3QV2oq_4etvssMPhokSYkRAhk_nSz9dcThH2u8w-NXZl3av-rS9eiGaVxQvqqmRG79F1iw-fu5frOirJSLEofvc9nlGGZOEMk53tC0siRuP8rJOqaBJsOuPWN5widmNlirKuMjkTVShAaw-j03zMS4L39P3iuY-d9zLZUpyP3zh9poaRGEUKU5UXayGZIk76HcSsZBriPjV_84prhbh93F83XkWSOcWk1uwU_5GLPP2vu0VRxTuU_G4d1a3-aIjxE0T_OuFVSY0Lw5aAH2urUCljxbU8XDhKaOG8fi1-_HwII-5v-zLit83yy3QbOEFQ
API Call Groups
The following table lists each call by its call group and summarizes the function of the call.
Commerce Services REST API Call Groups
| Cart | |
|---|---|
| Call | Description |
| Post Cart | Create a new cart. |
| Delete Cart | Delete an existing cart. |
| Update Cart | Update contents of an existing cart. |
| Get Cart | Get the contents of an existing cart. |
| Get Multiple Carts | Get the contents of multiple existing carts. |
| Get Cart Status | Get the status of an existing cart. |
| Get Cart Tax | Determine taxes on contents of an existing cart. |
| Order | |
| Call | Description |
| Put Cart Purchase | Put Cart Purchase submits an existing cart for purchase. |
| Post Cart Purchase | Post Cart Purchase creates a cart and submits it for purchase in a single call. |
| Get Order | Get details of an order. |
| Get Multiple Orders | Get details of multiple orders. |
| Put Refund | Submit a full or partial refund for a past order. |
| Profile | |
| Call | Description |
| Get Billing Profile | Get relevant information related to user's commerce billing profile. |
Cart Structure
cartStructure is a structure used by many of the API calls. The following table lists the elements of cartStructure. Not every field appears in every JSON Request or Response. For example, orderId does not appear in Responses until a cart has been purchased. JSON Requests have fewer fields than JSON Responses. The minimum JSON Requests for a call are shown in the discussion for that call.
| Parameters | Required? | Input/Output | Description |
|---|---|---|---|
| cartId | Yes | Output Input |
First returned when cart is created. Then used as input for many other calls. |
| orderId | Yes | Output (Input for refund) |
Returned when cart is purchased. Then uses as input for refund (if needed). |
| id | Yes | Output (Input for refund) |
Output: unique identifier for each cart line item. id is only required as Input for refund. Valid value: Integer greater than 0. |
| name | Yes | Input | Line item name that developers want to appear in invoices. Maximum number of characters is 100. |
| externalProductCode | Yes | Input | Provided for developers to use for their own product codes. Maximum number of characters is 100. |
| quantity | Yes | Input | Quantity of item. Valid value is an integer greater than 0. |
| actualPrice | Yes | Input | Actual price of item. Must be equal to or less than listPrice. VAT inclusive but US tax exclusive. See notes below for valid values. |
| commodityCode | Yes | Input | Commodity code used to identify tax rate. These are predefined UNSPSC (United Nations Standard Products and Service Code) values that apps must use for proper taxation on transactions. See the Commodity Codes table below. |
| listPrice | Yes | Input | List price of item. Must be equal to or greater than actualPrice. See notes below for valid values. |
| lineItemTax | No | Output for now. May also be input in future. | Total tax associated with a given line item. See notes below for valid values. |
| extendedPrice | No | Output | quantity * actualPrice. VAT inclusive but US tax exclusive. See notes below for valid values. |
| refundQuantity | Yes* | Input Output |
Provided by developers and updated by commerce system. Required for partial refunds only and is returned to represent the quantity that was refunded. Valid value: Decimal number with 2 or fewer decimal places. |
| refundExtendedPrice | No | Output | Extended price for refund for a given line item. VAT inclusive but US tax exclusive. See notes below for valid values. |
| refundLineItemTax | No | Output | Refunded tax for a given line item. See notes below for valid values. |
| locale | Yes | Input | Locale of items / descriptions / email templates related to a given line item in RFC 5646 format. See Locale Codes and Locales table below. |
| currency | Yes | Input | Currency of item prices in cart in ISO 4217 format. See Currency Codes table below. |
| subtotal | No | Output | Sum of extendedPrice of all id items. See notes below for valid values. |
| isTaxCalculated | No | Output for now. May also be input in future. | Boolean: 1=yes; 0=no. |
| orderTotal | No | Output | Sum of: extendedPrice of all id items + lineItemTax of all id items. See notes below for valid values. See Payment Types, Codes, and Maximum Amounts table below for payment types, codes, and maximum purchase limits. (Note: In the Test environment, under certain conditions some orderTotal values are reserved to force error responses; this enables testing of error logic in your app. See the Intel Cloud Platform Services beta Commerce Services REST Developer's Guide for more information.) |
| taxTotal | No | Output | Total of all taxes for all id items. See notes below for valid values. |
| billingCountry | No (Yes for Get Cart Tax and Put Cart Purchase) |
Input | Billing country code. Follows ISO 3166-1 alpha-2 format. |
| refundSubtotal | No | Output | Sum of refundExtendedPrice for all line items. See notes below for valid values. |
| refundTaxtotal | No | Output | Sum of refundLineItemTax from all line items. See notes below for valid values. |
| refundTotal | No | Output | Sum of: refundSubtotal + refundTaxTotal for non-VAT countries. For VAT countries, this is the sum of all refundSubtotal entries. See notes below for valid values. |
| paymentType | No | Output | The payment type that was used to either calculate the tax or make the purchase. Examples: a string such as "VISA" or "AMEX". May be an empty string. See Payment Types, Codes, and Maximum Amounts table below for payment types, codes, and maximum purchase limits. |
| paymentTypeId | No | Output Input |
This is returned in some calls such as Update Cart or Get Cart Tax. Can be used by Put Cart Purchase. This number uniquely identifies the paymentType associated with the cart and is influenced by billingCountry and Currency. This is a more precise way to specify the method of payment than paymentType in cases where more than one card of the same paymentType exists (e.g., two VISA cards). |
| date | No | Output | The date of the transaction in UTC. Follows RFC 3339 (ISO 8601) format. |
| userId | No | Output | 0=Anonymous; otherwise this is the userId of the user. |
Notes
- Prices are decimal numbers with two or fewer decimal places.
- When using decimals, use a period as the decimal separator not a comma.
- Responses from REST API calls can have default values of some cartStructure fields as an empty string or 0 (zero) based on factors such as: (1) whether a cart is associated with a user, (2) availability of a user's Billing Profile Information, and (3) whether taxes have been calculated.
Commodity Codes
| Product Type | Commodity Code |
|---|---|
| Software | 4323.120 |
| Video Rental | 551115.400 |
| eBook | 551115 |
| Electronic Publication | 55111506.120 |
| Video Sale | 55111510.120 |
| Music | 55111512.100 |
| Service | 81112201.420 |
Locales and Locale Codes
| Locale/Language | Locale Code |
|---|---|
| German | de-DE |
| English | en-US |
| French | fr-FR |
| Italian | it-IT |
| Spanish | es-ES |
Currencies and Currency Codes
| Currency | Currency Code |
|---|---|
| U.S. Dollar | USD |
| Euro | EUR |
| British Pound | GBP |
Currency to Location Support
| Currency | Supported Locations |
|---|---|
| EUR | Aland Islands, Austria, Belgium, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Ireland, Israel, Italy, Latvia, Lithuania, Luxembourg, Malta , Netherlands, Norway, Poland, Portugal, Romania, Russia, Serbia (not PayPal), Slovakia, Slovenia, Spain, Sweden, Switzerland, South Africa, Turkey, United Arab Emirates, Venezuela |
| GBP | Guernsey, Isle of Man, Jersey, United Kingdom |
| USD | Argentina, Brazil, Canada, Chile, Colombia, Costa Rica, Ecuador, Mexico, United States, Australia, Hong Kong, India, Indonesia, Japan, Malaysia, New Zealand, Philippines, Singapore, South Korea, Taiwan, Thailand |
Payment Types, Codes, and Maximum Amounts
| Payment Type | Type Code | Maximum Purchase Amount |
|---|---|---|
| American Express* | AMEX | Maximum amount must be less than $50,000 USD. |
| Carte Bleue* | CARTEBLEUE-SSL | Maximum amount must be less than $50,000 USD. |
| Cartes Bancaires* | CB-SSL | Maximum amount must be less than $50,000 USD. |
| MasterCard* | MSCD | Maximum amount must be less than $50,000 USD. |
| VISA* | VISA | Maximum amount must be less than $50,000 USD. |
| PayPal* | PAYPAL | Maximum amount must be less than $10,000 USD, £550 GBP, €8000. |
Status Codes
| Status | Description |
|---|---|
| pending | Cart has been created and may be modified as it has not yet been processed. |
| awaiting_web_confirmation | A web confirmation is in the process of being shown to the user or has been shown. Awaiting confirmation result to process the cart. |
| deleted | Cart was deleted. |
| processing_payment | The purchase process has been initiated and the cart is in the process of being processed. |
| processing_refund | The refund process has been initiated and the order is in the process of being refunded. |
| order_completed | Order was completed. |
| error_payment_system | During a purchase attempt, an error occurred not related to the user's payment information, such as tax systems being down, payment processor being down, or a Commerce Services system error. |
| error_invalid_payment_details | The user's payment information was invalid during a purchase. This could be an expired credit card, canceled credit card, credit card that was refused to be processed, or payment information that was invalidated by an administrator. |
| error_refund_invalid_payment_details | The user's payment information was invalid during a refund. This could be an expired credit card, canceled credit card, credit card that was refused to be processed, or payment information that was invalidated by an administrator. |
| error_refund_system | During a refund attempt, an error occurred not related to the user's payment information, such as tax systems being down, payment processor being down, or a Commerce Services system error. |
| partially_refunded | Partial order was refunded. |
| refunded | Order was refunded. |
Example JSON cartStructure showing US Tax
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "PP-14",
"quantity": 1,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"lineItemTax": 0.09,
"extendedPrice": 1.99,
"refundQuantity": 0.5,
"reundLineItemTax": 0.05,
"refundExtendedPrice": 1.00
},
{
"id": 2,
"name": "Some Name 2",
"externalProductCode": "PP-13",
"quantity": 2,
"actualPrice": 2.49,
"commodityCode": "551115.400",
"listPrice": 2.99,
"lineItemTax": 0.22,
"extendedPrice": 4.98,
"refundQuantity": 2,
"reundLineItemTax": 0.22,
"refundExtendedPrice": 4.98
}
],
"cartId": "f776fd54-e171-42d6-a4ab-2dbf5d376db2",
"orderId": "f776fd54-e171-42d6-a4ab-2dbf5d376db2",
"userId": "6a8eb2ad-e8d4-4ac7-aa27-9246bca9a025",
"currencyType": "USD",
"locale": "en-US",
"subtotal": 6.97,
"isTaxCalculated": 1,
"orderTotal": 7.28,
"taxTotal": 0.31,
"refundSubtotal": 5.98,
"refundTaxTotal": 0.27,
"refundTotal": 6.25,
"billingCountry": "US",
"paymentType": "VISA",
"paymentTypeId": "4",
"date": "2012-06-26T05:49:36Z"
}
Example JSON cartStructure showing VAT
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "PP-14",
"quantity": 1,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"lineItemTax": 0.33,
"extendedPrice": 1.99,
"refundQuantity": 0.5,
"reundLineItemTax": 0.17,
"refundExtendedPrice": 1.00
},
{
"id": 2,
"name": "Some Name 2",
"externalProductCode": "PP-13",
"quantity": 2,
"actualPrice": 2.49,
"commodityCode": "551115.400",
"listPrice": 2.99,
"lineItemTax": 0.83,
"extendedPrice": 4.98,
"refundQuantity": 2,
"reundLineItemTax": 0.83,
"refundExtendedPrice": 4.98
}
],
"cartId": "f776fd54-e171-42d6-a4ab-2dbf5d376db2",
"orderId": "f776fd54-e171-42d6-a4ab-2dbf5d376db2",
"userId": "6a8eb2ad-e8d4-4ac7-aa27-9246bca9a025",
"currencyType": "EUR",
"locale": "en-US",
"subtotal": 5.81,
"isTaxCalculated": 1,
"orderTotal": 6.97,
"taxTotal": 1.16,
"refundSubtotal": 4.98,
"refundTaxTotal": 1.00,
"refundTotal": 5.98,
"billingCountry": "DE",
"paymentType": "VISA",
"paymentTypeId": "4",
"date": "2012-06-26T05:49:36Z"
}
}
Post Cart
Note: The base URL for all calls in this document points to the Test environment (:8081 in the path). You need to change your base URL when moving to Production.
Creates a new shopping cart, using the information in {cartStructure}.
For application authorization, the call returns a shopping cart ID that supports anonymous creation of shopping carts. For user authorization, the call uses a user ID from the Intel Identity Services, which returns a shopping cart ID that allows purchases to be made.
URL Structure
Application authorization, including the access token in the HTTP header:
https://api.intel.com:8081/commerce/v1/carts
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: POST
User authorization, including the user ID from the Intel Identity Services in the URI and the access token in the HTTP header:
https://api.intel.com:8081/commerce/v1/users/{userid}/carts
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: POST
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| cartstructure | Yes | Request body | See cartStructure description earlier in this document for details. |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
| userid | No | URI | User's identity from the Intel Identity Services. The user must give the application access to their information for the User's identity to be available. |
Example Usage
Application authorization call
POST
https://api.intel.com:8081/commerce/v1/carts
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
User authorization call with user ID from the Intel Identity Services
POST
https://api.intel.com:8081/commerce/v1/users/02cb74de-4401-4f54-beee-577cd09134a1/carts
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "P14",
"quantity": 1.5,
"actualPrice": 0.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"extendedPrice": 0.99
},
{
"id": 2,
"name": "Some Name 2",
"quantity": 2,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 2.99,
"extendedPrice": 3.98
}
],
"currencyType": "USD",
"locale": "en-US",
"billingCountry": "US"
}
}
Response Codes
| HTTP Error/Code | Service Error Code | Message | Description |
|---|---|---|---|
| 201 | N/A | Operation successful. Cart was created successfully. | Cart ID is returned. Location Header in response returns location of cart. Example: https://api.intel.com:8081/commerce/v1/carts/12345678-1234-1234-1234-123456789ABC |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10001 | Invalid Request: Prices must be positive values, contain only 2 or fewer decimal places. When using decimals, use a period as the decimal separator not a comma | Occurs when Price is not formatted correctly, such as actualprice: 0.999. |
| 400 | CMR-10002 | Invalid Request: Cart structure or refund structure is wrong. | Occurs when the cart or refund structure is incorrect, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10003 | Invalid Request: User ID is invalid. | Occurs when the format of the User ID is invalid. |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system and be configured for currencies, countries, and payment methods to execute this operation . |
| 400 | CMR-10009 | Invalid Request: Either the store is not configured or there exists an invalid value for billing country or currency or locale type. | May be generated by invalid data or by the store not being present in the system. The store must also be configured for currencies, countries, and payment methods. |
| 404 | CMR-10015 | The commodity code is not one of the approved commodity codes. | The commodity code is not one of the approved commodity codes. |
| 409 | CMR-10021 | Conflict: Maximum order total is reached. | Example: When order total exceeds 50,000 USD (i.e., total is equal to or greater than 50,000.01 USD or 41,000.01 EUR or 32,000.01 GBP). |
| 409 | CMR-10022 | Conflict: The maximum number of line items is reached. | Example: When the number of line items exceeds the 100 line item limit. |
JSON Response
{
"cartId": "6d1d2aa9-0059-4f64-93d8-894ea74800cf"
}
Notes
- Once a cart is assigned to a user, it cannot be reassigned to another user or unassigned.
- Subsequent calls to access the cart append the cartID to the URI as shown in the following Get Cart call:
GET
https://api.intel.com:8081/commerce/v1/carts/6d1d2aa9-0059-4f64-93d8-894ea74800cf
Delete Cart
Deletes the specified shopping cart.
URL Structure
The application must include the access token in the HTTP header and the cartid for the shopping cart to be deleted in the URI.
https://api.intel.com:8081/commerce/v1/carts/{cartid}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: DELETE
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| cartid | Yes | URI | Unique identifier for the shopping cart to be deleted. |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
Example Usage
DELETE
https://api.intel.com:8081/commerce/v1/carts/6d1d2aa9-0059-4f64-93d8-894ea74800cf
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request
(not applicable for this call)
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 204 | N/A | Operation successful. | The specified cart was deleted. |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 404 | CMR-10016 | Not Found: The cart/order ID or the cart/order was not found. | Either the cart/order does not exist or the developer does not have access to the cart/order. This can also occur if the cart is already deleted. |
| 409 | CMR-10023 | Conflict: Status of cart/order prevents the requested action. | Examples: (1) Cart is ordered then a delete request is submitted before the delete request is done. (2) Cart is ordered then an update request is submitted before the order is done. |
JSON Response
(not applicable for this call)
Notes
- None at present
Update Cart
Updates the shopping cart specified by {cartid}, using the information in {cartStructure}.
For application authorization, the call updates a shopping cart during an anonymous browsing session. For user authorization, the call includes the user ID from the Intel Identity Services, which updates a shopping cart that allows purchases to be made.
URL Structure
Application authorization call includes access token in the HTTP header and the cart ID in the URI:
https://api.intel.com:8081/commerce/v1/carts/{cartid}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: PUT
User authorization call includes access token in the HTTP header and both the user ID from the Intel Identity Services and the cart ID in the URI:
https://api.intel.com:8081/commerce/v1/users/{userid}/carts/{cartid}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: PUT
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| cartstructure | Yes | Request body | See cart structure earlier in this section for details. |
| cartid | Yes | URI | Unique identifier for the shopping cart to be updated. |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
| userid | No | URI | User's identity from the Intel Identity Services. The user must give the application access to their information for the User's identity to be available. |
Example Usage
Application authorization call
PUT
https://api.intel.com:8081/commerce/v1/carts/6d1d2aa9-0059-4f64-93d8-894ea74800cf
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
User authorization call with the user ID from the Intel Identity Services:
PUT
https://api.intel.com:8081/commerce/v1/users/02cb74de-4401-4f54-beee-577cd09134a1/carts/6d1d2aa9-0059-4f64-93d8-894ea74800cf
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "P14",
"quantity": 1.5,
"actualPrice": 0.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"extendedPrice": 0.99
},
{
"id": 2,
"name": "Some Name 2",
"quantity": 2,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 2.99,
"extendedPrice": 3.98
}
],
"currencyType": "USD",
"locale": "en-US",
"billingCountry": "US"
}
}
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 200 | N/A | Operation successful. Cart was updated successfully. | Cart ID is returned. Location Header in response returns location of cart. Example: https://api.intel.com:8081/commerce/v1/carts/12345678-1234-1234-1234-123456789ABC |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10001 | Invalid Request: Prices must be positive values, contain only 2 or fewer decimal places. When using decimals, use a period as the decimal separator not a comma. | Occurs when Price is not formatted correctly, such as actualprice: 0.999. |
| 400 | CMR-10002 | Invalid Request: Cart structure or refund structure is wrong. | Occurs when the cart or refund structure is incorrect, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10003 | Invalid Request: User ID is invalid. | Occurs when the format of the User ID is invalid. |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 400 | CMR-10009 | Invalid Request: Either the store is not configured or there exists an invalid value for billing country or currency or locale type. | May be generated by invalid data or by the store not being present in the system. The store must also be configured for currencies, countries, and payment methods. |
| 404 | CMR-10015 | Not Found: The commodity code is invalid. | The commodity code is not one of the approved commodity codes. |
| 404 | CMR-10016 | Not Found: The cart/order ID or the cart/order was not found. | Either the cart/order does not exist or the developer does not have access to the cart/order. |
| 409 | CMR-10021 | Conflict: Maximum order total is reached. | Example: When order total exceeds 50,000 USD (i.e., total is equal to or greater than 50,000.01 USD or 41,000.01 EUR or 32,000.01 GBP). |
| 409 | CMR-10022 | Conflict: The maximum number of line items is reached. | Example: When the number of line items exceeds the 100 line item limit. |
| 409 | CMR-10023 | Conflict: Status of cart/order prevents the requested action. | Examples: (1) Cart is ordered then a delete request is submitted. (2) Cart is ordered then an update request is submitted. |
JSON Response
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "PP-14",
"quantity": 1.5,
"actualPrice": 0.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"lineItemTax": 0,
"refundQuantity": 0,
"refundLineItemTax": 0,
"refundExtendedPrice": 0,
"extendedPrice": 1.49
},
{
"id": 2,
"name": "Some Name 2",
"externalProductCode": "PP-13",
"quantity": 2,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 2.99,
"lineItemTax": 0,
"refundQuantity": 0,
"refundLineItemTax": 0,
"refundExtendedPrice": 0,
"extendedPrice": 3.98
}
],
"cartId": "0d3b4c15-9683-48bb-9d11-bca3c5b283fb",
"userId": "6a8eb2ad-e8d4-4ac7-aa27-9246bca9a025",
"currencyType": "USD",
"locale": "en-US",
"isTaxCalculated": 0,
"billingCountry": "US",
"paymentType": "",
"paymentTypeId": 0,
"date": "2013-01-31T16:10:24Z",
"subtotal": 5.47,
"orderTotal": 5.47,
"taxTotal": 0,
"refundSubtotal": 0,
"refundTaxTotal": 0,
"refundTotal": 0
}
}
Notes
- The userId value will be "0" until a cart is assigned to a user.
- Once a cart is assigned to a user, it cannot be reassigned to another user, or unassigned.
Get Cart
Get contents of the specified cart.
Note: If a cart has already been put into purchase, this call returns the contents of the order associated with cartid.
URL Structure
The application must include the access token in the HTTP header and the cart ID for the cart in the URI.
https://api.intel.com:8081/commerce/v1/carts/{cartid}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: GET
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| cartid | Yes | URI | Unique identifier for the shopping cart you are requesting contents for. |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
Example Usage
GET
https://api.intel.com:8081/commerce/v1/carts/6d1d2aa9-0059-4f64-93d8-894ea74800cf
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request
(not applicable for this call)
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 200 | N/A | Operation successful. | The structure for the specified cart was returned. See below for example. |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10003 | Invalid Request: User ID is invalid. | Occurs when the format of the User ID is invalid. |
| 400 | CMR-10007 | Invalid Request: Date format is invalid. | The date format is not valid or the start date is before the minimum start date of 20120101. (Format is YYYYMMDD.) |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 400 | CMR-30310 | Invalid Request: Status is not recognized. | The commodity code is not one of the approved commodity codes. |
| 404 | CMR-10016 | Not Found: The cart/order ID or the cart/order was not found. | Either the cart/order does not exist or the developer does not have access to the cart/order. |
| 404 | CMR-10017 | Not Found: The user ID is not valid. | The user does not exist in the system. (Not a format issue.) |
JSON Response
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "PP-14",
"quantity": 1.5,
"actualPrice": 0.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"lineItemTax": 0,
"refundQuantity": 0,
"refundLineItemTax": 0,
"refundExtendedPrice": 0,
"extendedPrice": 1.49
},
{
"id": 2,
"name": "Some Name 2",
"externalProductCode": "PP-13",
"quantity": 2,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 2.99,
"lineItemTax": 0,
"refundQuantity": 0,
"refundLineItemTax": 0,
"refundExtendedPrice": 0,
"extendedPrice": 3.98
}
],
"cartId": "0d3b4c15-9683-48bb-9d11-bca3c5b283fb",
"userId": "6a8eb2ad-e8d4-4ac7-aa27-9246bca9a025",
"currencyType": "USD",
"locale": "en-US",
"isTaxCalculated": 0,
"billingCountry": "US",
"paymentType": "",
"paymentTypeId": 0,
"date": "2013-01-31T16:10:24Z",
"subtotal": 5.47,
"orderTotal": 5.47,
"taxTotal": 0,
"refundSubtotal": 0,
"refundTaxTotal": 0,
"refundTotal": 0
}
}
Notes
- The userId value will be "0" until a cart is assigned to a user.
Get Multiple Carts
Gets: (1) all the carts, or (2) carts for the specified user. Allows filtering by dates and/or cart status. Allows results to be paged.
For application authorization, the call returns shopping cart information regardless of user. For user authorization, the call includes a user ID from the Intel Identity Services, which allows information to be gathered for a specific user's carts.
URL Structure
Application authorization call, including the access token in the HTTP header and the date range and paging parameters:
https://api.intel.com:8081/commerce/v1/carts?start_date={YYYYMMDD}&end_date={YYYYMMDD}&$limit={limit}&$offset={offset}&status={status}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: GET
User authorization call, including the access token in the HTTP header and the user ID from the Intel Identity Services and the date range, paging parameters, and status in the URI.
https://api.intel.com:8081/commerce/v1/users/{userid}/carts?start_date={YYYYMMDD}&end_date={YYYYMMDD}&$limit={limit}&$offset={offset}&status={status}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: GET
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| start_date | Yes | URI | Start date for cart information request in UTC format. Minimum start date is 20120101 (2012, January 1). |
| end_date | Yes | URI | End date for cart information request in UTC format. End date must be greater than or equal to the start date. |
| $limit | No | URI | Specifies the maximum number of carts to be returned in a page of results. Integer between 0 and 1,000; default if not specified is 500. |
| $offset | No | URI | Spedifies the page number to include in the results from the total available pages. Integer greater than 0; default if not specified is 0. |
| status | No | URI | Cart status to allow searching on carts by their status. See Cart Status table for valid values. Only valid when userid is also used. |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
| userid | No | URI | User's identity from the Intel Identity Services. The user must give the application access to their information for the User's identity to be available. |
Example Usage
Application authorization call with start and end dates
GET
https://api.intel.com:8081/commerce/v1/carts?start_date=20120801&end_date=20120831
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
User authorization call with user ID from the Intel Identity Services, start and end dates, and carts with completed orders
GET
https://api.intel.com:8081/commerce/v1/users/02cb74de-4401-4f54-beee-577cd09134a1/carts?start_date=20120901&end_date=20120930&status=order_completed
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Application authorization call with start and end dates, and $limit of 50 carts per result with $offset of page 0 (first page)
GET
https://api.intel.com:8081/commerce/v1/carts?start_date=20120801&end_date=20120831&$limit=50&$offset=0
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request
(not applicable for this call)
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 200 | N/A | Operation successful. | JSON format is returned: cartid, date, status, total price, currency type, URI for each cart in the format https://api.intel.com:8081/commerce/v1/carts/{cartid} |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10003 | Invalid Request: User ID is invalid. | Occurs when the format of the User ID is invalid. |
| 400 | CMR-10007 | Invalid Request: Date format is invalid. | The date format is not valid or the start date is before the minimum start date of 20120101. (Format is YYYYMMDD.) |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 400 | CMR-10018 | Invalid Request: The value of the $limit or $offset is incorrect. | Note that $limit must be an integer between 0 and 1,000. $offset must be an inter greater than 0. |
| 400 | CMR-30310 | Invalid Request: Status is not recognized. | The commodity code is not one of the approved commodity codes. |
| 404 | CMR-10016 | Not Found: The cart/order ID or the cart/order was not found. | Either the cart/order does not exist or the developer does not have access to the cart/order. |
| 404 | CMR-10017 | Not Found: The user ID is not valid. | The user does not exist in the system. (Not a format issue.) |
JSON Response
{
"data": {
"currentItemCount": 73,
"totalItems": 73,
"kind": "carts",
"items": [
{
"cartId": "12345678-1234-1234-1234-123456789ABC",
"date": "2012-08-02T00:33:40Z",
"status": "ordered",
"totalPrice": 31.98,
"currencyType": "USD",
"cartUrl": "https://api.intel.com/commerce/v1/carts/12345678-1234-1234-1234-123456789ABC"
},
{
"cartId": "12345678-1234-1234-1234-123456789ABE",
"date": "2012-08-01T01:11:07Z",
"status": "pending",
"totalPrice": 12.06,
"currencyType": "USD",
"cartUrl": "https://api.intel.com/commerce/v1/carts/12345678-1234-1234-1234-123456789ABE"
}
]
}
}
Notes
- None at present.
Get Cart Status
Get status for the specified cart.
URL Structure
The application must include the access token in the HTTP header and the cart ID for the shopping cart in the URI.
https://api.intel.com:8081/commerce/v1/carts/{cartid}/status
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: GET
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| cartid | Yes | URI | Unique identifier for the shopping cart you are requesting status for. |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
Example Usage
GET
https://api.intel.com:8081/commerce/v1/carts/6d1d2aa9-0059-4f64-93d8-894ea74800cf/status
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request
(not applicable for this call)
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 200 | N/A | Operation successful. | The status for the specified cart was returned. See below for example. |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 404 | CMR-10016 | Conflict: Status of cart/order prevents the requested action. | Examples: (1) Cart does not exist, (2) Cart is ordered then a delete request is submitted while order is in progress. (3) Cart is ordered then an update request is submitted while order is in progress. |
JSON Response
{
"cartStatus": "awaiting_web_confirmation"
}
Notes
- See supported Status Codes.
Get Cart Tax
Calculate tax for the specified cart. This call calculates VAT tax for EEC countries or US tax for the United States.
URL Structure
The application must include the access token in the HTTP header and the cart ID for the shopping cart in the URI. Payment type can optionally be included in the URI via paymenttype or paymenttypeid.
https://api.intel.com:8081/commerce/v1/carts/{cartid}/tax?paymenttype={paymenttype}&paymenttypeid={paymenttypeid}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: GET
See "Notes" below for processing rules.
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| cartid | Yes | URI | Unique identifier for the shopping cart you are requesting tax information for. |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
| paymenttype | No | URI | Payment type to use for the tax calculation, such as "VISA". See Payment Types for valid values. |
| paymenttypeid | No | URI | Payment Type id to use for the tax calculation. Payment Type Id represents a combination of data including the Billing Country, Currency, and Payment Type and is a number generated by the Commerce Services system in response to Update Cart and Get Cart Tax. This is a more precise way to specify the method of payment than paymentType in cases where more than one card of the same paymentType exists (e.g., two VISA cards). |
Example Usage
GET
https://api.intel.com:8081/commerce/v1/carts/6d1d2aa9-0059-4f64-93d8-894ea74800cf/tax?paymenttype=VISA
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request
(not applicable for this call)
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 200 | N/A | Operation successful. | Cart returned with tax information included. |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 400 | CMR-30610 | Invalid Request: The payment type is not supported. | Occurs when the format of the payment type is invalid or the payment type is not supported. |
| 402 | CMR-10010 | Payment Information Required: Billing profile information is required to process the order. | The billing information is invalid or insufficient to process the order. |
| 404 | CMR-10016 | Not Found: The cart/order ID or the cart/order was not found. | Either the cart/order does not exist or the developer does not have access to the cart/order. |
| 409 | CMR-10023 | Conflict: Status of cart/order prevents the requested action. | Examples: (1) Cart is ordered then a delete request is submitted. (2) Cart is ordered then an update request is submitted. |
JSON Response
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "PP-14",
"quantity": 1,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"lineItemTax": 0.09,
"extendedPrice": 1.99,
"refundQuantity": 0,
"reundLineItemTax": 0,
"refundExtendedPrice": 0
},
{
"id": 2,
"name": "Some Name 2",
"externalProductCode": "PP-13",
"quantity": 2,
"actualPrice": 2.49,
"commodityCode": "551115.400",
"listPrice": 2.99,
"lineItemTax": 0.22,
"extendedPrice": 4.98,
"refundQuantity": 0,
"reundLineItemTax": 0,
"refundExtendedPrice": 0
}
],
"cartId": "6d1d2aa9-0059-4f64-93d8-894ea74800cf",
"userId": "6a8eb2ad-e8d4-4ac7-aa27-9246bca9a025",
"currencyType": "USD",
"locale": "en-US",
"isTaxCalculated": 1,
"billingCountry": "US",
"paymentType": "VISA",
"paymentTypeId": "4",
"date": "2012-07-26T05:49:36Z",
"subtotal": 6.97,
"orderTotal": 7.28,
"taxTotal": 0.31,
"refundSubtotal": 0,
"refundTaxTotal": 0,
"refundTotal": 0
}
}
Notes
- Using paymenttypeid is the recommended method of specifying the payment method. It is more precise in cases where two cards of the same type are available (e.g., two VISA cards).
- If paymenttypeid and paymenttype are both included in the query string, paymenttypeid takes precedence and paymenttype is ignored.
- If paymenttype is included in the query string, the billing information associated with paymenttype is used for calculating the tax.
- If paymenttype is not included in the query string, the consumer's preferred payment method is used, assuming it is supported by your Commerce Services store.
- If the user information or the payment information associated with the user is missing from the system, the call returns an error.
- The userId value will be "0" until a cart is assigned to a user.
Put/Post Cart Purchase
Put Cart Purchase submits an existing cart already assigned to a user to the payment processor.
Post Cart Purchase creates a cart from cartStructure, assigns it to a user, and submits it to the payment processor.
Carts that are successfully purchased become orders.
Put Cart Purchase
Note: Put Cart Purchase requires a cart already assigned to a user (user authorization access token) and valid payment information.
A basic version of this call uses the billing profile in cartStructure. An alternate version of the call uses the paymenttype or paymenttypeid in the query string.
billingcountry is used to specify a specific billing profile if billingcountry is present in the cartStructure.
URL Structure
Basic version, with the access token in the HTTP header and the cart ID in the URI (using billing profile in cartStructure):
https://api.intel.com:8081/commerce/v1/carts/{cartid}/purchase
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: PUT
Alternate version, with the access token in the HTTP header and the cart ID and payment type or payment type ID associated with the user's Billing Profile in the URI:
https://api.intel.com:8081/commerce/v1/carts/{cartid}/purchase?paymenttype={paymenttype}&paymenttypeid={paymenttypeid}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: PUT
Post Cart Purchase
Post Cart Purchase uses the current cartStructure and specified user ID and submits the cart for purchase. (It creates the cart, assigns it to a user, and submits it for purchase in a single call.) An alternate version of the call uses the paymenttype or paymenttypeid in the query string.
billingcountry is used to specify a specific billing profile if billingcountry is present in the cartStructure.
URL Structure
Basic version, with the access token in the HTTP header and using billing profile in cartStructure:
https://api.intel.com:8081/commerce/v1/users/{userid}/purchase
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: POST
Alternate version, with the access token in the HTTP header and payment type or payment type ID associated with the user's Billing Profile in the URI:
https://api.intel.com:8081/commerce/v1/users/{userid}/purchase?paymenttype={paymenttype}&paymenttypeid={paymenttypeid}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: POST
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. For this call, the access token must be a user authorization access token. |
| cartid | Yes | URI | Unique identifier for the shopping cart you are submitting for purchase. |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
| paymenttype | No | URI | Payment type to use for the tax calculation, such as "VISA". See Payment Types for valid values. |
| paymenttypeid | No | URI | Payment Type Id represents a combination of data including the Billing Country, Currency, and Payment Type and is a number generated by the Commerce Services system in response to Update Cart and Get Cart Tax. This is a more precise way to specify the method of payment than paymentType in cases where more than one card of the same paymentType exists (e.g., two VISA cards). |
| cartStructure | Yes: | Request body | Post Cart Purchase requires a valid cartStructure in the body. |
Example Usage
Basic version of the call (using billing profile in cartStructure)
PUT
https://api.intel.com:8081/commerce/v1/carts/6d1d2aa9-0059-4f64-93d8-894ea74800cf/purchase
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Alternate version of the call using payment type ID associated with the user's Intel Identity Services profile
PUT
https://api.intel.com:8081/commerce/v1/carts/6d1d2aa9-0059-4f64-93d8-894ea74800cf/purchase?paymenttypeid=7
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request for Put Cart Purchase
(not applicable for this version of the call)
JSON Request for Post Cart Purchase
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "P14",
"quantity": 1.5,
"actualPrice": 0.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"extendedPrice": 0.99
},
{
"id": 2,
"name": "Some Name 2",
"quantity": 2,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 2.99,
"extendedPrice": 3.98
}
],
"currencyType": "USD",
"locale": "en-US",
"billingCountry": "US"
}
}
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 200 | N/A | Operation successful. | Order was already purchased. cartStructure is returned with current status, taxes, etc. |
| 201 | N/A | Operation successful. | Order was created. Updated cartStructure is returned with current status, taxes, etc. |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. (Note: In the Test environment, under certain conditions some orderTotal values are reserved to force error responses; this enables testing of error logic in your app. See the Intel Cloud Platform Services beta Commerce Services REST Developer's Guide for more information.) |
| 400 | CMR-30610 | Invalid Request: The payment type is not supported. | Occurs when the format of the payment type is invalid or the payment type is not supported by the service or by this store. |
| 400 | CMR-30615 | Invalid Request: The token is either missing or invalid. | Application authorization is required. The access token must include 'profile:basic' access rights. |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 402 | CMR-10010 | Payment Information Required: Billing profile information is required to process the order. | The billing information is invalid or insufficient to process the order. User authorization is required. The access token must include the following access rights: 'profile:basic', 'billing:confirm', 'user:details', and 'user:scope'. |
| 404 | CMR-10016 | Not Found: The cart/order ID or the cart/order was not found. | Either the cart/order does not exist or the developer does not have access to the cart/order. |
| 409 | CMR-10021 | Conflict: Maximum order total is reached. | Example: When order total exceeds 50,000 USD (i.e., total is equal to or greater than 50,000.01 USD or 41,000.01 EUR or 32,000.01 GBP). |
| 409 | CMR-10023 | Conflict: Status of cart/order prevents the requested action. | Examples: (1) Cart is ordered then a delete request is submitted. (2) Cart is ordered then an update request is submitted. |
| 409 | CMR-30650 | Conflict: Minimum purchase price is not reached. | The purchase price is below the supported minimum price. |
Sample JSON Response for Return Codes 200,201
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "PP-14",
"quantity": 1,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"lineItemTax": 0.09,
"extendedPrice": 1.99
},
{
"id": 2,
"name": "Some Name 2",
"externalProductCode": "PP-13",
"quantity": 2,
"actualPrice": 2.49,
"commodityCode": "551115.400",
"listPrice": 2.99,
"lineItemTax": 0.22,
"extendedPrice": 4.98
}
],
"cartId": "6d1d2aa9-0059-4f64-93d8-894ea74800cf",
"orderId": "6d1d2aa9-0059-4f64-93d8-894ea74800cf",
"userId": "6a8eb2ad-e8d4-4ac7-aa27-9246bca9a025",
"currencyType": "USD",
"locale": "en-US",
"subtotal": 6.97,
"isTaxCalculated": 1,
"orderTotal": 7.28,
"taxTotal": 0.31
"billingCountry": "US",
"paymentType": "VISA",
"paymentTypeId": "4",
"date": "2012-06-26T05:49:36Z"
}
}
Notes
- Using paymenttypeid is the recommended method of specifying the payment method. It is more precise in cases where two cards of the same type are available (e.g., two VISA cards).
- If this payment type is different than the payment type used for the prior Get Cart Tax call, the tax is recalculated using the current payment type before processing.
- Note: In the Test environment, under certain conditions some orderTotal values are reserved to force error responses; this enables testing of error logic in your app. See the Intel Cloud Platform Services beta Commerce Services REST Developer's Guide for more information.
Get Order
Get order information after purchase to obtain order history. Returns an instance of {cartStructure} for the specified {orderid}. Can be used to present details of order to the consumer.
URL Structure
The application must include the access token in the HTTP header and the orderid for the desired order in the URI.
https://api.intel.com:8081/commerce/v1/orders/{orderid}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: GET
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| orderid | Yes | URI | Unique identifier for the order you are requesting information on. (This is the same identifier as cart iD used to make the purchase.) |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
Example Usage
GET
https://api.intel.com:8081/commerce/v1/orders/6d1d2aa9-0059-4f64-93d8-894ea74800cf
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request
(not applicable for this call)
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 200 | N/A | Operation successful. | Order details are returned in cartStructure. |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 404 | CMR-10016 | Not Found: The cart/order ID or the cart/order was not found. | Not found. The order iD does not exist or is invalid. This can occur when: (1) an order does not exist, or (2) the application does not have access to an order. |
JSON Response
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "PP-14",
"quantity": 1,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"lineItemTax": 0.09,
"extendedPrice": 1.99,
"refundQuantity": 0.5,
"reundLineItemTax": 0.05,
"refundExtendedPrice": 1.00
},
{
"id": 2,
"name": "Some Name 2",
"externalProductCode": "PP-13",
"quantity": 2,
"actualPrice": 2.49,
"commodityCode": "551115.400",
"listPrice": 2.99,
"lineItemTax": 0.22,
"extendedPrice": 4.98,
"refundQuantity": 2,
"reundLineItemTax": 0.22,
"refundExtendedPrice": 4.98
}
],
"cartId": "6d1d2aa9-0059-4f64-93d8-894ea74800cf",
"orderId": "6d1d2aa9-0059-4f64-93d8-894ea74800cf",
"userId": "6a8eb2ad-e8d4-4ac7-aa27-9246bca9a025",
"currencyType": "USD",
"locale": "en-US",
"subtotal": 6.97,
"isTaxCalculated": 1,
"orderTotal": 7.28,
"taxTotal": 0.31,
"refundSubtotal": 5.98,
"refundTaxTotal": 0.27,
"refundTotal": 6.25,
"billingCountry": "US",
"paymentType": "VISA",
"paymentTypeId": "4",
"date": "2012-06-26T05:49:36Z"
}
}
Notes
- None at present.
Get Multiple Orders
Get a list of orders, where each entry in the list includes: ordernumber, date, status, total price, currency type, URL for each order. Used after purchase to obtain order history. Gets: (1) all the orders, or (2) orders for the specified user. Allows filtering by dates. Allows results to be paged.
For application authorization, the call returns order information for all orders in the date range. For user authorization, the call includes a user ID from the Intel Identity Services, which allows order history to be returned for a specific user.
URL Structure
Application authorization call, with the access token in the HTTP header and paging parameters in the URI:
https://api.intel.com:8081/commerce/v1/orders?start_date={YYYYMMDD}&end_date={YYYYMMDD}&$limit={limit}&$offset={offset}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: GET
User authorization call, with the access token in the HTTP header, the user ID from the Intel Identity Services, and the date range and paging parameters in the URI
https://api.intel.com:8081/commerce/v1/users/{userid}/orders?start_date={YYYYMMDD}&end_date={YYYYMMDD}&$limit={limit}&$offset={offset}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: GET
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| start_date | Yes | URI | Start date for order information request in UTC format. Minimum start date is 20120101 (2012, January 1). |
| end_date | Yes | URI | End date for order information request in UTC format. End date must be greater than or equal to the start date. |
| $limit | No | URI | Specifies the maximum number of orders to be returned in a page of results. Integer between 0 and 1,000; default if not specified is 500. |
| $offset | No | URI | Spedifies the page number to include in the results from the total available pages. Integer greater than 0; default if not specified is 0. |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
| userid | No | URI | User's identity from the Intel Identity Services. The user must give the application access to their information for the User's identity to be available. |
Example Usage
Application authorization call with start and end dates
GET
https://api.intel.com:8081/commerce/v1/orders?start_date=start_date=20120801&end_date=20120831
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
User authorization call with user ID from the Intel Identity Services and start and end dates
GET
https://api.intel.com:8081/commerce/v1/users/{userid}/orders?start_date=start_date=20120901&end_date=20120830
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Application authorization call with start and end dates, and $limit of 50 carts per result with $offset of page 0 (first page)
GET
https://api.intel.com:8081/commerce/v1/orders?start_date=start_date=20120801&end_date=20120831&$limit=50&$offset=0
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request
(not applicable for this call)
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 200 | N/A | Operation successful. | JSON format is returned: order ID, date, status, total price, currency type, URI for each cart in the format https://api.intel.com:8081/commerce/v1/orders/{orderid} |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10003 | Invalid Request: User ID is invalid. | Occurs when the format of the User ID is invalid. |
| 400 | CMR-10007 | Invalid Request: Date format is invalid. | The date format is not valid or the start date is before the minimum start date of 20120101. (Format is YYYYMMDD.) |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 400 | CMR-10018 | Invalid Request: The value of the $limit or $offset is incorrect. | Note that $limit must be an integer between 0 and 1,000. $offset must be an inter greater than 0. |
| 404 | CMR-10017 | Not Found: The user ID is not valid. | The user does not exist in the system. (Not a format issue.) |
JSON Response
{
"data": {
"currentItemCount": 480,
"totalItems": 480,
"kind": "orders",
"items": [
{
"orderId": "12345678-1234-1234-1234-123456789ABC",
"cartId": "12345678-1234-1234-1234-123456789ABC",
"date": "2012-06-26T05:49:36Z",
"status": "value from list of valid status codes",
"totalPrice": 31.98,
"currencyType": "USD",
"orderUrl": "https://api.intel.com/commerce/v1/orders/12345678-1234-1234-1234-123456789ABC"
},
{
"orderId": "12345678-1234-1234-1234-123456789ABE",
"cartId": "12345678-1234-1234-1234-123456789ABE",
"date": "2012-07-09T15:40:46Z",
"status": "value from list of valid status codes",
"totalPrice": 12.06,
"currencyType": "USD",
"orderUrl": "https://api.intel.com/commerce/v1/orders/12345678-1234-1234-1234-123456789ABE"
}
]
}
}
Notes
- None at present.
Put Refund
Requests a full or partial refund on an order. This call is typically for use by a developer's Management Console app.
URL Structure
The call to refund a full order must include the access token in the HTTP header, the order ID for the order to be refunded, and the path to "refundfullorder" in the URI. No additional information is needed.
https://api.intel.com:8081/commerce/v1/orders/{orderid}/refundfullorder
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: PUT
The call to refund a partial order must include the access token in the HTTP header, the order ID for the order to be refunded, and the path to "refundpartialorder" in the URI. The JSON request must include the refundLines object.
https://api.intel.com:8081/commerce/v1/orders/{orderid}/refundpartialorder
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: PUT
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| orderid | Yes | URI | Unique identifier for the order you are requesting a refund on. (This is the same value as the original cart ID.) |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
| refundline | No | Request body | This parameter is required for partial refunds. For partial refunds, refundline must contain a list of id and refundquantity. This parameter should not be included for full refunds. |
Example Usage
The call to refund a full order
PUT
https://api.intel.com:8081/commerce/v1/orders/6d1d2aa9-0059-4f64-93d8-894ea74800cf/refundfullorder
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
The call to refund a partial order
PUT
https://api.intel.com:8081/commerce/v1/orders/6d1d2aa9-0059-4f64-93d8-894ea74800cf/refundpartialorder
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request Containing refundLines Object for Partial Refund
{
"data": {
"kind": "refundLines",
"items": [
{
"id": 1,
"refundQuantity": 0.5
},
{
"id": 2,
"refundQuantity": 2
}
]
}
}
See cartStructure for definition and values for refundQuantity.
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 200 | N/A | Operation successful. | Order was already refunded. This return value is not supported for partial refunds. |
| 201 | N/A | Operation successful. | Refund was processed. |
| 202 | N/A | Operation successful. | Confirmation is necessary. Provide URL. Cart structure will not be returned in this case. |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10002 | Invalid Request: Cart structure or refund structure is wrong. | Occurs when the cart or refund structure is incorrect, but there is no additional information to specify the cause of the error. |
| 400 | CMR-60011 | Invalid Request: Order line item is not valid. | Order line item is not found. |
| 400 | CMR-60012 | Invalid Request: Invalid refund request. | Order line refund amount is more than amount remaining that can be refunded. |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 402 | CMR-10010 | Payment Information Required: Billing profile information is required to process the order. | The billing information is invalid or insufficient to process the order. |
| 404 | CMR-10016 | Not Found: The cart/order ID or the cart/order was not found. | Not found. The orderid does not exist or is invalid. This can occur when: (1) an order does not exist, or (2) the application does not have access to an order. |
| 409 | CMR-10023 | Conflict: Status of cart/order prevents the requested action. | Examples: (1) Cart is ordered then a delete request is submitted. (2) Cart is ordered then an update request is submitted. |
| 409 | CMR-60061 | Conflict: Request of a refund past the date allowed for refunding. | Orders have a limited number of days where a refund can be requested. The request for a refund is past this date. |
| 409 | CMR-60062 | Conflict: Request of a refund before the order has finished processing. | Purchases must completely process before a refund can be requested. Typical processing time is between 1 hour and 24 hours. |
JSON Response
{
"data": {
"kind": "cartLine",
"items": [
{
"id": 1,
"name": "Some Name 1",
"externalProductCode": "PP-14",
"quantity": 1,
"actualPrice": 1.99,
"commodityCode": "4323.120",
"listPrice": 1.99,
"lineItemTax": 0.09,
"extendedPrice": 1.99,
"refundQuantity": 0.5,
"reundLineItemTax": 0.05,
"refundExtendedPrice": 1.00
},
{
"id": 2,
"name": "Some Name 2",
"externalProductCode": "PP-13",
"quantity": 2,
"actualPrice": 2.49,
"commodityCode": "551115.400",
"listPrice": 2.99,
"lineItemTax": 0.22,
"extendedPrice": 4.98,
"refundQuantity": 2,
"reundLineItemTax": 0.22,
"refundExtendedPrice": 4.98
}
],
"cartId": "6d1d2aa9-0059-4f64-93d8-894ea74800cf",
"orderId": "6d1d2aa9-0059-4f64-93d8-894ea74800cf",
"userId": "6a8eb2ad-e8d4-4ac7-aa27-9246bca9a025",
"currencyType": "USD",
"locale": "en-US",
"subtotal": 6.97,
"isTaxCalculated": 1,
"orderTotal": 7.28,
"taxTotal": 0.31,
"refundSubtotal": 5.98,
"refundTaxTotal": 0.27,
"refundTotal": 6.25,
"billingCountry": "US",
"paymentType": "VISA",
"paymentTypeId": "4",
"date": "2012-06-26T05:49:36Z"
}
}
Notes
- None at present.
Get Billing Profile
Get the billing profile associated with the specified user from the Commerce Services.
This call only returns those payment methods enabled in the developer's store.
URL Structure
The application must include the access token in the HTTP header and the user ID from the Intel Identity Services in the URI.
https://api.intel.com:8081/commerce/v1/users/{userid}
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Method: GET
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| access_token | Yes | Request header | Unique access token for the current session. |
| userid | Yes | URI | User's identity from the Intel Identity Services. The user must give the application access to their information for the User's identity to be available. |
| application/json | Yes | Accept header | This release of the Commerce Services supports JSON responses only. |
Example Usage
GET
https://api.intel.com:8081/commerce/v1/users/02cb74de-4401-4f54-beee-577cd09134a1
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
JSON Request
(not applicable for this call)
Response Codes
| HTTP Code | Service Error Code | Message | Description |
|---|---|---|---|
| 200 | N/A | Operation successful. | User's billing profile is returned with BillingCountry, BillingCurrency, PaymentType, and ConfirmationType. |
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occurred, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10003 | Invalid Request: User ID is invalid. | Occurs when the format of the User ID is invalid. |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 404 | CMR-10017 | Not Found: The user ID is not valid. | The user does not exist in the system. (Not a format issue.) |
JSON Response
{
"data": {
"kind": "billingProfiles",
"items": [
{
"billingCountry": "US",
"billingCurrency": "USD",
"paymentType": "VISA",
"confirmationType": "cfm_typ_none",
"paymentTypeId": 5,
"preferredPayment": 1
},
{
"billingCountry": "DE",
"billingCurrency": "EUR",
"paymentType": "MSCD",
"confirmationType": "cfm_typ_none",
"paymentTypeId": 11,
"preferredPayment": 0
}
]
}
}
Billing Profile Response
The Billing Profile Response is returned by the Get Billing Profile call. The following table lists the elements of this response.
| Parameters | Description |
|---|---|
| billingCountry | Billing country code. Follows ISO 3166-1 alpha-2 format. |
| billingCurrency | Currency to use for billing in ISO 4217 format. See Currency Codes table above. |
| paymentType | Payment type to use for calculating the tax or making the purchase. Examples: a string such as "VISA" or "AMEX". May be an empty string. |
| paymentTypeId | This number uniquely identifies a payment method. This is a more precise way to specify the method of payment than paymentType in cases where more than one card of the same paymentType exists (e.g., two VISA cards). |
| confirmationTypeId | Reserved for future use. |
| preferredPayment | Boolean: 1=this payment type is the preferred type; 0=this payment type is not the preferred payment type. (For Billing Profiles with more than one payment type included, only one will be the preferred payment type.) |
Notes
- Note at present.
Billing Profile Page
Users must set up a billing profile in the Commerce Services before making purchases. The Commerce Services accesses this profile as needed to calculate taxes, complete a purchase, or process a refund.
When an app detects that no billing profile exists, the app can forward the user to a Commerce Services page to create their billing profile. The base URIs for Billing Profile Pages in the production and test environments are shown below:
Production:
https://commerce.intel.com/profile/billingprofile.aspx?apikey={client_id}&cartid={cartid}
Test:
https://test-commerce.intel.com/profile/billingprofile.aspx?apikey={client_id}&cartid={cartid}
You must include your client_id in the URL as the value for apikey. Some basic information is already filled in from the user's Intel Identity Services account, after they approve sharing of their information with the Billing Profile page. The user must complete the remaining Billing Profile's required fields and include at least one payment method.
Note: Developers must ensure via their own testing that the Success, Fail, and Callback URLs associated with the Billing Profile page are working URLs. The Commerce Services does not validate these links. All callback URLs in the call must be fully qualified and start with "http://" or "https://".
Example Using Parameters:
https://commerce.intel.com/profile/billingprofile.aspx?apikey=8e9df53c-d28f-11e1-bd04-0050568c00f9&cartid={cartid}&success_url=https://testapp.greatapps.com/intelbilling/success.aspx&locale:en-US&error_url=https://testapp.greatapps.com/intelbilling/error.aspx&locale:en-US&code&error&callback_function=https://testapp.greatapps.com/intelbilling/callfunction.aspx&locale=en-US
Example Success:
https://commerce.intel.com/profile/error.aspx?code=200&message=
Example Fail:
https://commerce.intel.com/profile/error.aspx?code=CMR-80014&message=Locale+is+unsupported+or+invald
Example Using a Non-English Locale:
https://commerce.intel.com/profile/billingprofile.aspx?apikey=8e9df53c-d28f-11e1-bd04-0050568c00f9&cartid={cartid}&success_url=https://testapp.greatapps.com/intelbilling/success.aspx&locale:de-DE&error_url=https://testapp.greatapps.com/intelbilling/error.aspx&locale:de-DE&code&error&callback_function=https://testapp.greatapps.com/intelbilling/callfunction.aspx&locale=de-DE
Input Parameters
| Parameters | Required? | Input Type | Description |
|---|---|---|---|
| apikey | Yes | URI | The unique client_id for the app. (Your Commerce Services store is associated with this client_id on the Developer Portal. |
| successurl | No | URI | Redirect URL if payment was successfully authorized. |
| errorurl | No | URI | Redirect URL if the payment was not successfully authorized. |
| locale | No | URI | Browser locale is the default if this parameter is not passed. "en-US" is the default if the browser does not pass a locale. See the Locales and Locale Codes table for supported locales. |
| callbackurl | No | URI | Callback URL to redirect the user prior to using the Success or Error URLs above. |
| cartid | No | URI | When Cart ID is included, the Billing Profile Page lists the names and prices of the items in the cart in addition to the user's billing profile information. |
JSON Request
(not applicable for this call)
Output Parameters
| Parameters | Description |
|---|---|
| errorcode | CMR-XXXXX, where XXXXX is a unique error code. See Error Codes below. |
| errormessage | A very brief description of the code meaning. See Messages and Descriptions below. |
Response Codes
| Error Code | Message | Description |
|---|---|---|
| CMR-80000 | GENERIC_ERROR | Unexpected error during Billing Profile process. |
| CMR-80001 | INVALID_USER | Invalid User ID. |
| CMR-80002 | INVALID_TENANT | Invalid Tenant. |
| CMR-80003 | INVALID_PROFILE_ID | Invalid Profile ID. |
| CMR-80004 | INVALID_PAYMENT_TYPE | Invalid Payment Type. |
| CMR-80005 | INVALID_EXPIRATION_DATE | Invalid Expiration Date. |
| CMR-80006 | INVALID_USER_PAYMENT_METHOD | Invalid user payment method. |
| CMR-80007 | INVALID_COUNTRY_CODE | Invalid country code or not valid strings (non-existent Country Code). |
| CMR-80008 | INVALID_MERCHANT_ID | Invalid Merchant ID. |
| CMR-80009 | INVALID_ARGUMENTS | Invalid arguments. |
| CMR-80010 | INVALID_DATE_TIME | Invalid transaction date time. |
| CMR-80011 | BILLING_PROFILE_NOT_FOUND | The Billing Profile not found. |
| CMR-80012 | INVALID_API_KEY | The developer's APIKey is not provided or is invalid. |
| CMR-80013 | STORE_NOT_FOUND | There is no store associated with the APIKey. |
| CMR-80014 | INVALID_LOCALE | The locale is unsupported or invalid. |
| CMR-80015 | PAYMENT_PROCESSING_ERROR | There was an error with the billing information at the payment processor. |
| CMR-80016 | PAYMENT_PROCESSING_ERROR | There was a problem at the payment processor. |
| CMR-80017 | INVALID_DATA | Legal restrictions prevent us from fulfilling the request. |
| CMR-80018 | GENERIC_ERROR | General Commerce Services error. |
| CMR-80019 | PAYMENT_PROCESSING_ERROR | There was a problem at the payment processor as this transaction was determined to be a high fraud risk. |
JSON Response
(not applicable for this call)
Notes
- The Billing Profile Page with no cart item contents is displayed by default when: (1) the Cart ID is not present or (2) is incorrect, or (3) when the cart is associated with a different user than the current user.
Error Handling
When errors are detected during an API call, an HTTP error is returned with detailed error information in the body of the JSON response. The following example shows one possible error message for HTTP Error 400:
{
"error" : {
"code": "CMR-10023",
"message": "Conflict: Status of cart/order prevents the requested action.",
"requestId": "c962fe29-d4e8-11e1-bd04-0050568c00f9"
}
}
The following table lists shared error codes returned by the Commerce Services REST interface. A subset of the errors can be returned for each call.
| HTTP Error/Code | Service Error Code | Message | Description |
|---|---|---|---|
| 400 | CMR-10000 | Invalid Request: Generic Error | An error occured, but there is no additional information to specify the cause of the error. (Note: In the Test environment, under certain conditions some orderTotal values are reserved to force error responses; this enables testing of error logic in your app. See the Intel Cloud Platform Services beta Commerce Services REST Developer's Guide for more information.) |
| 400 | CMR-10001 | Invalid Request: Prices must be positive values, contain only 2 or fewer decimal places. When using decimals, use a period as the decimal separator not a comma. | Occurs when Price is not formatted correctly, such as actualprice: 0.999. |
| 400 | CMR-10002 | Invalid Request: Cart structure or refund structure is wrong. | Occurs when the cart or refund structure is incorrect, but there is no additional information to specify the cause of the error. |
| 400 | CMR-10003 | Invalid Request: User ID is invalid. | Occurs when the format of the User ID is invalid. |
| 400 | CMR-10004 | Invalid Request: Invalid billing country or unsupported billing country. | Occurs when the billing country syntax is invalid. such as 11, or the billing country is unsupported, such as RU. |
| 400 | CMR-10005 | Invalid Request: Currency type is invalid or unsupported. | Occurs when the format of the currency type is invalid, such as USX, or the currency type is unsupported, such as CAD. |
| 400 | CMR-10006 | Invalid Request: Locale is invalid or unsupported. | Occurs when the format of the locale is invalid, such as enUS, or is unsupported, such as MX. |
| 400 | CMR-10007 | Invalid Request: Date format is invalid. | The date format is not valid or the start date is before the minimum start date of 20120101. (Format is YYYYMMDD.) |
| 400 | CMR-10008 | Invalid Request: The store is not configured. | The store must be present in the system to execute this operation and be configured for currencies, countries, and payment methods. |
| 400 | CMR-10009 | Invalid Request: Either the store is not configured or there exists an invalid value for billing country or currency or locale type. | May be generated by invalid data or by the store not being present in the system. The store must also be configured for currencies, countries, and payment methods. |
| 404 | CMR-10015 | Not Found: The commodity code is invalid. | The commodity code is not one of the approved commodity codes. |
| 404 | CMR-10016 | Not Found: The cart/order ID or the cart/order was not found. | Either the cart/order does not exist or the developer does not have access to the cart/order. |
| 404 | CMR-10017 | Not Found: The user ID is not valid. | The user does not exist in the system. (Not a format issue.) |
| 406 | CMR-10020 | Not acceptable. | The message format requested for the client response is not supported. |
| 409 | CMR-10021 | Conflict: Maximum ordertotal is reached. | Example: When order total exceeds 50,000 USD (i.e., total is equal to or greater than 50,000.01 USD or 41,000.01 EUR or 32,000.01 GBP). |
| 409 | CMR-10022 | Conflict: The maximum line item number is reached. | Example: When the number of line items exceeds the 100 line item limit. |
| 409 | CMR-10023 | Conflict: Status of cart/order prevents the requested action. | Examples: (1) Cart is ordered then a delete request is submitted. (2) Cart is ordered then an update request is submitted. |
| 409 | CMR-10024 | Conflict: The maximum length of the line item is exceeded. | Example: When the line item name exceeds the 100 character limit. |
| 415 | CMR-10030 | Unsupported Media Type. | The message format from the client is currently not supported. |