0% found this document useful (0 votes)
17 views

OrderDeleteAPI v6

Uploaded by

Harald Holzer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

OrderDeleteAPI v6

Uploaded by

Harald Holzer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

OrderDeleteAPI v6

OrderDeleteAPI v6
1
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

Document Revision ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4

API Description ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4

What is RESTful? -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4

Authentication ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5
Request ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5
Sample Request -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5
Response --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5
Sample Response ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 6

System Availability ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 7

Rate Limiting ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 7

Ingram Micro Warehouse Identifiers ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 8

API Request --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------10


Request Headers ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 10
Query string Parameters ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 10
Sample Request -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------10

API Response ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 11


Field Descriptions ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------11
Error Collection --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------11
Error Fields Collection------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------11
Sample Response (for errors only)------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------11
Response Headers of Interest ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 12
API HTTP Response Codes ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 12

2
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

Transaction Level Errors-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------13

Recommended Tests -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 14

3
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

Document Revision
Date Version Description
18/05/2021 1.0 Initial draft
03/12/2021 1.1 Added DK and FI information and ESD warehouse IDs

API Description
OrderDeleteAPI is a RESTful API for deleting sales orders on ecommerce customer hold (orders placed with the “allowOrderOnCustomerHold = true” option.

What is RESTful?
Representational State Transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services. Web services
that conform to the REST architectural style, called RESTful Web services (RWS), provide interoperability between computer systems on the Internet.
RESTful Web services allow the requesting systems to access and manipulate textual representations of Web resources by using a uniform and predefined
set of stateless operations.

4
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

Authentication
API authentication is provided through OAuth 2.0. OAuth 2.0 is an authorization type that enables you to approve an application that contacts another
application for you without exposing your password. A token is requested from the Access Token URL by providing the App ID and Client Secret assigned to
your application in the Ingram Micro Partner Central portal. The issued token is valid for 24 hours and should be included in the Authorization HTTP header
when calling the API.

Request
Item Value
Access Token URL https://api.ingrammicro.com/oauth/oauth30/token
Method POST
Content-Type application/x-www-form-urlencoded
Form field 1 name grant_type
Form field 1 value client_credentials
Form field 2 name client_id
Form field 2 value Your application App ID
Form field 3 name client_secret
Form field 3 value Your application Shared Secret

Sample Request
POST https://api.ingrammicro.com/oauth/oauth30/token

grant_type=client_credentials=&client_id=W83TU6HBE9cOVdwB6ngroBnV4Lrw2KBI&client_secret=nqZJXval4dWI3SXf

Response
Item Value
access_token Your access token
token_type Bearer
expires_in Token expiry (seconds)

5
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

Sample Response
{
"access_token": "ml3aA1Z62Yi1R6k634hl9Ga84lmz",
"token_type": "Bearer",
"expires_in": "86399"
}

6
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

System Availability
During normal operating conditions, APIs should be available during weekdays between the times listed in the table below. Ingram Micro endeavours to
limit planned maintenance activities to evenings and weekends. These outages will be communicated in advance where possible. API availability may be
limited during weekends and public holidays.

Country Weekday Available From (local Weekday Available To (local


time) time)
BE and NL 00:00 00:00
AT, CH, DE, DK, FI, HU and SE 05:00 23:00
ES and PT 06:00 01:00
FR and IT 05:00 00:00
UK 06:00 00:30

Rate Limiting
This API is subject to rate limiting. Rate limiting ensures fair access to API resources for all users and prevents performance degradation due to excessive
transaction volumes.

Rate-Limiting Period (s) Transaction Limit


60 60

Rate limits can be monitored by checking special HTTP headers returned in the API response

Response Header Name


X-RateLimit-Limit Number of transactions allowed within rate-limiting period
X-RateLimit-Remaining Number of transactions remaining within rate-limiting period
X-RateLimit-Reset Rate-limiting period reset timestamp (UNIX format - milliseconds elapsed since 1970-01-01 00:00:00)

If a rate limit is exceeded, an HTTP 429 response code will be returned (Too Many Requests). No further API calls will be allowed until the rate limiting reset
period is reached.

7
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

Ingram Micro Warehouse Identifiers


Warehouse identifiers are used in several APIs such as MultiSKUPriceAndStockAPI and OrderCreateAPI. The table below provides a cross-reference for the
codes provided in these messages. Please note that only certain product ranges can be ordered directly from the central warehouse. Your local ecommerce
representative can advise on options for identifying these products via the FTP price file service. Only products listed as available in your local/central
warehouse are available for you to order.

Customer Account Country ERP Local Local Warehouse Central Central Warehouse ESD Warehouse
Warehouse locations Warehouse location ID
IDs ID (Virtual Products)
AT Impulse 28 Vienna, Austria N/A N/A 51
44 Straubing, DE
BE SAP NL01 Tilburg, NL PEDE Straubing, DE 51
PE02 Tilburg, NL
CH Impulse 27 Altishofen, CH N/A N/A 51
44 Straubing, DE
DE Impulse 44 Straubing, DE N/A N/A 51
DK Impulse 30 Rosersberg, SE 81 Straubing, DE 51
33 Rosersberg, SE
ES Impulse 29 Tarragona, ES 81 Straubing, DE 51
78 Tarragona, ES
43 Madrid, ES
FI Impulse 31 Rosersberg, SE 81 Straubing, DE 51
33 Rosersberg, SE
FR Impulse 21 Lomme, FR 81 Straubing, DE 51
82 Lomme, FR
HU Impulse 40 Fót, HU N/A N/A 51
44 Straubing, DE
IT Impulse 23 Settala, IT 81 Straubing, DE 51
86 Settala, IT
NL SAP NL01 Tilburg, NL PEDE Straubing, DE 51
PE02 Tilburg, NL
PT Impulse 26 Sintra, PT 81 Straubing, DE 51

8
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

SE Impulse 33 Rosersberg, SE 81 Straubing, DE 51


84 Rosersberg, SE
UK Impulse 20 Crick, UK 81 Straubing, DE 51
85 Crick, UK

9
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

API Request
Setting Value
Production Endpoint URL https://api.ingrammicro.com/resellers/v6/orders/{salesOrderNumber}*
Sandbox Endpoint URL https://api.ingrammicro.com/sandbox/resellers/v6/orders/{salesOrderNumber}*
Method DELETE
*replace {salesOrderNumber} with the Ingram Micro sales order number or Ingram Micro sales sub-order number

Request Headers
Header Value
Accept application/json
IM-CorrelationID A unique identifier for the API call. A GUID/UUID is recommended
IM-CountryCode Country code
IM-CustomerNumber Customer’s Ingram Micro account number
IM-SenderID Sender identifier. This is a free-text value that the customer can set
Authorization Bearer<space> + your access token (for example, Bearer 7b7888117cb72c437a3748554734fe2bd8b8c795)

Query string Parameters


No query string parameters are required for this API

Sample Request
DELETE https://api.ingrammicro.com/resellers/v6/orders/20-12345

10
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

API Response
A response body will only be provided in the event of an error. An HTTP 200 response status will indicate the successful deletion of the order.

Field Descriptions
Error Collection
Name Parent Type Data Min,Max Description
Type Occurrence
errors Root object Array 0,1 Error collection
id errors Parameter String 1,1 Error identifier
type errors Parameter String 1,1 Error type
message errors Parameter String 1,1 Error message

Error Fields Collection


Name Parent Type Data Min,Max Description
Type Occurrence
fields errors Array 0,1 Error fields collection
field fields Parameter String 1,1 Field name
value fields Parameter String 1,1 Field value
message fields Parameter String 1,1 Error message

Sample Response (for errors only)


{
"errors": [
{
"id": "1acb9d0f-2c9d-48e8-eeb7-e0c774760da1",
"type": "/errors/validation-error",
"message": "Either the customer number or order number does not match our records."
}
]
}

11
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

Response Headers of Interest


Header Value
IM-CorrelationID Echo back of the same request header value
IM-SenderID Echo back of the same request header value
X-RateLimit-Limit Number of transactions allowed within rate-limiting period
X-RateLimit-Remaining Number of transactions remaining within rate-limiting period
X-RateLimit-Reset Rate-limiting period reset timestamp (UNIX format - milliseconds elapsed since 1970-01-01 00:00:00)

API HTTP Response Codes


HTTP Code HTTP Code Description Reason Remedial Action
200 OK Successful transaction None required.
400 Bad Request The server could not understand the request due to invalid Check that your request is correctly formed
syntax
401 Unauthorized The request was unauthenticated Check App ID and Client Secret values are
valid and request a new token
403 Forbidden The client does not have access rights to the content Check you are using the correct endpoint and
that you have been granted access to the
requested API
404 Not Found The server cannot find the requested resource Check you are using the correct endpoint
405 Method Not Allowed The request method is known by the server but is not None. Delete is not allowed on the specified
supported by the target resource. sales order
429 Too Many Requests The user has sent too many requests within a given amount None required but no more requests will be
of time ("rate limiting") allowed within the allotted period
500 Internal Server Error The server has encountered a situation it doesn't know how Retry the transaction. If the error persists,
to handle contact your local ecommerce representative
502 Bad Gateway This error response means that the server, while working as a Retry the transaction. If the error persists,
gateway to get a response needed to handle the request, got contact your local ecommerce representative
an invalid response
503 Service Unavailable The server is not ready to handle the request Retry the transaction. If the error persists,
contact your local ecommerce representative

12
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

504 Gateway Timeout This error response is given when the server is acting as a Retry the transaction. If the error persists,
gateway and cannot get a response in time contact your local ecommerce representative

Transaction Level Errors


message Reason Remedial Action
Either the customer number or Could not match the sales Ensure the correct sales order number value is provided in the URL and ensure the
order number does not match our order number or customer correct IM-CustomerNumber header value is set. Retry the API call once the
records. number in Ingram Micro’s ERP values are correct
Not a valid Country Code / Invalid country value provided Ensure the correct IM-CountryCode header value is set. Retry the API call once the
Country not live for Order Delete. value is correct. If the error persists, contact your local ecommerce representative
Order Number is 10 character Invalid SAP sales order number Ensure the correct sales order number value is provided in the URL. Retry the API
field.Please enter valid Order provided call once the value is correct
Number.
Order number is not on customer The specified sales order is not Only sales orders on customer hold can be deleted
hold or ecom hold, Orders can only on customer hold
be deleted while in customer hold
or ecom hold status.
Order number is not on customer The specified sales order is not Only sales orders on customer hold can be deleted
hold, Orders can only be deleted on customer hold
while in customer hold status or
prior to being invoiced.

13
© Ingram Micro EMEA 2021
OrderDeleteAPI v6

Recommended Tests
Scenario Context
Invalid Access token Always test this scenario
Use valid sales order number Always test this scenario
Use invalid sales order number Always test this scenario
Use valid sales sub-order number Test if you intend to use this option
Use invalid sales sub-order number Test if you intend to use this option
Delete an order that is not on ecommerce customer hold Always test this scenario
Delete an order that has already been deleted Always test this scenario

14
© Ingram Micro EMEA 2021

You might also like