Skip to main content
Version: 1.1.0

SAP S/4HANA

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).2024-03
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": "",
"name": "SAP S/4 HANA – Alloy Unified API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "",
"_collection_link": ""
},
"item": [
{
"name": "List Company Info",
"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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/company-info?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "company-info"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Company Info 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 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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/company-info/count?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"company-info",
"count"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Company Info",
"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 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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/company-info/{{companyInfoId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"company-info",
"{{companyInfoId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Accounts",
"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(\"[netsuite] accounts are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('accounts');",
" pm.expect(jsonData.accounts[0]).to.not.be.null;",
" pm.expect(jsonData.accounts[0]).to.have.property('remoteId');",
" pm.expect(jsonData.accounts[0]).to.have.property('accountName');",
" pm.expect(jsonData.accounts[0]).to.have.property('accountDescription');",
" pm.expect(jsonData.accounts[0]).to.have.property('classification');",
" pm.expect(jsonData.accounts[0]).to.have.property('accountType');",
" pm.expect(jsonData.accounts[0]).to.have.property('accountStatus');",
" pm.expect(jsonData.accounts[0]).to.have.property('currentBalance');",
" pm.expect(jsonData.accounts[0]).to.have.property('currency');",
" pm.expect(jsonData.accounts[0]).to.have.property('accountNumber');",
" pm.expect(jsonData.accounts[0]).to.have.property('parentAccountId');",
" pm.expect(jsonData.accounts[0]).to.have.property('companyId');",
" pm.expect(jsonData.accounts[0]).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let accountId = jsonData.accounts[0].id;",
"postman.setEnvironmentVariable(\"accountId\", accountId);",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": []
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/accounts?connectionId={{connectionId}}&remoteId=274200",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "accounts"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
},
{
"key": "remoteId",
"value": "274200"
}
]
}
},
"response": []
},
{
"name": "Create Account",
"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();",
" 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 \"accountName\": \"GreggTest+{{$randomUUID}}\",\n \"accountType\": \"OTHER_ASSET\",\n \"currency\": \"USD\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/accounts?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "accounts"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Account",
"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(\"[netsuite] account is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" console.log(jsonData);",
" pm.expect(jsonData.account).to.not.be.null;",
" pm.expect(jsonData.account).to.have.property('remoteId');",
" pm.expect(jsonData.account).to.have.property('accountName');",
" pm.expect(jsonData.account).to.have.property('accountDescription');",
" pm.expect(jsonData.account).to.have.property('classification');",
" pm.expect(jsonData.account).to.have.property('accountType');",
" pm.expect(jsonData.account).to.have.property('accountStatus');",
" pm.expect(jsonData.account).to.have.property('currentBalance');",
" pm.expect(jsonData.account).to.have.property('currency');",
" pm.expect(jsonData.account).to.have.property('accountNumber');",
" pm.expect(jsonData.account).to.have.property('parentAccountId');",
" pm.expect(jsonData.account).to.have.property('companyId');",
" pm.expect(jsonData.account).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/accounts/{{accountId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"accounts",
"{{accountId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Account",
"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();",
" 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 \"accountName\": \"CachoTestren+{{$randomUUID}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/accounts/{{accountId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"accounts",
"{{accountId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Account",
"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();",
" 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": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/accounts/{{accountId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"accounts",
"{{accountId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Account 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(\"[netsuite] Account count is displayed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/accounts/count?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "accounts", "count"],
"query": [
{
"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(\"[netsuite] 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('customerName');",
" pm.expect(jsonData.customers[0]).to.have.property('email');",
" pm.expect(jsonData.customers[0]).to.have.property('taxNumber');",
" pm.expect(jsonData.customers[0]).to.have.property('customerStatus');",
" pm.expect(jsonData.customers[0]).to.have.property('currency');",
" pm.expect(jsonData.customers[0]).to.have.property('companyId');",
" pm.expect(jsonData.customers[0]).to.have.property('addresses');",
" pm.expect(jsonData.customers[0].addresses).to.be.an('array');",
" if(jsonData.customers[0].addresses.length > 0) {",
" pm.expect(jsonData.customers[0].addresses[0]).to.have.property('addressType');",
" pm.expect(jsonData.customers[0].addresses[0]).to.have.property('street1');",
" }",
" pm.expect(jsonData.customers[0]).to.have.property('phoneNumbers');",
" pm.expect(jsonData.customers[0].phoneNumbers).to.be.an('array');",
" if(jsonData.customers[0].phoneNumbers.length > 0) {",
" pm.expect(jsonData.customers[0].phoneNumbers[0]).to.have.property('phoneNumberType');",
" pm.expect(jsonData.customers[0].phoneNumbers[0]).to.have.property('phoneNumber');",
" }",
" pm.expect(jsonData.customers[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.customers[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.customers[0]).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let customerId = jsonData.customers[0].id;",
"postman.setEnvironmentVariable(\"customerId\", customerId);",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/customers?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "customers"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Customer",
"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();",
" 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 \"customerName\": \"Alloy+{{$randomUUID}}\",\n \"addresses\": [\n { \n \"addressType\": \"BILLING\",\n \"street1\": \"Beverly Hills\",\n \"zipCode\": \"90210\",\n \"country\": \"US\"\n }\n ],\n \"phoneNumbers\": [\n {\n \"phoneNumberType\": \"MOBILE\",\n \"phoneNumber\": \"09173210215\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/customers?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "customers"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve 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(\"customer is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('customer');",
" pm.expect(jsonData.customer).to.not.be.null;",
" pm.expect(jsonData.customer).to.have.property('remoteId');",
" pm.expect(jsonData.customer).to.have.property('customerName');",
" pm.expect(jsonData.customer).to.have.property('email');",
" pm.expect(jsonData.customer).to.have.property('taxNumber');",
" pm.expect(jsonData.customer).to.have.property('customerStatus');",
" pm.expect(jsonData.customer).to.have.property('currency');",
" pm.expect(jsonData.customer).to.have.property('companyId');",
" pm.expect(jsonData.customer).to.have.property('addresses');",
" pm.expect(jsonData.customer).to.have.property('createdTimestamp');",
" pm.expect(jsonData.customer).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.customer).to.have.property('id');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/customers/{{customerId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"customers",
"{{customerId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Customer",
"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();",
" 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 \"customerName\": \"AlloyUpdate+{{$randomUUID}}\",\n \"addresses\": [\n { \n \"remoteId\": \"{{customerAddressRemoteId}}\",\n \"addressType\": \"BILLING\",\n \"street1\": \"Lombard\",\n \"zipCode\": \"94012\",\n \"country\": \"US\"\n }\n ],\n \"phoneNumbers\": [\n {\n \"phoneNumberType\": \"MOBILE\",\n \"phoneNumber\": \"09173210215\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/customers/{{customerId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"customers",
"{{customerId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Customer",
"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();",
" 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": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/customers/{{customerId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"customers",
"{{customerId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Customers 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(\"[netsuite] customer count is displayed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/customers/count?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"customers",
"count"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Vendors",
"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(\"[netsuite] vendors are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('vendors');",
" pm.expect(jsonData.vendors[0]).to.not.be.null;",
" pm.expect(jsonData.vendors[0]).to.have.property('remoteId');",
" pm.expect(jsonData.vendors[0]).to.have.property('vendorName');",
" pm.expect(jsonData.vendors[0]).to.have.property('email');",
" pm.expect(jsonData.vendors[0]).to.have.property('taxNumber');",
" pm.expect(jsonData.vendors[0]).to.have.property('vendorStatus');",
" pm.expect(jsonData.vendors[0]).to.have.property('currency');",
" pm.expect(jsonData.vendors[0]).to.have.property('companyId');",
" pm.expect(jsonData.vendors[0]).to.have.property('addresses');",
" pm.expect(jsonData.vendors[0]).to.have.property('phoneNumbers');",
" pm.expect(jsonData.vendors[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.vendors[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.vendors[0]).to.have.property('id');",
"",
" pm.expect(jsonData.vendors[0]).to.have.property('addresses');",
" if (jsonData.vendors[0].addresses.length > 0){",
" pm.expect(jsonData.vendors[0].addresses[0]).to.have.property('street1');",
" pm.expect(jsonData.vendors[0].addresses[0]).to.have.property('addressType');",
" pm.expect(jsonData.vendors[0].addresses[0]).to.have.property('street2');",
" pm.expect(jsonData.vendors[0].addresses[0]).to.have.property('city');",
" pm.expect(jsonData.vendors[0].addresses[0]).to.have.property('state');",
" pm.expect(jsonData.vendors[0].addresses[0]).to.have.property('countrySubdivision');",
" pm.expect(jsonData.vendors[0].addresses[0]).to.have.property('country');",
" pm.expect(jsonData.vendors[0].addresses[0]).to.have.property('zipCode');",
" }",
"",
" if (jsonData.vendors[0].phoneNumbers.length > 0){",
" pm.expect(jsonData.vendors[0].phoneNumbers[0]).to.have.property('phoneNumberType');",
" pm.expect(jsonData.vendors[0].phoneNumbers[0]).to.have.property('phoneNumber');",
" }",
" ",
"});",
"",
"var jsonData = pm.response.json();",
"let vendorId = jsonData.vendors[0].id;",
"postman.setEnvironmentVariable(\"vendorId\", vendorId);",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/vendors?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "vendors"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
},
{
"key": "remoteId",
"value": "USSU-VSF02",
"disabled": true
}
]
}
},
"response": []
},
{
"name": "Create Vendor",
"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();",
" 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 \"vendorName\": \"Alloy+Vendor+{{$randomUUID}}\",\n \"vendorStatus\": \"ACTIVE\",\n \"addresses\": [\n { \n \"addressType\": \"BILLING\",\n \"street1\": \"Avenue of the Americas\",\n \"zipCode\": \"90210\",\n \"country\": \"US\"\n }\n ],\n \"phoneNumbers\": [\n {\n \"phoneNumberType\": \"MOBILE\",\n \"phoneNumber\": \"09173210215\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/vendors?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "vendors"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Vendor",
"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(\"[netsuite] vendor is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('vendor');",
" pm.expect(jsonData.vendor).to.not.be.null;",
" pm.expect(jsonData.vendor).to.have.property('remoteId');",
" pm.expect(jsonData.vendor).to.have.property('vendorName');",
" pm.expect(jsonData.vendor).to.have.property('email');",
" pm.expect(jsonData.vendor).to.have.property('taxNumber');",
" pm.expect(jsonData.vendor).to.have.property('vendorStatus');",
" pm.expect(jsonData.vendor).to.have.property('currency');",
" pm.expect(jsonData.vendor).to.have.property('companyId');",
" pm.expect(jsonData.vendor).to.have.property('addresses');",
" pm.expect(jsonData.vendor.addresses).to.be.an('array');",
" pm.expect(jsonData.vendor).to.have.property('phoneNumbers');",
" pm.expect(jsonData.vendor).to.have.property('createdTimestamp');",
" pm.expect(jsonData.vendor).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.vendor).to.have.property('id');",
" if(jsonData.vendor.addresses.length > 0) {",
" pm.expect(jsonData.vendor.addresses[0]).to.have.property('addressType');",
" pm.expect(jsonData.vendor.addresses[0]).to.have.property('street1');",
" pm.expect(jsonData.vendor.addresses[0]).to.have.property('street2');",
" pm.expect(jsonData.vendor.addresses[0]).to.have.property('city');",
" pm.expect(jsonData.vendor.addresses[0]).to.have.property('state');",
" pm.expect(jsonData.vendor.addresses[0]).to.have.property('country');",
" pm.expect(jsonData.vendor.addresses[0]).to.have.property('countrySubdivision');",
" pm.expect(jsonData.vendor.addresses[0]).to.have.property('country');",
" pm.expect(jsonData.vendor.addresses[0]).to.have.property('zipCode');",
" }",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/vendors/{{vendorId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"vendors",
"{{vendorId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Vendor",
"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();",
" 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 \"vendorName\": \"AlloyUpdate+{{$randomUUID}}\",\n \"vendorStatus\": \"ACTIVE\",\n \"addresses\": [\n { \n \"remoteId\": \"{{vendorAddressRemoteId}}\",\n \"addressType\": \"BILLING\",\n \"street1\": \"Dan Troy\",\n \"zipCode\": \"14221\",\n \"country\": \"US\"\n }\n ],\n \"phoneNumbers\": [\n {\n \"phoneNumberType\": \"MOBILE\",\n \"phoneNumber\": \"09173210215\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/vendors/{{vendorId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"vendors",
"{{vendorId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Vendor",
"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();",
" 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": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/vendors/{{vendorId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"vendors",
"{{vendorId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Vendor 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(\"[netsuite] vendor count is displayed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/vendors/count?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "vendors", "count"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Tax Rates",
"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 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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/tax-rates?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "tax-rates"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Tax Rate 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 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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/tax-rates/count?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"tax-rates",
"count"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Tax Rate",
"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 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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/tax-rates/{{taxRateId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"tax-rates",
"{{taxRateId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Tracking Categories",
"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 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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/tracking-categories?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"tracking-categories"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Tracking Category 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 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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/tracking-categories/count?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"tracking-categories",
"count"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Tracking Category",
"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 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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/tracking-categories/{{trackingCategoryId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"tracking-categories",
"{{trackingCategoryId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Items",
"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(\"[netsuite] items are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('items');",
" pm.expect(jsonData.items[0]).to.not.be.null;",
" pm.expect(jsonData.items[0]).to.have.property('remoteId');",
" pm.expect(jsonData.items[0]).to.have.property('itemName');",
" pm.expect(jsonData.items[0]).to.have.property('itemStatus');",
" pm.expect(jsonData.items[0]).to.have.property('itemType');",
" pm.expect(jsonData.items[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.items[0]).to.have.property('purchasePrice');",
" pm.expect(jsonData.items[0]).to.have.property('qtyOnHand');",
" pm.expect(jsonData.items[0]).to.have.property('billAccountId');",
" pm.expect(jsonData.items[0]).to.have.property('invoiceAccountId');",
" pm.expect(jsonData.items[0]).to.have.property('assetAccountId');",
" pm.expect(jsonData.items[0]).to.have.property('companyId');",
" pm.expect(jsonData.items[0]).to.have.property('createdTimestamp');",
" pm.expect(jsonData.items[0]).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.items[0]).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let itemId = jsonData.items[0].id;",
"postman.setEnvironmentVariable(\"itemId\", itemId);",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/items?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "items"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Item",
"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();",
" 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 \"itemName\": \"{{$randomAdjective}} {{$randomNoun}} Item\",\n \"itemType\": \"SERVICE\",\n \"billAccountId\": \"{{accountId}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/items?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "items"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Get Item 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(\"[netsuite] item count is displayed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('count');",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/items/count?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "items", "count"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Item",
"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(\"[netsuite] item is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('item');",
" pm.expect(jsonData.item).to.not.be.null;",
" pm.expect(jsonData.item).to.have.property('remoteId');",
" pm.expect(jsonData.item).to.have.property('itemName');",
" pm.expect(jsonData.item).to.have.property('itemStatus');",
" pm.expect(jsonData.item).to.have.property('itemType');",
" pm.expect(jsonData.item).to.have.property('unitPrice');",
" pm.expect(jsonData.item).to.have.property('purchasePrice');",
" pm.expect(jsonData.item).to.have.property('qtyOnHand');",
" pm.expect(jsonData.item).to.have.property('billAccountId');",
" pm.expect(jsonData.item).to.have.property('invoiceAccountId');",
" pm.expect(jsonData.item).to.have.property('assetAccountId');",
" pm.expect(jsonData.item).to.have.property('companyId');",
" pm.expect(jsonData.item).to.have.property('createdTimestamp');",
" pm.expect(jsonData.item).to.have.property('updatedTimestamp');",
" pm.expect(jsonData.item).to.have.property('id');",
"});",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"accept": true
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/items/{{itemId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"items",
"{{itemId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Item",
"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();",
" 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 \"itemStatus\": \"ACTIVE\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/items/{{itemId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"items",
"{{itemId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Item",
"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();",
" 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": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/items/{{itemId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"items",
"{{itemId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "List Payments",
"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 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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/payments?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "payments"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Create Payment",
"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 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": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"customerId\": \"{{customerId}}\",\n \"totalAmount\": 10\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/payments?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "payments"],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Payment",
"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 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
},
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/payments/{{paymentId}}?connectionId={{connectionId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"payments",
"{{paymentId}}"
],
"query": [
{
"key": "connectionId",
"value": "{{connectionId}}"
}
]
}
},
"response": []
},
{
"name": "Update Payment",
"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 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": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"totalAmount\": 100\n}",
"options": {
"raw": {
"language":