Adobe Commerce (formerly Magento)
This page contains importable postman collection files which are ready to import into Postman for instant testing. This is in JSON format, please copy and save the text in JSON format before importing in Postman.
You'll need to provide the following variables in your postman collection:
Variable | Description | Example |
---|---|---|
API_VERSION | Represents 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 |
connectionId | The Id of the connection. Call the GET List Connections endpoint to find a connectionId. | |
apiKey | Your API key. Never share this with anyone. |
![](https://files.readme.io/9d1ca1e-Screenshot_2023-11-30_at_11.29.43_AM.png)
{
"info": {
"_postman_id": "b39cb432-cbee-4392-924d-6743fed29ac4",
"name": "Adobe Commerce (formerly Magento) – Alloy Unified API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "10048813",
"_collection_link": "https://solar-star-315949.postman.co/workspace/Alloy-Unified-API~60d715cc-c671-47d3-b32f-b770458d361b/collection/10048813-b39cb432-cbee-4392-924d-6743fed29ac4?action=share&source=collection_link&creator=10048813"
},
"item": [
{
"name": "Create Customer",
"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(\"[Magento] customers is returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('customer');",
" pm.expect(jsonData.customer).to.have.property('remoteId');",
" pm.expect(jsonData.customer).to.have.property('createdTimestamp');",
" pm.expect(jsonData.customer).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.customer).to.have.property('firstName');",
" pm.expect(jsonData.customer).to.have.property('lastName');",
" pm.expect(jsonData.customer).to.have.property('email');",
" pm.expect(jsonData.customer).to.have.property('phone');",
" pm.expect(jsonData.customer).to.have.property('id');",
"",
" pm.expect(jsonData.customer.firstName).to.equal('Alloy');",
" pm.expect(jsonData.customer.lastName).to.equal('Test User');",
"",
"});",
"",
"var jsonData = pm.response.json();",
"let customerId = jsonData.customer.id;",
"let customerEmail = jsonData.customer.email;",
"postman.setEnvironmentVariable(\"customerId\", customerId);",
"postman.setEnvironmentVariable(\"customerEmail\", customerEmail);",
""
],
"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}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"customers"
],
"query": [
{
"key": "sampleData",
"value": "true",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Customers",
"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(\"[Magento] customers are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('customers');",
" pm.expect(jsonData.customers[0]).to.not.be.null;",
" pm.expect(jsonData.customers[0]).to.have.property('remoteId');",
" pm.expect(jsonData.customers[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.customers[0]).to.have.property('lastName');",
" pm.expect(jsonData.customers[0]).to.have.property('email');",
" pm.expect(jsonData.customers[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.customers[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.customers[0]).to.have.property('phone');",
" pm.expect(jsonData.customers[0]).to.have.property('firstName');",
" pm.expect(jsonData.customers[0]).to.have.property('id');",
"",
" if (!postman.getEnvironmentVariable(\"customerId\")) {",
" let customerId = jsonData.customers[0].id;",
"",
" postman.setEnvironmentVariable(\"customerId\", customerId);",
" }",
"",
" if (!postman.getEnvironmentVariable(\"customerEmail\")) {",
" let customerEmail = jsonData.customers[0].email;",
" postman.setEnvironmentVariable(\"customerEmail\", customerEmail);",
" }",
"});",
""
],
"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}}",
"host": [
"https://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 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(\"[Magento] customers count is returned\", 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/{{API_VERSION}}/one/commerce/customers/count?connectionId={{connectionId}}",
"host": [
"https://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": "Get Customer",
"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(\"[Magento] customer was returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('customer');",
" pm.expect(jsonData.customer).to.have.property('remoteId');",
" pm.expect(jsonData.customer).to.have.property('createdTimestamp');",
" pm.expect(jsonData.customer).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.customer).to.have.property('firstName');",
" pm.expect(jsonData.customer).to.have.property('lastName');",
" pm.expect(jsonData.customer).to.have.property('email');",
" pm.expect(jsonData.customer).to.have.property('phone');",
" pm.expect(jsonData.customer).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/{{API_VERSION}}/one/commerce/customers/{{customerId}}?connectionId={{connectionId}}",
"host": [
"https://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 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(\"[Magento] customer was returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('customer');",
" pm.expect(jsonData.customer).to.have.property('remoteId');",
" pm.expect(jsonData.customer).to.have.property('createdTimestamp');",
" pm.expect(jsonData.customer).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.customer).to.have.property('firstName');",
" pm.expect(jsonData.customer).to.have.property('lastName');",
" pm.expect(jsonData.customer).to.have.property('email');",
" pm.expect(jsonData.customer).to.have.property('phone');",
" pm.expect(jsonData.customer).to.have.property('id');",
" pm.expect(jsonData.customer.id).to.be.equal(environment[\"customerId\"])",
"});",
"var jsonData = pm.response.json();",
"postman.setEnvironmentVariable(\"customerEmail\", jsonData.customer.email);",
"",
""
],
"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\"}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/customers/{{customerId}}?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"customers",
"{{customerId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create 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(\"[Magento] 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('createdTimestamp');",
" pm.expect(jsonData.product).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.product).to.have.property('productType');",
" pm.expect(jsonData.product).to.have.property('productName');",
" pm.expect(jsonData.product).to.have.property('description');",
" pm.expect(jsonData.product).to.have.property('images');",
" pm.expect(jsonData.product).to.have.property('productStatus');",
" pm.expect(jsonData.product).to.have.property('tags');",
" pm.expect(jsonData.product).to.have.property('vendor');",
" pm.expect(jsonData.product).to.have.property('productUrl');",
" pm.expect(jsonData.product).to.have.property('id');",
" pm.expect(jsonData.product).to.have.property('variants');",
" 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');",
" pm.expect(jsonData.product.variants[0].price).to.equal(\"10\");",
" pm.expect(jsonData.product.variants[0]).to.have.property('weight');",
"",
" const expectedWeights = [",
" {",
" \"unit\": \"kg\",",
" \"value\": 1",
" },",
" {",
" \"unit\": \"g\",",
" \"value\": 1000",
" },",
" {",
" \"unit\": \"oz\",",
" \"value\": 35.274",
" },",
" {",
" \"unit\": \"lb\",",
" \"value\": 2.20462",
" }",
" ];",
"",
" const jsonDataWeights = jsonData.product.variants[0].weight;",
"",
" for (let i = 0; i < expectedWeights.length; i++) {",
" pm.expect(jsonDataWeights[i]).to.eql(expectedWeights[i]);",
" } ",
"});",
"",
"var jsonData = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"productId\", jsonData.product.id);",
"postman.setEnvironmentVariable(\"variantId\", jsonData.product.variants[0].id);",
"",
""
],
"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\": \"TEST PRODUCT VARIANT\",\n \"productStatus\": \"ACTIVE\",\n \"variants\": [\n {\n \"price\": 10,\n \"sku\": \"SKU-{{$guid}}\",\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}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"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(\"[Magento] 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/{{API_VERSION}}/one/commerce/products/count?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"count"
],
"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(\"[Magento] order 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');",
"});",
"",
"",
""
],
"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?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products"
],
"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(\"[Magento] order 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\"])",
" 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/{{API_VERSION}}/one/commerce/products/{{productId}}?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Product Variant",
"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(\"[Magento] create product variant was returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('variant');",
" pm.expect(jsonData.variant).to.have.property('remoteId');",
" pm.expect(jsonData.variant).to.have.property('createdTimestamp');",
" pm.expect(jsonData.variant).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.variant).to.have.property('productId');",
" pm.expect(jsonData.variant).to.have.property('title');",
" pm.expect(jsonData.variant).to.have.property('price');",
" pm.expect(jsonData.variant).to.have.property('sku');",
" pm.expect(jsonData.variant).to.have.property('optionValues');",
" pm.expect(jsonData.variant).to.have.property('inventory');",
" pm.expect(jsonData.variant).to.have.property('weight');",
"",
" pm.expect(jsonData.variant.price).to.equal('100');",
"",
"});",
"",
"var jsonData = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"variantId\", jsonData.variant.id);",
"",
""
],
"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\": \"{{$guid}}\",\n \"price\": \"100.00\",\n \"weight\": {\n \"value\": 100,\n \"unit\": \"kg\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/products/{{productId}}/variants?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}",
"variants"
],
"query": [
{
"key": "productId",
"value": "4463469396026",
"disabled": true
},
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update 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(\"[Magento] order 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\"])",
" // pm.expect(jsonData.product.tags).to.include('Sample')",
" pm.expect(jsonData.product.productName).to.equal('Hani Shampoo')",
" pm.expect(jsonData.product.productStatus).to.equal('INACTIVE')",
"});",
""
],
"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 \"productName\": \"Hani Shampoo\",\n \"description\": \"Hanis Shampoo\",\n \"productStatus\": \"INACTIVE\",\n \"tags\": [\n \"Sample\",\n \"Shampoo\",\n \"PandG\"\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/products/{{productId}}?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Product Variant",
"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(\"product variant was returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('variant');",
" pm.expect(jsonData.variant).to.have.property('remoteId');",
" pm.expect(jsonData.variant).to.have.property('inventory');",
" pm.expect(jsonData.variant).to.have.property('optionValues');",
" pm.expect(jsonData.variant).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.variant).to.have.property('price');",
" pm.expect(jsonData.variant).to.have.property('createdTimestamp');",
" pm.expect(jsonData.variant).to.have.property('createdTimestamp');",
" pm.expect(jsonData.variant).to.have.property('productId');",
" pm.expect(jsonData.variant).to.have.property('sku');",
" pm.expect(jsonData.variant).to.have.property('title');",
"});",
""
],
"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}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}",
"variants",
"{{variantId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Product Variant 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(\"[Magento] order was 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/{{API_VERSION}}/one/commerce/products/{{productId}}/variants/count?connectionId={{connectionId}}",
"host": [
"https://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": "List Product Variants",
"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(\"[Magento] order was returned correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('variants');",
" pm.expect(jsonData.variants[0]).to.have.property('remoteId');",
" pm.expect(jsonData.variants[0]).to.have.property('inventory');",
" pm.expect(jsonData.variants[0]).to.have.property('optionValues');",
" pm.expect(jsonData.variants[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.variants[0]).to.have.property('price');",
" pm.expect(jsonData.variants[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.variants[0]).to.have.property('sku');",
" pm.expect(jsonData.variants[0]).to.have.property('title');",
" pm.expect(jsonData.variants[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'); ",
"});",
"",
"",
"var jsonData = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"variantId\", jsonData.variants[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/{{API_VERSION}}/one/commerce/products/{{productId}}/variants?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}",
"variants"
],
"query": [
{
"key": "page",
"value": "{{page}}",
"disabled": true
},
{
"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(\"OPERATION_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 \"title\": \"updatedTitle for variant\",\n \"price\": \"1234\",\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}}",
"host": [
"https://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": "Create 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(\"[Magento] order is created 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).to.have.property('id');",
" pm.expect(jsonData.order.lineItems[0].quantity).to.equal(2);",
" pm.expect(jsonData.order.billingAddress.address1).to.equal(\"6146 Honey Bluff Parkway\");",
" pm.expect(jsonData.order.billingAddress.region).to.equal(\"Cebu\");",
"});",
"",
"var jsonData = pm.response.json();",
"postman.setEnvironmentVariable(\"orderId\", jsonData.order.id);"
],
"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 \"lineItems\": [\n {\n \"variantId\": \"{{variantId}}\",\n \"quantity\": 2\n }\n ],\n \"currency\": \"USD\",\n \"billingAddress\": {\n \"address1\": \"6146 Honey Bluff Parkway\",\n \"city\": \"Los Angeles\",\n \"countryCode\": \"US\",\n \"firstName\": \"Tj\",\n \"lastName\": \"Monteclar\",\n \"phone\": \"+639105801660\",\n \"region\": \"Cebu\",\n \"postalCode\": \"90407\"\n },\n \"customer\": {\n \"email\": \"{{customerEmail}}\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/orders?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"orders"
],
"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(\"[Magento] 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');",
" ",
"});",
"",
"var jsonData = pm.response.json();",
"",
"",
""
],
"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?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"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(\"[Magento] 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/{{API_VERSION}}/one/commerce/orders/count?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"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(\"[Magento] 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');",
"});",
"",
""
],
"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/{{orderId}}?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"orders",
"{{orderId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete 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(\"[Magento] order was deleted correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
""
],
"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/orders/{{orderId}}?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"orders",
"{{orderId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Order",
"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(\"OPERATION_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 \"lineItems\": [\n {\n \"variantId\": \"{{variantId}}\",\n \"quantity\": 2\n }\n ],\n \"currency\": \"USD\",\n \"billingAddress\": {\n \"address1\": \"6146 Honey Bluff Parkway\",\n \"city\": \"Los Angeles\",\n \"countryCode\": \"US\",\n \"firstName\": \"Tj\",\n \"lastName\": \"Monteclar\",\n \"phone\": \"+639105801660\",\n \"region\": \"Cebu\",\n \"postalCode\": \"90407\"\n },\n \"customer\": {\n \"email\": \"{{customerEmail}}\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://embedded.runalloy.com/{{API_VERSION}}/one/commerce/orders/{{orderId}}?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"orders",
"{{orderId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Product Variant",
"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(\"product variant deleted correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('message');",
" pm.expect(jsonData.message).to.be.a(\"string\")",
"});",
"",
""
],
"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}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}",
"variants",
"{{variantId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete 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(\"[Magento] product deleted correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('message');",
" pm.expect(jsonData.message).to.be.a(\"string\")",
"});",
"",
""
],
"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}}?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"products",
"{{productId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Customer",
"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(\"[Magento] customer deleted correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('message');",
" pm.expect(jsonData.message).to.be.a(\"string\")",
"});",
"",
""
],
"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}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"customers",
"{{customerId}}"
],
"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();",
" console.log(jsonData);",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is MODEL_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/{{orderId}}/fulfillments?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"orders",
"{{orderId}}",
"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();",
" console.log(jsonData);",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is MODEL_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/{{orderId}}/fulfillments/count?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"orders",
"{{orderId}}",
"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();",
" console.log(jsonData);",
" pm.expect(jsonData).to.have.property('code');",
" pm.expect(jsonData).to.have.property('message');",
"});",
"",
"pm.test(\"Code is MODEL_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/someFulfilmentId?connectionId={{connectionId}}",
"host": [
"https://embedded.runalloy.com"
],
"path": [
"{{API_VERSION}}",
"one",
"commerce",
"orders",
"fcc96047-f572-4382-bf76-72f34c66eee0",
"fulfillments",
"someFulfilmentId"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "",
"type": "string"
}
]
},
"variable": [
{
"key": "URL",
"value": "http://localhost:1234"
},
{
"key": "connectionId",
"value": "651b97e8099c23ce6e7dd429"
}
]
}
Updated 8 months ago