Salesforce UX API icon

Salesforce UX API

(0 reviews)

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.

Casedescription
1This 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

nametypedescriptionrequired
businessIdstring2 letter ISO 3166 country codeY
namevaluedescriptionrequired
client_idstringThe client_id identifying the channel.Y
client_secretstringPassword associated with the client_id.Y
X-Correlation-IDstringIdentifier 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

nametypedescriptionrequired
note.textarrayText of the note.Y
note.@typearrayentity name
In this scenario expected parameters will be
"deviceEnrollmentTransactionId"
Y
billingAccount.idstringShip-To Account NumberY

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.

nametypedescriptionrequired
idStringOrder number pertaining to the orderN
stateStringThe enrollment status for the order.This could be COMPLETE or POSTED_WITH_ERRORS or ERROR or an appropriate Error CodeN
completionDatedatetimeThe timestamp of completion of the transaction. This should include the date and time and should be in a standard UTC format.N
externalIdStringUnique transaction ID provided by the ResellerN
notearrayA list of notes. Extra information about a given entity.N
note.textStringText of the note.N
note.@typeStringType of noteN
productOrderItemarrayList of Orders in the transactionN
productOrderItem.idStringIdentifier of the line item (generally it is a sequence number 01, 02, 03...)N
productOrderItem.productobjectA product ref or valueN
productOrderItem.product.realizingResourcearrayA list of resource referencesN
productOrderItem.product.realizingResource.idStringThe IMEI/Serial.No of the enrolled device sent by the reseller in the original request.N
productOrderItem.product.realizingResource.nameStringName of the realizingResource.N
productOrderItem.product.realizingResource.enrollmentStatusStringThe 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.@baseTypeStringrealizingResource base typeN
productOrderItem.product.realizingResource.@typeStringrealizingResource typeN
productOrderItem.product.relatedPartyarrayA list of related partiesN
productOrderItem.product.relatedParty.idStringDelivery Number pertaining to the orderN
productOrderItem.product.relatedParty.roleStringRole of the relatedPartyN
productOrderItem.product.relatedParty.@baseTypeStringRelated Party Base typeN
productOrderItem.product.@baseTypeStringProduct Base typeN
productOrderItem.stateStringThe enrollment status for the delivery. This could be COMPLETE or POSTED_WITH_ERRORS or ERROR or an appropriate Error CodeN
productOrderItem.@baseTypeStringOrder Item Base typeN
extendedCharacteristicarrayList of Characteristic.
Note - this is custom/extended Characteristic, interduce to satisfy each transaction level status.
N
extendedCharacteristic.nameStringName of the CharacteristicN
extendedCharacteristic.valueStringThe value of the CharacteristicN
@typeStringType of orderN
@baseTypeStringOrder base typeN
extendedCharacteristic values
nametypedescriptionrequired
StatusCodeStringThe 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 PayloadMulesofttransformation
queryparam.note.textqueryparam.note.text
queryparam.note.@typequeryparam.note.@type
queryparam.billingAccount.idqueryparam.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 PayloadMulesofttransformation
payloadpayload

Services dependencies

This section defines all the connections to the web services and the methods that are used within the method.

product-ordering-biz
MethodType
/productOrderGET

Reviews