Salesforce UX API
AppleDEPenrollment-CheckTransactionStatus-buc4911
/productOrder [GET]
The Check Transaction Status API allows Resellers to check the status of an device enrollment transaction posted to AppleCare Connect (ACC). Note - the Check Transaction Status API should be used after posting a Bulk Enroll Devices API call.
Method Logic
graph LR
id1((client)) --> request
request --> process
process --> response
response --> id1((client))
Process sequence diagram
sequenceDiagram
participant client
participant ux as sfdc-ux
participant bizProduct as product-ordering-biz
client ->>+ux: GET [REST]<br> /productOrder
ux->>+bizProduct: GET [REST]<br> /productOrder
note over ux: 200
bizProduct-->>-ux: 200
ux-->>-client:200
alt invalid input or unsupported message type then
activate ux
ux-->>client: 400
deactivate ux
else authentication invalid then
activate ux
ux-->>client: 401
deactivate ux
else request not found then
activate ux
ux-->>client: 404
deactivate ux
else businessId not implemented then
activate ux
ux-->>client: 501
deactivate ux
else server not available or timeout then
activate bizProduct
client-->>+ux:
note over ux: takes too long
ux--xclient: 500
deactivate ux
end
Uses Cases
The internal use cases to the method are defined.
Case | description |
---|---|
1 | This operation list transaction status from apple care connect |
Request
This section defines all the possible data structures sent by the client when consuming the method.
URL
https://[localhost]:[port]/sfdc-ux/v1/{businessId}/productOrder
URL PARAMS
name | type | description | required |
---|---|---|---|
businessId | string | 2 letter ISO 3166 country code | Y |
Header
name | value | description | required |
---|---|---|---|
client_id | string | The client_id identifying the channel. | Y |
client_secret | string | Password associated with the client_id. | Y |
X-Correlation-ID | string | Identifier that correlates HTTP request between a client and server. Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction. | Y |
Query Param
name | type | description | required |
---|---|---|---|
note.text | array | Text of the note. | Y |
note.@type | array | entity name In this scenario expected parameters will be "deviceEnrollmentTransactionId" | Y |
billingAccount.id | string | Ship-To Account Number | Y |
Response
In this section all the possible data structures received by the client at the moment of responding the method are defined.
Possible response success
This section defines all the possible data structures received by the client and that must be considered satisfactory at the time of responding to the method.
[ 200 ]
OK - listProductOrder request processed successfully, response body contains an entity corresponding to the requested resource. ProductOrder: A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa
[
{
"id": "ORDER_900123",
"state": "COMPLETE",
"completionDate": "2014-10-17T07:14:39Z",
"externalId": "TXN_001122",
"note": [
{
"text": "cf0ecb03-2993-479b-a891-9e973d3ec6ec_1413530075665",
"@type": "deviceEnrollmentTransactionID"
}
],
"productOrderItem": [
{
"id": "01",
"product": {
"realizingResource": [
{
"id": "33645004YAM",
"name": "Device",
"@baseType": "Resource",
"@type": "PhysicalResource",
"enrollmentStatus": "COMPLETE"
},
{
"id": "33645006YAM",
"name": "Device",
"@baseType": "Resource",
"@type": "PhysicalResource",
"enrollmentStatus": "COMPLETE"
}
],
"relatedParty": [
{
"id": "D1.2",
"role": "AssignationNumber",
"@baseType": "RelatedParty"
}
],
"@baseType": "Product"
},
"state": "COMPLETE",
"@baseType": "ProductOrderItem"
}
],
"extendedCharacteristic": [
{
"name": "transactionStatusCode",
"value": "COMPLETE"
}
],
"@baseType": "ProductOrder",
"@type": "EnrollDevicesOrder"
}
]
Definitions
Each of the request parameters is detailed.
name | type | description | required |
---|---|---|---|
id | String | Order number pertaining to the order | N |
state | String | The enrollment status for the order.This could be COMPLETE or POSTED_WITH_ERRORS or ERROR or an appropriate Error Code | N |
completionDate | datetime | The timestamp of completion of the transaction. This should include the date and time and should be in a standard UTC format. | N |
externalId | String | Unique transaction ID provided by the Reseller | N |
note | array | A list of notes. Extra information about a given entity. | N |
note.text | String | Text of the note. | N |
note.@type | String | Type of note | N |
productOrderItem | array | List of Orders in the transaction | N |
productOrderItem.id | String | Identifier of the line item (generally it is a sequence number 01, 02, 03...) | N |
productOrderItem.product | object | A product ref or value | N |
productOrderItem.product.realizingResource | array | A list of resource references | N |
productOrderItem.product.realizingResource.id | String | The IMEI/Serial.No of the enrolled device sent by the reseller in the original request. | N |
productOrderItem.product.realizingResource.name | String | Name of the realizingResource. | N |
productOrderItem.product.realizingResource.enrollmentStatus | String | The enrollment status for the device.This could be COMPLETE or an appropriate Error Code Note - this is custom/extended parameter, interduce to satisfy each device level status. | N |
productOrderItem.product.realizingResource.@baseType | String | realizingResource base type | N |
productOrderItem.product.realizingResource.@type | String | realizingResource type | N |
productOrderItem.product.relatedParty | array | A list of related parties | N |
productOrderItem.product.relatedParty.id | String | Delivery Number pertaining to the order | N |
productOrderItem.product.relatedParty.role | String | Role of the relatedParty | N |
productOrderItem.product.relatedParty.@baseType | String | Related Party Base type | N |
productOrderItem.product.@baseType | String | Product Base type | N |
productOrderItem.state | String | The enrollment status for the delivery. This could be COMPLETE or POSTED_WITH_ERRORS or ERROR or an appropriate Error Code | N |
productOrderItem.@baseType | String | Order Item Base type | N |
extendedCharacteristic | array | List of Characteristic. Note - this is custom/extended Characteristic, interduce to satisfy each transaction level status. | N |
extendedCharacteristic.name | String | Name of the Characteristic | N |
extendedCharacteristic.value | String | The value of the Characteristic | N |
@type | String | Type of order | N |
@baseType | String | Order base type | N |
extendedCharacteristic values
name | type | description | required |
---|---|---|---|
StatusCode | String | The status of the transaction. This could be COMPLETE, COMPLETE_WITH_ERRORS or ERROR. | N |
Possible response error
In this section all the possible data structures received by the client are defined and that must be considered as unsatisfactory when responding to the method.
[ 400 ]
Bad Request - the request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
{
"errors" : [{
"code" : 400 ,
"message" : "The request is invalid or not properly formed.",
"description" : "The client sent too many requests and server is not able to serve them all at the moment"
}
]
}
[ 401 ]
Unauthorized - The request has not been applied because it lacks valid authentication credentials for the target resource.
{
"errors" : [{
"code" : 401 ,
"message" : "The user could not be authenticated for this request.",
"description" : "The request has not been applied because it lacks valid authentication credentials for the target resource"
}
]
}
[ 404 ]
Not Found - server has not found a resource with that URI. This may be temporary and permanent condition. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.
{
"errors" : [{
"code" : 404,
"message" : "The request is invalid or not properly formed.",
"description" : "The requested operation failed because a resource associated with the request could not be found."
}
]
}
[ 405 ]
Method Not Allowed - HTTP method not allowed for this resource. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
{
"errors": [{
"code": 405,
"message": "APIKIT:METHOD_NOT_ALLOWED",
"description": "HTTP Method post not allowed for : /{businessId}/productOrder"
}]
}
[ 429 ]
Too Many Requests - client has sent too many requests in a space of time (rate limiting). When a server is under attack or just receiving a very large number of requests from a single party, responding to each with a 429 status code will consume resources. Therefore, servers may drop connections or take other steps instead of responding with the 429 status code, when limiting resource usage.
{
"errors" : [{
"code" : 429,
"message" : "The request is invalid or not properly formed.",
"description" : "The requested operation failed because a resource associated with the request could not be found."
}
]
}
[ 500 ]
Internal Server Error - server encountered an error processing request. This should not happen normally, but it is a generic error message, given when no more specific message is suitable.
{
"errors" : [{
"code" : 500,
"message" : "The request failed due to an internal error.",
"description": ""
}
]
}
[ 501]
{
"errors":[
{
"code":501,
"message":"Not implemented",
"description":"Operation GET /productOrder for Business Id: XXXX not implemented"
}
]
}
[ 503 ]
Service Unavailable - temporary maintenance of service, try again later. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay will be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response. Note: The existence of the 503 status code does not imply that a server will use it when becoming overloaded. Servers may simply refuse the connection.
Retry-After: 120
Administration and data management
In this section you define all the transformations, temporary and final repositories of the data within the method flow.
Transformation Request
In this section the matrix of all the data transformations that is carried out within the service is defined.
Original Payload | Mulesoft | transformation |
---|---|---|
queryparam.note.text | queryparam.note.text | |
queryparam.note.@type | queryparam.note.@type | |
queryparam.billingAccount.id | queryparam.billingAccount.id |
Transformation Response
In this section the matrix of all the data transformations that is carried out within the service is defined.
Note: Same response from SYS layer without transformations
Original Payload | Mulesoft | transformation |
---|---|---|
payload | payload |
Services dependencies
This section defines all the connections to the web services and the methods that are used within the method.
product-ordering-biz
Method | Type |
---|---|
/productOrder | GET |