Catalog and commerce
Get business order
Protocols: Linked Device API
Required scope: business:read
POST
/
messaging
/
{session}
/
business
/
orders
/
{orderId}
/
lookup
Get business order
curl --request POST \
--url https://api.polymorfa.com/messaging/{session}/business/orders/{orderId}/lookup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({token: '<string>'})
};
fetch('https://api.polymorfa.com/messaging/{session}/business/orders/{orderId}/lookup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/messaging/{session}/business/orders/{orderId}/lookup"
payload = { "token": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/messaging/{session}/business/orders/{orderId}/lookup"
payload := strings.NewReader("{\n \"token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}false{
"success": true,
"data": {
"id": "<string>",
"createdAt": 1,
"price": {
"subtotal": "<string>",
"total": "<string>",
"currency": "<string>",
"priceStatus": "<string>"
},
"products": [
{
"id": "<string>",
"price": "<string>",
"currency": "<string>",
"name": "<string>",
"quantity": 1,
"imageId": "<string>",
"imageUrl": "<string>",
"variantProperties": "<string>"
}
],
"catalogId": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "Correct the invalid request field.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}{
"error": {
"type": "authentication_error",
"code": "invalid_credential",
"message": "Supply a valid credential.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}{
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "The credential does not have access to this resource.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "The resource is unavailable to this caller.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected service failure occurred. Keep the request ID for support.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#internal-error"
}{
"error": {
"type": "upstream_error",
"code": "upstream_failure",
"message": "The messaging provider could not complete the request.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
}Authorizations
Polymorfa organization key (pmfa_ prefix), project token (pmfa_pt_ prefix) where supported, or short-lived client token (pmfa_ct_ prefix). Organization and project keys may be personal or service-account owned and enforce selected action scopes. Organization keys cover the team and its projects; project tokens stay inside one project. Client tokens stay inside their live project and session and enforce their client rules.
Path Parameters
Identifier of the connected Polymorfa session.
Identifier for the order.
Value constraints
| Constraint | Accepted input |
|---|---|
| String length | At most 256 characters |
Maximum string length:
256Body
application/json
Opaque token required by the target operation.
Value constraints
| Constraint | Accepted input |
|---|---|
| String length | 1 through 8192 characters |
Required string length:
1 - 8192⌘I
Get business order
curl --request POST \
--url https://api.polymorfa.com/messaging/{session}/business/orders/{orderId}/lookup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({token: '<string>'})
};
fetch('https://api.polymorfa.com/messaging/{session}/business/orders/{orderId}/lookup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/messaging/{session}/business/orders/{orderId}/lookup"
payload = { "token": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/messaging/{session}/business/orders/{orderId}/lookup"
payload := strings.NewReader("{\n \"token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}false{
"success": true,
"data": {
"id": "<string>",
"createdAt": 1,
"price": {
"subtotal": "<string>",
"total": "<string>",
"currency": "<string>",
"priceStatus": "<string>"
},
"products": [
{
"id": "<string>",
"price": "<string>",
"currency": "<string>",
"name": "<string>",
"quantity": 1,
"imageId": "<string>",
"imageUrl": "<string>",
"variantProperties": "<string>"
}
],
"catalogId": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "Correct the invalid request field.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}{
"error": {
"type": "authentication_error",
"code": "invalid_credential",
"message": "Supply a valid credential.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-credential"
}{
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "The credential does not have access to this resource.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "The resource is unavailable to this caller.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected service failure occurred. Keep the request ID for support.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#internal-error"
}{
"error": {
"type": "upstream_error",
"code": "upstream_failure",
"message": "The messaging provider could not complete the request.",
"param": null
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
}