Skip to main content
Version: 2.0.0

Salesforce CommerceCloud

You'll need to provide the following variables in your postman collection:

VariableDescriptionExample
API_VERSIONRepresents the version of the Alloy Unified API you intend to make calls to. API versions are dated and new versions are released quarterly (in March, June, September, and December).2023-12
connectionIdThe Id of the connection. Call the GET List Connections endpoint to find a connectionId.
apiKeyYour API key. Never share this with anyone.


JSON
{
"info": {
"_postman_id": "b5ced45b-160f-4ab3-b00f-5748d31f6c34",
"name": "Salesforce CommerceCloud – Alloy Unified API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "10048813",
"_collection_link": ""
},
"item": [
{
"name": "List Customers",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/customers?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "commerce", "customers"],
"query": [
{
"key": "cursor",
"value": "{{page}}",
"disabled": true
},
{
"key": "pageSize",
"value": "2",
"disabled": true
},
{
"key": "firstNameContains",
"value": "Test",
"disabled": true
},
{
"key": "sampleData",
"value": "true",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Customer Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/customers/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "commerce", "customers", "count"],
"query": [
{
"key": "page",
"value": "eyJpdGVtSWQiOnsiUyI6IjMwNDYwOTcxMjU0MzQifSwiZGF0YUJ1Y2tldCI6eyJTIjoiNjNjMTM5OWI3NzM5NmUwMjMzMDE3OTZjL2N1c3RvbWVyIn19",
"disabled": true
},
{
"key": "pageSize",
"value": "10",
"disabled": true
},
{
"key": "firstNameContains",
"value": "Test",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Customer",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"Alloy\",\n \"lastName\": \"Test User\",\n \"email\": \"tester+{{$guid}}@runalloy.com\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/customers?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "commerce", "customers"],
"query": [
{
"key": "credentialId",
"value": "{{credentialId}}",
"disabled": true
},
{
"key": "sampleData",
"value": "true",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Customer",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/customers/{{customerId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"customers",
"{{customerId}}"
],
"query": [
{
"key": "sampleData",
"value": "true",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Customer",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"New\",\n \"lastName\": \"Name\",\n \"email\": \"tester+{{$guid}}@runalloy.com\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/customers/{{customerId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"customers",
"{{customerId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Customer",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/customers/{{customerId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"customers",
"{{customerId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Orders",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"[Salesforce Commerce Cloud] orders are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('orders');",
" pm.expect(jsonData.orders[0]).to.not.be.null;",
" pm.expect(jsonData.orders[0]).to.have.property('currency');",
" pm.expect(jsonData.orders[0]).to.have.property('totalPrice');",
" pm.expect(jsonData.orders[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.orders[0]).to.have.property('orderStatus');",
" pm.expect(jsonData.orders[0]).to.have.property('billingAddress');",
" pm.expect(jsonData.orders[0]).to.have.property('lineItems');",
" pm.expect(jsonData.orders[0]).to.have.property('remoteId');",
" pm.expect(jsonData.orders[0]).to.have.property('orderNumber');",
" pm.expect(jsonData.orders[0]).to.have.property('paymentStatus');",
" pm.expect(jsonData.orders[0]).to.have.property('totalTax');",
" pm.expect(jsonData.orders[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.orders[0]).to.have.property('totalDiscount');",
" pm.expect(jsonData.orders[0]).to.have.property('totalShipping');",
" pm.expect(jsonData.orders[0]).to.have.property('id');",
" pm.expect(jsonData).to.have.property('pageInfo');",
" pm.expect(jsonData.pageInfo).to.have.property('hasNext');",
" pm.expect(jsonData.pageInfo).to.have.property('nextCursor');",
"",
" pm.expect(jsonData.orders[0].lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.orders[0].lineItems[0]).to.have.property('productId');",
" pm.expect(jsonData.orders[0].lineItems[0]).to.have.property('title');",
" pm.expect(jsonData.orders[0].lineItems[0]).to.have.property('price');",
"",
" pm.expect(jsonData.orders[0].billingAddress).to.have.property('firstName');",
" pm.expect(jsonData.orders[0].billingAddress).to.have.property('lastName');",
" pm.expect(jsonData.orders[0].billingAddress).to.have.property('address2');",
" pm.expect(jsonData.orders[0].billingAddress).to.have.property('city');",
" pm.expect(jsonData.orders[0].billingAddress).to.have.property('phone');",
" pm.expect(jsonData.orders[0].billingAddress).to.have.property('address1');",
" pm.expect(jsonData.orders[0].billingAddress).to.have.property('countryCode');",
" pm.expect(jsonData.orders[0].billingAddress).to.have.property('postalCode');",
" pm.expect(jsonData.orders[0].billingAddress).to.have.property('region');",
"",
"",
"});",
"",
"var jsonData = pm.response.json();",
"postman.setEnvironmentVariable(\"orderId\", jsonData.orders[0].id);",
"",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/2023-03/one/commerce/orders?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["2023-03", "one", "commerce", "orders"],
"query": [
{
"key": "page",
"value": "eyJpdGVtSWQiOnsiUyI6IjQxMDQ0NjAyNzE2NzQifSwiZGF0YUJ1Y2tldCI6eyJTIjoiNjNjMTM5OWI3NzM5NmUwMjMzMDE3OTZjL29yZGVyIn19",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Order Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"[Salesforce Commerce Cloud] order count is returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/2023-03/one/commerce/orders/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["2023-03", "one", "commerce", "orders", "count"],
"query": [
{
"key": "page",
"value": "eyJpdGVtSWQiOnsiUyI6IjQxMDQ0NjAyNzE2NzQifSwiZGF0YUJ1Y2tldCI6eyJTIjoiNjNjMTM5OWI3NzM5NmUwMjMzMDE3OTZjL29yZGVyIn19",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Order",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"[Salesforce Commerce Cloud] order was returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('order');",
" pm.expect(jsonData.order).to.have.property('currency');",
" pm.expect(jsonData.order).to.have.property('totalPrice');",
" pm.expect(jsonData.order).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.order).to.have.property('orderStatus');",
" pm.expect(jsonData.order).to.have.property('billingAddress');",
" pm.expect(jsonData.order).to.have.property('lineItems');",
" pm.expect(jsonData.order).to.have.property('remoteId');",
" pm.expect(jsonData.order).to.have.property('orderNumber');",
" pm.expect(jsonData.order).to.have.property('paymentStatus');",
" pm.expect(jsonData.order).to.have.property('totalTax');",
" pm.expect(jsonData.order).to.have.property('createdTimestamp');",
" pm.expect(jsonData.order).to.have.property('totalDiscount');",
" pm.expect(jsonData.order).to.have.property('totalShipping');",
" pm.expect(jsonData.order).to.have.property('id');",
"",
" pm.expect(jsonData.order.lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.order.lineItems[0]).to.have.property('productId');",
" pm.expect(jsonData.order.lineItems[0]).to.have.property('title');",
" pm.expect(jsonData.order.lineItems[0]).to.have.property('price');",
"",
" pm.expect(jsonData.order.billingAddress).to.have.property('firstName');",
" pm.expect(jsonData.order.billingAddress).to.have.property('lastName');",
" pm.expect(jsonData.order.billingAddress).to.have.property('address2');",
" pm.expect(jsonData.order.billingAddress).to.have.property('city');",
" pm.expect(jsonData.order.billingAddress).to.have.property('phone');",
" pm.expect(jsonData.order.billingAddress).to.have.property('address1');",
" pm.expect(jsonData.order.billingAddress).to.have.property('countryCode');",
" pm.expect(jsonData.order.billingAddress).to.have.property('postalCode');",
" pm.expect(jsonData.order.billingAddress).to.have.property('region');",
"",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/2023-03/one/commerce/orders/{{orderId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["2023-03", "one", "commerce", "orders", "{{orderId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Products",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"[Salesforce Commerce Cloud] product was returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('products');",
" pm.expect(jsonData.products[0]).to.have.property('remoteId');",
" pm.expect(jsonData.products[0]).to.have.property('productType');",
" pm.expect(jsonData.products[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.products[0]).to.have.property('productStatus');",
" pm.expect(jsonData.products[0]).to.have.property('images');",
" pm.expect(jsonData.products[0]).to.have.property('description');",
" pm.expect(jsonData.products[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.products[0]).to.have.property('productName');",
" pm.expect(jsonData.products[0]).to.have.property('id');",
" pm.expect(jsonData.products[0]).to.have.property('variants');",
"",
" if (jsonData.products[0].variants.length > 0) {",
" pm.expect(jsonData.products[0].variants[0]).to.have.property('remoteId');",
" pm.expect(jsonData.products[0].variants[0]).to.have.property('inventory');",
" pm.expect(jsonData.products[0].variants[0]).to.have.property('optionValues');",
" pm.expect(jsonData.products[0].variants[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.products[0].variants[0]).to.have.property('price');",
" pm.expect(jsonData.products[0].variants[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.products[0].variants[0]).to.have.property('sku');",
" pm.expect(jsonData.products[0].variants[0]).to.have.property('title');",
" pm.expect(jsonData.products[0].variants[0]).to.have.property('id');",
" }",
"});",
"",
"var jsonData = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"productId\", jsonData.products[0].id);",
"",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/2023-03/one/commerce/products?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["2023-03", "one", "commerce", "products"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Product Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"[Salesforce Commerce Cloud] order was returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
" pm.expect(jsonData.count).to.be.a('number')",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/2023-03/one/commerce/products/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["2023-03", "one", "commerce", "products", "count"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Product",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"response should be okay to process\", function () {",
" pm.response.to.have.status(200);",
" pm.response.to.not.be.error;",
" pm.response.to.not.have.jsonBody(\"error\");",
"});",
"",
"pm.test(\"[Salesforce Commerce Cloud] product was returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('product');",
" pm.expect(jsonData.product).to.have.property('remoteId');",
" pm.expect(jsonData.product).to.have.property('productType');",
" pm.expect(jsonData.product).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.product).to.have.property('productStatus');",
" pm.expect(jsonData.product).to.have.property('images');",
" pm.expect(jsonData.product).to.have.property('description');",
" pm.expect(jsonData.product).to.have.property('createdTimestamp');",
" pm.expect(jsonData.product).to.have.property('productName');",
" pm.expect(jsonData.product).to.have.property('id');",
" pm.expect(jsonData.product.id).to.equal(environment[\"productId\"])",
"",
" if (jsonData.product.variants.length > 0) {",
" pm.expect(jsonData.product.variants[0]).to.have.property('remoteId');",
" pm.expect(jsonData.product.variants[0]).to.have.property('inventory');",
" pm.expect(jsonData.product.variants[0]).to.have.property('optionValues');",
" pm.expect(jsonData.product.variants[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.product.variants[0]).to.have.property('price');",
" pm.expect(jsonData.product.variants[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.product.variants[0]).to.have.property('sku');",
" pm.expect(jsonData.product.variants[0]).to.have.property('title');",
" pm.expect(jsonData.product.variants[0]).to.have.property('id');",
" }",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/2023-03/one/commerce/products/{{productId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["2023-03", "one", "commerce", "products", "{{productId}}"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Product Variants",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/products/{{productId}}/variants?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}",
"variants"
],
"query": [
{
"key": "page",
"value": "{{page}}",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Product Variant Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/products/{{productId}}/variants/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}",
"variants",
"count"
],
"query": [
{
"key": "page",
"value": "{{page}}",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Product for use in Product Variant",
"event": [
{
"listen": "test",
"script": {
"exec": [
" tests[\"Status code is 422\"] = responseCode.code === 422;",
" ",
" var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
" tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = responseHeaders[\"Content-Type\"].has(\"application/json\");",
" }",
" ",
" pm.test(\"Status code is 422\", function () {",
" pm.response.to.have.status(422);",
" });",
" ",
" pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" console.log(jsonData)",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
" });",
" ",
" pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"OPERATION_NOT_SUPPORTED\");",
" });"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"productName\": \"Product {{$guid}}\",\n \"description\": \"AP2 Desc\",\n \"productStatus\": \"ACTIVE\",\n \"variants\": [\n {\n \"price\": 10,\n \"sku\": \"my-variant\",\n \"weight\": {\n \"value\": 1,\n \"unit\": \"kg\"\n },\n \"optionValues\": [{\n \"name\": \"test\",\n \"value\": \"my-variant\"\n }]\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/products?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": ["{{API_VERSION}}", "one", "commerce", "products"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Product Variant",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"optionValues\": [\n {\n \"name\": \"Color\",\n \"value\": \"{{$randomNoun}}\"\n },\n {\n \"name\": \"Size\",\n \"value\": \"{{$randomNoun}}\"\n }\n ],\n \"sku\": \"POT-0421\",\n \"price\": \"100.00\",\n \"weight\": {\n \"value\": 100\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/products/{{productId}}/variants?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}",
"variants"
],
"query": [
{
"key": "productId",
"value": "4463469396026",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Product Variant",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/products/{{productId}}/variants/{{variantId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}",
"variants",
"{{variantId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Product Variant",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"weight\": {\n \"value\": 500,\n \"unit\": \"lb\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/products/{{productId}}/variants/{{variantId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}",
"variants",
"{{variantId}}"
],
"query": [
{
"key": "productId",
"value": "4463469396026",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Product Variant",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/products/{{productId}}/variants/{{variantId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}",
"variants",
"{{variantId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Fulfillments",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/orders/fcc96047-f572-4382-bf76-72f34c66eee0/fulfillments?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"orders",
"fcc96047-f572-4382-bf76-72f34c66eee0",
"fulfillments"
],
"query": [
{
"key": "page",
"value": "{{page}}",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Fulfillment Count",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/orders/fcc96047-f572-4382-bf76-72f34c66eee0/fulfillments/count?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"orders",
"fcc96047-f572-4382-bf76-72f34c66eee0",
"fulfillments",
"count"
],
"query": [
{
"key": "page",
"value": "eyJpdGVtSWQiOnsiUyI6IjMwNDYwOTcxMjU0MzQifSwiZGF0YUJ1Y2tldCI6eyJTIjoiNjNjMTM5OWI3NzM5NmUwMjMzMDE3OTZjL2N1c3RvbWVyIn19",
"disabled": true
},
{
"key": "pageSize",
"value": "10",
"disabled": true
},
{
"key": "firstNameContains",
"value": "Test",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Fulfillment",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 501\"] = responseCode.code === 501;",
"",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;",
" ",
"if (contentTypeHeaderExists) {",
" tests[\"Content-Type is application/json\"] = ",
" responseHeaders[\"Content-Type\"].has(\"application/json\");",
"}",
"",
"pm.test(\"Status code is 501\", function () {",
" pm.response.to.have.status(501);",
"});",
"",
"pm.test(\"Body has code and message\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is OPERATION_NOT_SUPPORTED\", function () {",
" let jsonData = pm.response.json();",
" pm.expect(jsonData.code).to.eql(\"MODEL_NOT_SUPPORTED\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
}
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/orders/fcc96047-f572-4382-bf76-72f34c66eee0/fulfillments/{{fulfillmentId}}?connectionId={{connectionId}}",
"protocol": "https",
"host": ["embedded", "runalloy", "com"],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"orders",
"fcc96047-f572-4382-bf76-72f34c66eee0",
"fulfillments",
"{{fulfillmentId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "",
"type": "string"
}
]
}
}