0% found this document useful (0 votes)
71 views17 pages

CT Order Status Update

The document describes an API for managing order data. It includes endpoints to get orders by date range with pagination, get a single order by number, and update an order by number. The update endpoint accepts a partial request to modify specific order fields. The API specification defines the request and response formats, parameters, and error codes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views17 pages

CT Order Status Update

The document describes an API for managing order data. It includes endpoints to get orders by date range with pagination, get a single order by number, and update an order by number. The update endpoint accepts a partial request to modify specific order fields. The API specification defines the request and response formats, parameters, and error codes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Version Author Comments

BOSCH CT : Updation of order info to


1 Momin Khadeer orderStatus API
Date Reference

9/11/2023 34545
Visio Link
https://moduslink.sharepoint.com/:u:/r/sites/pwa/IT%20DRs%20New%20(SUPP)/_layouts/15/Doc.aspx?sourcedoc=
%7BA6992530-499D-4199-9CD8-6314B75AC41C%7D&file=CT%20--
%20OrderStatusUpdate.vsdx&action=default&mobileredirect=true
Patch/orders/{orderNumber}
orderNumber
requestId
erpOrderNumber

status
trackingNumber
returnTrackingNumber

S NO Scenario

1 When RequestId is generated

2 When requestId status is confirmed in CDM

3 When requestId status is shipped in CDM


4 When requestId status is returned in CDM
Type
string
string
string

enum
string
string

Updation to be done

Call API and update only requestId in the requestId field

Call API and update only erpOrderNumber and status as confirmed

Call API and update only trackingNumber and status as shipped


Call API and update only returnTrackingNumber and status as returned
Logic Example
Required Field 10004566
Required Field 41234568
Required Field 200034567
Awaiting Payment
Confirmed
Shipped
Completed
Returned
Cancelled
Required Field ..
Required Field DD123456789GB
Required Field RM123456789GB

Sample

URL : Patch/orders/1000426

Body
{
"requestId":41235656
}

URL : Patch/orders/1000426

Body
{
"erpOrderNumber": "46566",
"status":"confirmed"

URL : Patch/orders/1000426

Body
{
"trackingNumber": "TR154",
"status":"shipped"

}
URL : Patch/orders/1000426

Body
{
"returnTrackingNumber":
"Ret756,
"status":"returned"

}
API URL
Method
Authentication

Sample

For updating RequestId

For updating ERP Order number and status as confirmed

For updating delivery tracking number and status as shipped

For updating return tracking number and status as returned

Sample Response
204
https://eshop-dev.bosch-professional.com/api/order-service
Patch
<API Key .. To be updated>

URL : Patch/orders/1000426

Body
{
"requestId":41235656
}

URL : Patch/orders/1000426

Body
{
"erpOrderNumber": "46566",
"status":"confirmed"

URL : Patch/orders/1000426

Body
{
"trackingNumber": "TR154",
"status":"shipped"

URL : Patch/orders/1000426

Body
{
"returnTrackingNumber": "Ret756,
"status":"returned"

Order successfully updated


openapi: 3.0.1
info:
title: Orders API
version: "1.0.0"
paths:
/orders:
get:
tags:
- Orders
summary: Get orders submitted during a period of time
parameters:
- in: query
name: from
required: true
schema:
type: string
example: '2023-07-24T00:00:00.000Z'
- in: query
name: to
required: true
schema:
type: string
format: date-time
example: '2023-07-25T00:00:00.000Z'
- in: query
name: limit
required: false
schema:
type: number
format: integer
example: 50
default: 100
- in: query
name: offset
required: false
schema:
type: number
format: integer
example: 50
default: 0
responses:
'200':
description: |
Orders successfully returned. The schema is the same as commercetools query orders. See API specification here:
- https://github.com/commercetools/commercetools-api-reference/tree/main/oas/api
- https://docs.commercetools.com/api/projects/orders#ctp:api:type:OrderPagedQueryResponse
The response should be checked if more orders are available (while offset does not become greater than total). Reques
content:
application/json:
schema:
type: object
'401':
$ref: "#/components/responses/UnauthorizedError"
'500':
$ref: "#/components/responses/InternalServerError"
/orders/{orderNumber}:
get:
tags:
- Orders
summary: Get order by order number
parameters:
- in: path
name: orderNumber
required: true
schema:
type: string
responses:
'200':
description: |
Order successfully returned. The schema is the same as commercetools order. See API specification here:
- https://github.com/commercetools/commercetools-api-reference/tree/main/oas/api
- https://docs.commercetools.com/api/projects/orders#ctp:api:type:Order
content:
application/json:
schema:
type: object
'401':
$ref: "#/components/responses/UnauthorizedError"
'404':
$ref: "#/components/responses/OrderNotFound"
'500':
$ref: "#/components/responses/InternalServerError"
patch:
tags:
- Orders
summary: Update order by order number
parameters:
- in: path
name: orderNumber
required: true
schema:
type: string
requestBody:
description: A request for partial updates. The fields that are present in the request will be updated.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateOrderRequest"
responses:
'204':
description: Order successfully updated
'400':
description: Empty request or invalid data in the request
content:
application/json:
example:
code: "invalid.request"
message: "'status' is invalid"
schema:
$ref: "#/components/schemas/ErrorResponse"
'401':
$ref: "#/components/responses/UnauthorizedError"
'404':
$ref: "#/components/responses/OrderNotFound"
'500':
$ref: "#/components/responses/InternalServerError"
components:
responses:
OrderNotFound:
description: Order not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
InternalServerError:
description: Internal server error
content:
application/json:
example:
code: "internal.server.error"
message: "An unexpected error occurred"
schema:
$ref: '#/components/schemas/ErrorResponse'
UnauthorizedError:
description: Invalid credentials
content:
application/json:
example:
code: "invalid.credentials"
message: "No valid authentication provided"
schema:
$ref: "#/components/schemas/ErrorResponse"
schemas:
UpdateOrderRequest:
type: object
properties:
requestId:
type: string
example:
"1234-5678-9999"
erpOrderNumber:
type: string
example:
"200034567"
status:
type: string
enum:
- "Awaiting Payment"
- "Confirmed"
- "Shipped"
- "Completed"
- "Returned"
- "Cancelled"
trackingNumber:
type: string
example:
"DD123456789GB"
returnTrackingNumber:
type: string
example:
"RM123456789GB"
ErrorResponse:
type: object
properties:
code:
type: string
example: order.not.found
message:
type: string
example: Order with provided order number cannot be found
quest parameters 'offset' and 'limit' control pagination.

You might also like