Skip to main content
Version: 2.0.0

NetSuite

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

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


JSON
{
"info": {
"_postman_id": "696b5e01-a914-4a6e-8295-c3764ad6600d",
"name": "Netsuite UAPI",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "19112139",
"_collection_link": "https://planetary-crater-495600.postman.co/workspace/Alloy-One-New~68c3616b-3ff3-473b-ba08-af2e97a835e5/collection/19112139-696b5e01-a914-4a6e-8295-c3764ad6600d?action=share&source=collection_link&creator=19112139"
},
"item": [
{
"name": "01 Setup",
"item": [
{
"name": "Setup UAPI Data",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;\r",
"\r",
"var contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\r",
"tests[\"Has Content-Type\"] = contentTypeHeaderExists;\r",
" \r",
"if (contentTypeHeaderExists) {\r",
" tests[\"Content-Type is application/json\"] = \r",
" responseHeaders[\"Content-Type\"].has(\"application/json\");\r",
"}\r",
"\r",
"\r",
"\r",
"var jsonData = pm.response.json();\r",
"console.log(jsonData);\r",
"let nsCredentialId = jsonData.nsCredentialId;\r",
"postman.setEnvironmentVariable(\"nsCredentialId\", nsCredentialId);\r",
"postman.setEnvironmentVariable(\"URL\", pm.environment.get(\"embedded_api_base_url\"));"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [
{
"key": "X-Alloy-Auth",
"value": "1234567890abcdefghijklmnopqrstuvwxyz",
"type": "text"
}
],
"url": {
"raw": "{{api_base_url}}/api/testHelpers/setupUapi/NETSUITE",
"host": ["{{api_base_url}}"],
"path": ["api", "testHelpers", "setupUapi", "NETSUITE"]
}
},
"response": []
}
]
},
{
"name": "02 Create then Retrieve",
"item": [
{
"name": "Create 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();",
" 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');",
" pm.expect(jsonData.account).to.have.property('remoteDeleted');",
" pm.expect(jsonData.account).to.have.property('createdAt');",
" pm.expect(jsonData.account).to.have.property('updatedAt');",
" pm.expect(jsonData.account.classification).to.equal('ASSET');",
" pm.expect(jsonData.account.accountType).to.equal('OTHER_ASSET');",
" pm.expect(jsonData.account.currency).to.equal('USD');",
"});",
"",
"var jsonData = pm.response.json();",
"let accountId = jsonData.account.id;",
"postman.setEnvironmentVariable(\"accountId\", accountId);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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\": \"FrancisChild+{{$randomUUID}}\",\n \"accountType\": \"OTHER_ASSET\",\n \"currency\": \"USD\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/accounts?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "accounts"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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');",
" pm.expect(jsonData.account).to.have.property('remoteDeleted');",
" pm.expect(jsonData.account).to.have.property('createdAt');",
" pm.expect(jsonData.account).to.have.property('updatedAt');",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"accounts",
"{{accountId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"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(\"[netsuite] 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.addresses).to.be.an('array').that.is.not.empty;",
" pm.expect(jsonData.customer.addresses[0]).to.have.property('addressType');",
" pm.expect(jsonData.customer.addresses[0]).to.have.property('street1');",
" pm.expect(jsonData.customer).to.have.property('phoneNumbers');",
" pm.expect(jsonData.customer.phoneNumbers).to.be.an('array').that.is.not.empty;",
" pm.expect(jsonData.customer.phoneNumbers[0]).to.have.property('phoneNumberType');",
" pm.expect(jsonData.customer.phoneNumbers[0]).to.have.property('phoneNumber');",
" pm.expect(jsonData.customer).to.have.property('addresses');",
" pm.expect(jsonData.customer).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.customer).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.customer).to.have.property('remoteDeleted');",
" pm.expect(jsonData.customer).to.have.property('createdAt');",
" pm.expect(jsonData.customer).to.have.property('updatedAt');",
" pm.expect(jsonData.customer).to.have.property('id');",
" pm.expect(jsonData.customer.addresses[0].addressType).to.equal('BILLING');",
" pm.expect(jsonData.customer.addresses[0].street1).to.equal('Beverly Hills');",
" pm.expect(jsonData.customer.addresses[0].zipCode).to.equal('90210');",
" pm.expect(jsonData.customer.addresses[0].country).to.equal('US');",
" pm.expect(jsonData.customer.phoneNumbers[0].phoneNumber).to.equal('09173210215');",
" pm.expect(jsonData.customer.phoneNumbers[0].phoneNumberType).to.equal('MOBILE');",
"});",
"",
"var jsonData = pm.response.json();",
"let customerId = jsonData.customer.id;",
"postman.setEnvironmentVariable(\"customerId\", customerId);",
"let customerAddressRemoteId = jsonData.customer.addresses[0].remoteId;",
"postman.setEnvironmentVariable(\"customerAddressRemoteId\", customerAddressRemoteId);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "customers"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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('remoteCreatedAt');",
" pm.expect(jsonData.customer).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.customer).to.have.property('remoteDeleted');",
" pm.expect(jsonData.customer).to.have.property('createdAt');",
" pm.expect(jsonData.customer).to.have.property('updatedAt');",
" pm.expect(jsonData.customer).to.have.property('id');",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"customers",
"{{customerId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Create 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(\"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').that.is.not.empty;",
" pm.expect(jsonData.vendor).to.have.property('phoneNumbers');",
" pm.expect(jsonData.vendor).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.vendor).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.vendor).to.have.property('remoteDeleted');",
" pm.expect(jsonData.vendor).to.have.property('createdAt');",
" pm.expect(jsonData.vendor).to.have.property('updatedAt');",
" pm.expect(jsonData.vendor).to.have.property('id');",
" 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');",
" pm.expect(jsonData.vendor.addresses[0].street1).to.equal('Avenue of the Americas');",
" pm.expect(jsonData.vendor.addresses[0].zipCode).to.equal('90210');",
"",
"});",
"",
"var jsonData = pm.response.json();",
"let vendorId = jsonData.vendor.id;",
"postman.setEnvironmentVariable(\"vendorId\", vendorId);",
"let vendorAddressRemoteId = jsonData.vendor.addresses[0].remoteId;",
"postman.setEnvironmentVariable(\"vendorAddressRemoteId\", vendorAddressRemoteId);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "vendors"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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('remoteCreatedAt');",
" pm.expect(jsonData.vendor).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.vendor).to.have.property('remoteDeleted');",
" pm.expect(jsonData.vendor).to.have.property('createdAt');",
" pm.expect(jsonData.vendor).to.have.property('updatedAt');",
" 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",
"packages": {}
}
}
],
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"vendors",
"{{vendorId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "items"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Create Payment",
"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] payment is created correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('payment');",
" pm.expect(jsonData.payment).to.not.be.null;",
" pm.expect(jsonData.payment).to.have.property('remoteId');",
" pm.expect(jsonData.payment).to.have.property('transactionDate');",
" pm.expect(jsonData.payment).to.have.property('customerId');",
" pm.expect(jsonData.payment).to.have.property('vendorId');",
" pm.expect(jsonData.payment).to.have.property('accountId');",
" pm.expect(jsonData.payment).to.have.property('currency');",
" pm.expect(jsonData.payment).to.have.property('exchangeRate');",
" pm.expect(jsonData.payment).to.have.property('companyId');",
" pm.expect(jsonData.payment).to.have.property('totalAmount');",
" pm.expect(jsonData.payment).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.payment).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.payment).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.payment).to.have.property('remoteDeleted');",
" pm.expect(jsonData.payment).to.have.property('createdAt');",
" pm.expect(jsonData.payment).to.have.property('updatedAt');",
" pm.expect(jsonData.payment).to.have.property('id');",
" pm.expect(jsonData.payment.totalAmount).to.equal(10);",
"});",
"",
"var jsonData = pm.response.json();",
"let paymentId = jsonData.payment.id;",
"postman.setEnvironmentVariable(\"paymentId\", paymentId);",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "payments"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Payment",
"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] payment is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('payment');",
" pm.expect(jsonData.payment).to.not.be.null;",
" pm.expect(jsonData.payment).to.have.property('remoteId');",
" pm.expect(jsonData.payment).to.have.property('transactionDate');",
" pm.expect(jsonData.payment).to.have.property('customerId');",
" pm.expect(jsonData.payment).to.have.property('vendorId');",
" pm.expect(jsonData.payment).to.have.property('accountId');",
" pm.expect(jsonData.payment).to.have.property('currency');",
" pm.expect(jsonData.payment).to.have.property('exchangeRate');",
" pm.expect(jsonData.payment).to.have.property('companyId');",
" pm.expect(jsonData.payment).to.have.property('totalAmount');",
" pm.expect(jsonData.payment).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.payment).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.payment).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.payment).to.have.property('remoteDeleted');",
" pm.expect(jsonData.payment).to.have.property('createdAt');",
" pm.expect(jsonData.payment).to.have.property('updatedAt');",
" pm.expect(jsonData.payment).to.have.property('id');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"payments",
"{{paymentId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Create Account For Create PO",
"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();",
" 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');",
" pm.expect(jsonData.account.classification).to.equal('ASSET');",
" pm.expect(jsonData.account.accountType).to.equal('BANK');",
" pm.expect(jsonData.account.currency).to.equal('USD');",
"});",
"",
"var jsonData = pm.response.json();",
"let accountId = jsonData.account.id;",
"postman.setEnvironmentVariable(\"accountIdForCreatePO\", accountId);"
],
"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\": \"{{$randomBankAccountName}}+{{$randomUUID}}\",\n \"accountType\": \"BANK\",\n \"currency\": \"USD\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/accounts?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "accounts"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Get Item For Create PO",
"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('remoteCreatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.items[0]).to.have.property('createdAt');",
" pm.expect(jsonData.items[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('id');",
"});",
"",
"console.log(pm.response.json());",
"",
"var jsonData = pm.response.json();",
"let itemId = jsonData.items[0].id;",
"postman.setEnvironmentVariable(\"itemIdForCreatePO\", itemId);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}&itemType=INVENTORY",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "items"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
},
{
"key": "itemType",
"value": "INVENTORY"
}
]
}
},
"response": []
},
{
"name": "Create Purchase 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(\"[netsuite] purchase order is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('purchaseOrder');",
" pm.expect(jsonData.purchaseOrder).to.not.be.null;",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('purchaseOrderStatus');",
" pm.expect(jsonData.purchaseOrder).to.have.property('issueDate');",
" pm.expect(jsonData.purchaseOrder).to.have.property('purchaseOrderNumber');",
" pm.expect(jsonData.purchaseOrder).to.have.property('deliveryDate');",
" pm.expect(jsonData.purchaseOrder).to.have.property('deliveryAddress');",
" pm.expect(jsonData.purchaseOrder).to.have.property('vendorId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('accountId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('memo');",
" pm.expect(jsonData.purchaseOrder).to.have.property('companyId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('totalAmount');",
" pm.expect(jsonData.purchaseOrder).to.have.property('currency');",
" pm.expect(jsonData.purchaseOrder).to.have.property('exchangeRate');",
" pm.expect(jsonData.purchaseOrder).to.have.property('lineItems');",
" pm.expect(jsonData.purchaseOrder).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteDeleted');",
" pm.expect(jsonData.purchaseOrder).to.have.property('createdAt');",
" pm.expect(jsonData.purchaseOrder).to.have.property('updatedAt');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('taxAmount');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('totalLineAmount');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('trackingCategoryIds');",
"});",
"",
"var jsonData = pm.response.json();",
"let purchaseOrderId = jsonData.purchaseOrder.id;",
"let purchaseOrderLineItemId = jsonData.purchaseOrder.lineItems[0].id;",
"postman.setEnvironmentVariable(\"purchaseOrderId\", purchaseOrderId);",
"postman.setEnvironmentVariable(\"purchaseOrderLineItemId\", purchaseOrderLineItemId)",
"console.log(jsonData);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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 \"vendorId\": \"{{vendorId}}\",\n \"lineItems\": [{\n \"description\": \"{{$randomAdjective}} 1\",\n \"accountingItemId\": \"{{itemIdForCreatePO}}\",\n \"totalLineAmount\": 100\n }]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/purchase-orders?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"purchase-orders"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Purchase 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(\"purchase order is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('purchaseOrder');",
" pm.expect(jsonData.purchaseOrder).to.not.be.null;",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('purchaseOrderStatus');",
" pm.expect(jsonData.purchaseOrder).to.have.property('issueDate');",
" pm.expect(jsonData.purchaseOrder).to.have.property('purchaseOrderNumber');",
" pm.expect(jsonData.purchaseOrder).to.have.property('deliveryDate');",
" pm.expect(jsonData.purchaseOrder).to.have.property('deliveryAddress');",
" pm.expect(jsonData.purchaseOrder).to.have.property('vendorId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('accountId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('memo');",
" pm.expect(jsonData.purchaseOrder).to.have.property('companyId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('totalAmount');",
" pm.expect(jsonData.purchaseOrder).to.have.property('currency');",
" pm.expect(jsonData.purchaseOrder).to.have.property('exchangeRate');",
" pm.expect(jsonData.purchaseOrder).to.have.property('lineItems');",
" pm.expect(jsonData.purchaseOrder).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteDeleted');",
" pm.expect(jsonData.purchaseOrder).to.have.property('createdAt');",
" pm.expect(jsonData.purchaseOrder).to.have.property('updatedAt');",
" pm.expect(jsonData.purchaseOrder).to.have.property('id');",
"});",
"console.log(pm.response.json());"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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/purchase-orders/{{purchaseOrderId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"purchase-orders",
"{{purchaseOrderId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Update Purchase 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(\"[netsuite] purchase order is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('purchaseOrder');",
" pm.expect(jsonData.purchaseOrder).to.not.be.null;",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('purchaseOrderStatus');",
" pm.expect(jsonData.purchaseOrder).to.have.property('issueDate');",
" pm.expect(jsonData.purchaseOrder).to.have.property('purchaseOrderNumber');",
" pm.expect(jsonData.purchaseOrder).to.have.property('deliveryDate');",
" pm.expect(jsonData.purchaseOrder).to.have.property('deliveryAddress');",
" pm.expect(jsonData.purchaseOrder).to.have.property('vendorId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('accountId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('memo');",
" pm.expect(jsonData.purchaseOrder).to.have.property('companyId');",
" pm.expect(jsonData.purchaseOrder).to.have.property('totalAmount');",
" pm.expect(jsonData.purchaseOrder).to.have.property('currency');",
" pm.expect(jsonData.purchaseOrder).to.have.property('exchangeRate');",
" pm.expect(jsonData.purchaseOrder).to.have.property('lineItems');",
" pm.expect(jsonData.purchaseOrder).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.purchaseOrder).to.have.property('remoteDeleted');",
" pm.expect(jsonData.purchaseOrder).to.have.property('createdAt');",
" pm.expect(jsonData.purchaseOrder).to.have.property('updatedAt');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('taxAmount');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('totalLineAmount');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.purchaseOrder.lineItems[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.purchaseOrder.lineItems.length).to.equal(2);",
"});",
"console.log(pm.request.body);",
"console.log(pm.response.json());"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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 \"vendorId\": \"{{vendorId}}\",\n \"lineItems\": [\n {\n \"id\": \"{{purchaseOrderLineItemId}}\",\n \"description\": \"{{$randomAdjective}} - Updated\",\n \"accountingItemId\": \"{{itemIdForCreatePO}}\",\n \"quantity\": 2,\n \"totalLineAmount\": 200\n },\n {\n \"description\": \"{{$randomAdjective}} - New\",\n \"accountingItemId\": \"{{itemIdForCreatePO}}\",\n \"quantity\": 2,\n \"totalLineAmount\": 300\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/purchase-orders/{{purchaseOrderId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"purchase-orders",
"{{purchaseOrderId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Get Item For Create Bill",
"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('remoteCreatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.items[0]).to.have.property('createdAt');",
" pm.expect(jsonData.items[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let itemId = jsonData.items[0].id;",
"postman.setEnvironmentVariable(\"itemIdForCreateBill\", itemId);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}&itemType=INVENTORY",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "items"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
},
{
"key": "itemType",
"value": "INVENTORY"
}
]
}
},
"response": []
},
{
"name": "Create Bill",
"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(\"bill is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('bill');",
" pm.expect(jsonData.bill).to.not.be.null;",
" pm.expect(jsonData.bill).to.have.property('remoteId');",
" pm.expect(jsonData.bill).to.have.property('vendorId');",
" pm.expect(jsonData.bill).to.have.property('billNumber');",
" pm.expect(jsonData.bill).to.have.property('issueDate');",
" pm.expect(jsonData.bill).to.have.property('dueDate');",
" pm.expect(jsonData.bill).to.have.property('paidOnDate');",
" pm.expect(jsonData.bill).to.have.property('memo');",
" pm.expect(jsonData.bill).to.have.property('companyId');",
" pm.expect(jsonData.bill).to.have.property('currency');",
" pm.expect(jsonData.bill).to.have.property('exchangeRate');",
" pm.expect(jsonData.bill).to.have.property('totalDiscount');",
" pm.expect(jsonData.bill).to.have.property('subTotal');",
" pm.expect(jsonData.bill).to.have.property('billStatus');",
" pm.expect(jsonData.bill).to.have.property('totalTaxAmount');",
" pm.expect(jsonData.bill).to.have.property('totalAmount');",
" pm.expect(jsonData.bill).to.have.property('balance');",
" pm.expect(jsonData.bill).to.have.property('trackingCategories');",
" pm.expect(jsonData.bill).to.have.property('lineItems');",
" pm.expect(jsonData.bill).to.have.property('purchaseOrders');",
" pm.expect(jsonData.bill).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.bill).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.bill).to.have.property('remoteDeleted');",
" pm.expect(jsonData.bill).to.have.property('createdAt');",
" pm.expect(jsonData.bill).to.have.property('updatedAt');",
" pm.expect(jsonData.bill).to.have.property('id');",
" pm.expect(jsonData.bill.billNumber).to.equal('PLDT-001');",
" pm.expect(jsonData.bill.lineItems[0].description).to.equal('Line Item 1');",
" pm.expect(jsonData.bill.lineItems[0].totalAmount).to.equal(100);",
"});",
"",
"var jsonData = pm.response.json();",
"let billId = jsonData.bill.id;",
"let billLineItemId = jsonData.bill.lineItems[0].id;",
"postman.setEnvironmentVariable(\"billId\", billId);",
"postman.setEnvironmentVariable(\"billLineItemId\", billLineItemId);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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 \"vendorId\": \"{{vendorId}}\",\n \"billNumber\": \"PLDT-001\",\n \"lineItems\": [\n {\n \"description\": \"Line Item 1\",\n \"accountingItemId\": \"{{itemIdForCreateBill}}\",\n \"totalAmount\": 100\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/bills?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "bills"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Bill",
"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] bill is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('bill');",
" pm.expect(jsonData.bill).to.not.be.null;",
" pm.expect(jsonData.bill).to.have.property('remoteId');",
" pm.expect(jsonData.bill).to.have.property('vendorId');",
" pm.expect(jsonData.bill).to.have.property('billNumber');",
" pm.expect(jsonData.bill).to.have.property('issueDate');",
" pm.expect(jsonData.bill).to.have.property('dueDate');",
" pm.expect(jsonData.bill).to.have.property('paidOnDate');",
" pm.expect(jsonData.bill).to.have.property('memo');",
" pm.expect(jsonData.bill).to.have.property('companyId');",
" pm.expect(jsonData.bill).to.have.property('currency');",
" pm.expect(jsonData.bill).to.have.property('exchangeRate');",
" pm.expect(jsonData.bill).to.have.property('totalDiscount');",
" pm.expect(jsonData.bill).to.have.property('subTotal');",
" pm.expect(jsonData.bill).to.have.property('billStatus');",
" pm.expect(jsonData.bill).to.have.property('totalTaxAmount');",
" pm.expect(jsonData.bill).to.have.property('totalAmount');",
" pm.expect(jsonData.bill).to.have.property('balance');",
" pm.expect(jsonData.bill).to.have.property('trackingCategories');",
" pm.expect(jsonData.bill).to.have.property('lineItems');",
" pm.expect(jsonData.bill).to.have.property('purchaseOrders');",
" pm.expect(jsonData.bill).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.bill).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.bill).to.have.property('remoteDeleted');",
" pm.expect(jsonData.bill).to.have.property('createdAt');",
" pm.expect(jsonData.bill).to.have.property('updatedAt');",
" pm.expect(jsonData.bill).to.have.property('id');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.bill.lineItems[0]).to.have.property('companyId');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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/bills/{{billId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"bills",
"{{billId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Get Item For Create Invoice",
"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('remoteCreatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.items[0]).to.have.property('createdAt');",
" pm.expect(jsonData.items[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let itemId = jsonData.items[0].id;",
"postman.setEnvironmentVariable(\"itemIdForCreateInvoice\", itemId);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}&itemType=INVENTORY",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "items"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
},
{
"key": "itemType",
"value": "INVENTORY"
}
]
}
},
"response": []
},
{
"name": "Create Invoice",
"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] invoice is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('invoice');",
" pm.expect(jsonData.invoice).to.not.be.null;",
" pm.expect(jsonData.invoice).to.have.property('remoteId');",
" pm.expect(jsonData.invoice).to.have.property('customerId');",
" pm.expect(jsonData.invoice).to.have.property('invoiceNumber');",
" pm.expect(jsonData.invoice).to.have.property('issueDate');",
" pm.expect(jsonData.invoice).to.have.property('dueDate');",
" pm.expect(jsonData.invoice).to.have.property('paidOnDate');",
" pm.expect(jsonData.invoice).to.have.property('memo');",
" pm.expect(jsonData.invoice).to.have.property('companyId');",
" pm.expect(jsonData.invoice).to.have.property('currency');",
" pm.expect(jsonData.invoice).to.have.property('exchangeRate');",
" pm.expect(jsonData.invoice).to.have.property('totalDiscount');",
" pm.expect(jsonData.invoice).to.have.property('subTotal');",
" pm.expect(jsonData.invoice).to.have.property('invoiceStatus');",
" pm.expect(jsonData.invoice).to.have.property('totalTaxAmount');",
" pm.expect(jsonData.invoice).to.have.property('totalAmount');",
" pm.expect(jsonData.invoice).to.have.property('balance');",
" pm.expect(jsonData.invoice).to.have.property('trackingCategories');",
" pm.expect(jsonData.invoice).to.have.property('lineItems');",
" pm.expect(jsonData.invoice).to.have.property('purchaseOrders');",
" pm.expect(jsonData.invoice).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.invoice).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.invoice).to.have.property('remoteDeleted');",
" pm.expect(jsonData.invoice).to.have.property('createdAt');",
" pm.expect(jsonData.invoice).to.have.property('updatedAt');",
" pm.expect(jsonData.invoice).to.have.property('id');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('companyId');",
"});",
"",
"var jsonData = pm.response.json();",
"let invoiceId = jsonData.invoice.id;",
"postman.setEnvironmentVariable(\"invoiceId\", invoiceId);",
"let invoiceLineItemId = jsonData.invoice.lineItems[0].id;",
"postman.setEnvironmentVariable(\"invoiceLineItemId\", invoiceLineItemId);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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 \"invoiceNumber\": \"ALY-001\",\n \"lineItems\": [\n {\n \"description\": \"Francis Menguito - Developer\",\n \"totalAmount\": 10000,\n \"accountingItemId\": \"{{itemIdForCreateInvoice}}\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/invoices?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "invoices"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Invoice",
"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(\"invoice is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('invoice');",
" pm.expect(jsonData.invoice).to.not.be.null;",
" pm.expect(jsonData.invoice).to.have.property('remoteId');",
" pm.expect(jsonData.invoice).to.have.property('customerId');",
" pm.expect(jsonData.invoice).to.have.property('invoiceNumber');",
" pm.expect(jsonData.invoice).to.have.property('issueDate');",
" pm.expect(jsonData.invoice).to.have.property('dueDate');",
" pm.expect(jsonData.invoice).to.have.property('paidOnDate');",
" pm.expect(jsonData.invoice).to.have.property('memo');",
" pm.expect(jsonData.invoice).to.have.property('companyId');",
" pm.expect(jsonData.invoice).to.have.property('currency');",
" pm.expect(jsonData.invoice).to.have.property('exchangeRate');",
" pm.expect(jsonData.invoice).to.have.property('totalDiscount');",
" pm.expect(jsonData.invoice).to.have.property('subTotal');",
" pm.expect(jsonData.invoice).to.have.property('invoiceStatus');",
" pm.expect(jsonData.invoice).to.have.property('totalTaxAmount');",
" pm.expect(jsonData.invoice).to.have.property('totalAmount');",
" pm.expect(jsonData.invoice).to.have.property('balance');",
" pm.expect(jsonData.invoice).to.have.property('trackingCategories');",
" pm.expect(jsonData.invoice).to.have.property('lineItems');",
" pm.expect(jsonData.invoice).to.have.property('purchaseOrders');",
" pm.expect(jsonData.invoice).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.invoice).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.invoice).to.have.property('remoteDeleted');",
" pm.expect(jsonData.invoice).to.have.property('createdAt');",
" pm.expect(jsonData.invoice).to.have.property('updatedAt');",
" pm.expect(jsonData.invoice).to.have.property('id');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('companyId');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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/invoices/{{invoiceId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"invoices",
"{{invoiceId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
}
]
},
{
"name": "03 Update",
"item": [
{
"name": "Update 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(\"account is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" 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');",
" pm.expect(jsonData.account).to.have.property('remoteDeleted');",
" pm.expect(jsonData.account).to.have.property('createdAt');",
" pm.expect(jsonData.account).to.have.property('updatedAt');",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"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\": \"CachoChildren+{{$randomUUID}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/accounts/{{accountId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"accounts",
"{{accountId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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(\"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('remoteCreatedAt');",
" pm.expect(jsonData.customer).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.customer).to.have.property('remoteDeleted');",
" pm.expect(jsonData.customer).to.have.property('createdAt');",
" pm.expect(jsonData.customer).to.have.property('updatedAt');",
" pm.expect(jsonData.customer).to.have.property('id');",
" pm.expect(jsonData.customer.customerName).to.include(\"AlloyUpdate\");",
" pm.expect(jsonData.customer.addresses).to.be.an('array').that.is.not.empty;",
" pm.expect(jsonData.customer.addresses[0].street1).to.include(\"Lombard\");",
" pm.expect(jsonData.customer.addresses[0].zipCode).to.include(\"94012\");",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"customers",
"{{customerId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Update 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(\"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').that.is.not.empty;",
" pm.expect(jsonData.vendor).to.have.property('phoneNumbers');",
" pm.expect(jsonData.vendor).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.vendor).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.vendor).to.have.property('remoteDeleted');",
" pm.expect(jsonData.vendor).to.have.property('createdAt');",
" pm.expect(jsonData.vendor).to.have.property('updatedAt');",
" pm.expect(jsonData.vendor).to.have.property('id');",
" 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');",
" pm.expect(jsonData.vendor.addresses[0].street1).to.equal('Dan Troy');",
" pm.expect(jsonData.vendor.addresses[0].zipCode).to.equal('14221');",
" pm.expect(jsonData.vendor.vendorName).to.include(\"AlloyUpdate\");",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"vendors",
"{{vendorId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Update Payment",
"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(\"payment is created correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('payment');",
" pm.expect(jsonData.payment).to.not.be.null;",
" pm.expect(jsonData.payment).to.have.property('remoteId');",
" pm.expect(jsonData.payment).to.have.property('transactionDate');",
" pm.expect(jsonData.payment).to.have.property('customerId');",
" pm.expect(jsonData.payment).to.have.property('vendorId');",
" pm.expect(jsonData.payment).to.have.property('accountId');",
" pm.expect(jsonData.payment).to.have.property('currency');",
" pm.expect(jsonData.payment).to.have.property('exchangeRate');",
" pm.expect(jsonData.payment).to.have.property('companyId');",
" pm.expect(jsonData.payment).to.have.property('totalAmount');",
" pm.expect(jsonData.payment).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.payment).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.payment).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.payment).to.have.property('remoteDeleted');",
" pm.expect(jsonData.payment).to.have.property('createdAt');",
" pm.expect(jsonData.payment).to.have.property('updatedAt');",
" pm.expect(jsonData.payment).to.have.property('id');",
" pm.expect(jsonData.payment.totalAmount).to.equal(100);",
"});",
"",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/payments/{{paymentId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"payments",
"{{paymentId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Update Bill",
"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(\"bill is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('bill');",
" pm.expect(jsonData.bill).to.not.be.null;",
" pm.expect(jsonData.bill).to.have.property('remoteId');",
" pm.expect(jsonData.bill).to.have.property('vendorId');",
" pm.expect(jsonData.bill).to.have.property('billNumber');",
" pm.expect(jsonData.bill).to.have.property('issueDate');",
" pm.expect(jsonData.bill).to.have.property('dueDate');",
" pm.expect(jsonData.bill).to.have.property('paidOnDate');",
" pm.expect(jsonData.bill).to.have.property('memo');",
" pm.expect(jsonData.bill).to.have.property('companyId');",
" pm.expect(jsonData.bill).to.have.property('currency');",
" pm.expect(jsonData.bill).to.have.property('exchangeRate');",
" pm.expect(jsonData.bill).to.have.property('totalDiscount');",
" pm.expect(jsonData.bill).to.have.property('subTotal');",
" pm.expect(jsonData.bill).to.have.property('billStatus');",
" pm.expect(jsonData.bill).to.have.property('totalTaxAmount');",
" pm.expect(jsonData.bill).to.have.property('totalAmount');",
" pm.expect(jsonData.bill).to.have.property('balance');",
" pm.expect(jsonData.bill).to.have.property('trackingCategories');",
" pm.expect(jsonData.bill).to.have.property('lineItems');",
" pm.expect(jsonData.bill).to.have.property('purchaseOrders');",
" pm.expect(jsonData.bill).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.bill).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.bill).to.have.property('remoteDeleted');",
" pm.expect(jsonData.bill).to.have.property('createdAt');",
" pm.expect(jsonData.bill).to.have.property('updatedAt');",
" pm.expect(jsonData.bill).to.have.property('id');",
" pm.expect(jsonData.bill.billNumber).to.equal('PLDT-001');",
" pm.expect(jsonData.bill.lineItems[0].description).to.equal('Line Item 1');",
" pm.expect(jsonData.bill.lineItems[0].totalAmount).to.equal(200);",
" pm.expect(jsonData.bill.lineItems.length).to.equal(2);",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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 \"vendorId\": \"{{vendorId}}\",\n \"billNumber\": \"PLDT-001\",\n \"lineItems\": [\n {\n \"id\": \"{{billLineItemId}}\",\n \"description\": \"Line Item 1\",\n \"accountingItemId\": \"{{itemIdForCreateBill}}\",\n \"totalAmount\": 200\n },\n {\n \"description\": \"Line Item 2\",\n \"accountingItemId\": \"{{itemIdForCreateBill}}\",\n \"totalAmount\": 300\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/bills/{{billId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"bills",
"{{billId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Update Invoice",
"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] invoice is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('invoice');",
" pm.expect(jsonData.invoice).to.not.be.null;",
" pm.expect(jsonData.invoice).to.have.property('remoteId');",
" pm.expect(jsonData.invoice).to.have.property('customerId');",
" pm.expect(jsonData.invoice).to.have.property('invoiceNumber');",
" pm.expect(jsonData.invoice).to.have.property('issueDate');",
" pm.expect(jsonData.invoice).to.have.property('dueDate');",
" pm.expect(jsonData.invoice).to.have.property('paidOnDate');",
" pm.expect(jsonData.invoice).to.have.property('memo');",
" pm.expect(jsonData.invoice).to.have.property('companyId');",
" pm.expect(jsonData.invoice).to.have.property('currency');",
" pm.expect(jsonData.invoice).to.have.property('exchangeRate');",
" pm.expect(jsonData.invoice).to.have.property('totalDiscount');",
" pm.expect(jsonData.invoice).to.have.property('subTotal');",
" pm.expect(jsonData.invoice).to.have.property('invoiceStatus');",
" pm.expect(jsonData.invoice).to.have.property('totalTaxAmount');",
" pm.expect(jsonData.invoice).to.have.property('totalAmount');",
" pm.expect(jsonData.invoice).to.have.property('balance');",
" pm.expect(jsonData.invoice).to.have.property('trackingCategories');",
" pm.expect(jsonData.invoice).to.have.property('lineItems');",
" pm.expect(jsonData.invoice).to.have.property('purchaseOrders');",
" pm.expect(jsonData.invoice).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.invoice).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.invoice).to.have.property('remoteDeleted');",
" pm.expect(jsonData.invoice).to.have.property('createdAt');",
" pm.expect(jsonData.invoice).to.have.property('updatedAt');",
" pm.expect(jsonData.invoice).to.have.property('id');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.invoice.lineItems[0]).to.have.property('companyId');",
" pm.expect(jsonData.invoice.lineItems.length).to.equal(2);",
"});",
"",
"console.log(pm.response.json());",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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 \"customerId\": \"{{customerId}}\",\n \"invoiceNumber\": \"ALY-001\",\n \"lineItems\": [\n {\n \"id\": \"{{invoiceLineItemId}}\",\n \"description\": \"Francis Menguito - Developer\",\n \"totalAmount\": 15000,\n \"accountingItemId\": \"{{itemIdForCreateInvoice}}\"\n },\n {\n \"description\": \"Maynard Cantay - Developer\",\n \"totalAmount\": 10000,\n \"accountingItemId\": \"{{itemIdForCreateInvoice}}\"\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{URL}}/{{API_VERSION}}/one/accounting/invoices/{{invoiceId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"invoices",
"{{invoiceId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
}
]
},
{
"name": "04 List and Count",
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "company-info"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"company-info",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"company-info",
"{{companyInfoId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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');",
" pm.expect(jsonData.accounts[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.accounts[0]).to.have.property('createdAt');",
" pm.expect(jsonData.accounts[0]).to.have.property('updatedAt');",
"});",
"",
"var jsonData = pm.response.json();",
"let accountId = jsonData.accounts[0].id;",
"postman.setEnvironmentVariable(\"accountId\", accountId);",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "accounts"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Accounts Filters",
"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');",
" pm.expect(jsonData.accounts[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.accounts[0]).to.have.property('createdAt');",
" pm.expect(jsonData.accounts[0]).to.have.property('updatedAt');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}&accountNameContains=Francis&accountType=OTHER_ASSET&currency=USD&accountStatus=ACTIVE",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "accounts"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
},
{
"key": "accountNameContains",
"value": "Francis"
},
{
"key": "accountType",
"value": "OTHER_ASSET"
},
{
"key": "currency",
"value": "USD"
},
{
"key": "accountStatus",
"value": "ACTIVE"
}
]
}
},
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"accounts",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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('remoteCreatedAt');",
" pm.expect(jsonData.customers[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.customers[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.customers[0]).to.have.property('createdAt');",
" pm.expect(jsonData.customers[0]).to.have.property('updatedAt');",
" 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",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "customers"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Customers Filters",
"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('remoteCreatedAt');",
" pm.expect(jsonData.customers[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.customers[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.customers[0]).to.have.property('createdAt');",
" pm.expect(jsonData.customers[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.customers[0]).to.have.property('id');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}&customerNameContains=Alloy&customerStatus=ACTIVE&currency=USD",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "customers"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
},
{
"key": "customerNameContains",
"value": "Alloy"
},
{
"key": "customerStatus",
"value": "ACTIVE"
},
{
"key": "currency",
"value": "USD"
}
]
}
},
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"customers",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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('remoteCreatedAt');",
" pm.expect(jsonData.vendors[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.vendors[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.vendors[0]).to.have.property('createdAt');",
" pm.expect(jsonData.vendors[0]).to.have.property('updatedAt');",
" 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",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "vendors"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Vendors Filters",
"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('remoteCreatedAt');",
" pm.expect(jsonData.vendors[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.vendors[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.vendors[0]).to.have.property('createdAt');",
" pm.expect(jsonData.vendors[0]).to.have.property('updatedAt');",
" 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');",
" }",
" ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}&vendorNameContains=Alloy&vendorStatus=ACTIVE&currency=USD",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "vendors"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
},
{
"key": "vendorNameContains",
"value": "Alloy"
},
{
"key": "vendorStatus",
"value": "ACTIVE"
},
{
"key": "currency",
"value": "USD"
}
]
}
},
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"vendors",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "tax-rates"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"tax-rates",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"tax-rates",
"{{taxRateId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Tracking Categories",
"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] trackingCategories are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('trackingCategories');",
" pm.expect(jsonData.trackingCategories[0]).to.not.be.null;",
" pm.expect(jsonData.trackingCategories[0]).to.have.property('remoteId');",
" pm.expect(jsonData.trackingCategories[0]).to.have.property('trackingCategoryName');",
" pm.expect(jsonData.trackingCategories[0]).to.have.property('trackingCategoryStatus');",
" pm.expect(jsonData.trackingCategories[0]).to.have.property('trackingCategoryType');",
" pm.expect(jsonData.trackingCategories[0]).to.have.property('parentCategoryId');",
" pm.expect(jsonData.trackingCategories[0]).to.have.property('companyId');",
" pm.expect(jsonData.trackingCategories[0]).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let trackingCategoryId = jsonData.trackingCategories[0].id;",
"postman.setEnvironmentVariable(\"trackingCategoryId\", trackingCategoryId);",
""
],
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"tracking-categories"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Get Tracking Category 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(\"tracking category 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/tracking-categories/count?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"tracking-categories",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Retrieve Tracking Category",
"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] tracking category is retrieved correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('trackingCategory');",
" pm.expect(jsonData.trackingCategory).to.not.be.null;",
" pm.expect(jsonData.trackingCategory).to.have.property('remoteId');",
" pm.expect(jsonData.trackingCategory).to.have.property('trackingCategoryName');",
" pm.expect(jsonData.trackingCategory).to.have.property('trackingCategoryStatus');",
" pm.expect(jsonData.trackingCategory).to.have.property('trackingCategoryType');",
" pm.expect(jsonData.trackingCategory).to.have.property('parentCategoryId');",
" pm.expect(jsonData.trackingCategory).to.have.property('companyId');",
" pm.expect(jsonData.trackingCategory).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/tracking-categories/{{trackingCategoryId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"tracking-categories",
"{{trackingCategoryId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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('remoteCreatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.items[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.items[0]).to.have.property('createdAt');",
" pm.expect(jsonData.items[0]).to.have.property('updatedAt');",
" 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",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "items"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"items",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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('remoteCreatedAt');",
" pm.expect(jsonData.item).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.item).to.have.property('remoteDeleted');",
" pm.expect(jsonData.item).to.have.property('createdAt');",
" pm.expect(jsonData.item).to.have.property('updatedAt');",
" pm.expect(jsonData.item).to.have.property('id');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"items",
"{{itemId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"items",
"{{itemId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Payments",
"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] payments are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('payments');",
" pm.expect(jsonData.payments[0]).to.not.be.null;",
" pm.expect(jsonData.payments[0]).to.have.property('remoteId');",
" pm.expect(jsonData.payments[0]).to.have.property('transactionDate');",
" pm.expect(jsonData.payments[0]).to.have.property('customerId');",
" pm.expect(jsonData.payments[0]).to.have.property('vendorId');",
" pm.expect(jsonData.payments[0]).to.have.property('accountId');",
" pm.expect(jsonData.payments[0]).to.have.property('currency');",
" pm.expect(jsonData.payments[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.payments[0]).to.have.property('companyId');",
" pm.expect(jsonData.payments[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.payments[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.payments[0]).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.payments[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.payments[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.payments[0]).to.have.property('createdAt');",
" pm.expect(jsonData.payments[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.payments[0]).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let paymentId = jsonData.payments[0].id;",
"postman.setEnvironmentVariable(\"paymentId\", paymentId);",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "payments"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Payments Filters",
"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] payments are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('payments');",
" pm.expect(jsonData.payments[0]).to.not.be.null;",
" pm.expect(jsonData.payments[0]).to.have.property('remoteId');",
" pm.expect(jsonData.payments[0]).to.have.property('transactionDate');",
" pm.expect(jsonData.payments[0]).to.have.property('customerId');",
" pm.expect(jsonData.payments[0]).to.have.property('vendorId');",
" pm.expect(jsonData.payments[0]).to.have.property('accountId');",
" pm.expect(jsonData.payments[0]).to.have.property('currency');",
" pm.expect(jsonData.payments[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.payments[0]).to.have.property('companyId');",
" pm.expect(jsonData.payments[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.payments[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.payments[0]).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.payments[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.payments[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.payments[0]).to.have.property('createdAt');",
" pm.expect(jsonData.payments[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.payments[0]).to.have.property('id');",
"});",
"",
"var jsonData = pm.response.json();",
"let paymentId = jsonData.payments[0].id;",
"postman.setEnvironmentVariable(\"paymentId\", paymentId);",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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?credentialId={{nsCredentialId}}&currency=USD&totalAmount=10&totalAmountMin=1&totalAmountMax=10",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "payments"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
},
{
"key": "currency",
"value": "USD"
},
{
"key": "totalAmount",
"value": "10"
},
{
"key": "totalAmountMin",
"value": "1"
},
{
"key": "totalAmountMax",
"value": "10"
}
]
}
},
"response": []
},
{
"name": "Get Payment 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] payment 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/payments/count?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"payments",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Purchase 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(\"[netsuite] purchase orders are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('purchaseOrders');",
" pm.expect(jsonData.purchaseOrders[0]).to.not.be.null;",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('remoteId');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('purchaseOrderStatus');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('issueDate');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('purchaseOrderNumber');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('deliveryDate');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('deliveryAddress');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('vendorId');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('accountId');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('memo');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('companyId');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('currency');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('lineItems');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('createdAt');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('id');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('taxAmount');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('totalLineAmount');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('trackingCategoryIds');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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/purchase-orders?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"purchase-orders"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Purchase Orders Filters",
"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] purchase orders are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('purchaseOrders');",
" pm.expect(jsonData.purchaseOrders[0]).to.not.be.null;",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('remoteId');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('purchaseOrderStatus');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('issueDate');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('purchaseOrderNumber');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('deliveryDate');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('deliveryAddress');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('vendorId');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('accountId');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('memo');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('companyId');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('currency');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('lineItems');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('createdAt');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.purchaseOrders[0]).to.have.property('id');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('taxAmount');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('totalLineAmount');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.purchaseOrders[0].lineItems[0]).to.have.property('trackingCategoryIds');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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/purchase-orders?credentialId={{nsCredentialId}}&purchaseOrderStatus=OPEN",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"purchase-orders"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
},
{
"key": "totalAmount",
"value": "100",
"disabled": true
},
{
"key": "currency",
"value": "USD",
"disabled": true
},
{
"key": "purchaseOrderStatus",
"value": "OPEN"
}
]
}
},
"response": []
},
{
"name": "Get Purchase 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(\"purchase order 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/purchase-orders/count?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"purchase-orders",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Bills",
"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] bills are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('bills');",
" pm.expect(jsonData.bills[0]).to.not.be.null;",
" pm.expect(jsonData.bills[0]).to.have.property('remoteId');",
" pm.expect(jsonData.bills[0]).to.have.property('vendorId');",
" pm.expect(jsonData.bills[0]).to.have.property('billNumber');",
" pm.expect(jsonData.bills[0]).to.have.property('issueDate');",
" pm.expect(jsonData.bills[0]).to.have.property('dueDate');",
" pm.expect(jsonData.bills[0]).to.have.property('paidOnDate');",
" pm.expect(jsonData.bills[0]).to.have.property('memo');",
" pm.expect(jsonData.bills[0]).to.have.property('companyId');",
" pm.expect(jsonData.bills[0]).to.have.property('currency');",
" pm.expect(jsonData.bills[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.bills[0]).to.have.property('totalDiscount');",
" pm.expect(jsonData.bills[0]).to.have.property('subTotal');",
" pm.expect(jsonData.bills[0]).to.have.property('billStatus');",
" pm.expect(jsonData.bills[0]).to.have.property('totalTaxAmount');",
" pm.expect(jsonData.bills[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.bills[0]).to.have.property('balance');",
" pm.expect(jsonData.bills[0]).to.have.property('trackingCategories');",
" pm.expect(jsonData.bills[0]).to.have.property('lineItems');",
" pm.expect(jsonData.bills[0]).to.have.property('purchaseOrders');",
" pm.expect(jsonData.bills[0]).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.bills[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.bills[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.bills[0]).to.have.property('createdAt');",
" pm.expect(jsonData.bills[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.bills[0]).to.have.property('id');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('companyId');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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/bills?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "bills"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Bills Filters",
"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] bills are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('bills');",
" pm.expect(jsonData.bills[0]).to.not.be.null;",
" pm.expect(jsonData.bills[0]).to.have.property('remoteId');",
" pm.expect(jsonData.bills[0]).to.have.property('vendorId');",
" pm.expect(jsonData.bills[0]).to.have.property('billNumber');",
" pm.expect(jsonData.bills[0]).to.have.property('issueDate');",
" pm.expect(jsonData.bills[0]).to.have.property('dueDate');",
" pm.expect(jsonData.bills[0]).to.have.property('paidOnDate');",
" pm.expect(jsonData.bills[0]).to.have.property('memo');",
" pm.expect(jsonData.bills[0]).to.have.property('companyId');",
" pm.expect(jsonData.bills[0]).to.have.property('currency');",
" pm.expect(jsonData.bills[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.bills[0]).to.have.property('totalDiscount');",
" pm.expect(jsonData.bills[0]).to.have.property('subTotal');",
" pm.expect(jsonData.bills[0]).to.have.property('billStatus');",
" pm.expect(jsonData.bills[0]).to.have.property('totalTaxAmount');",
" pm.expect(jsonData.bills[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.bills[0]).to.have.property('balance');",
" pm.expect(jsonData.bills[0]).to.have.property('trackingCategories');",
" pm.expect(jsonData.bills[0]).to.have.property('lineItems');",
" pm.expect(jsonData.bills[0]).to.have.property('purchaseOrders');",
" pm.expect(jsonData.bills[0]).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.bills[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.bills[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.bills[0]).to.have.property('createdAt');",
" pm.expect(jsonData.bills[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.bills[0]).to.have.property('id');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.bills[0].lineItems[0]).to.have.property('companyId');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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/bills?credentialId={{nsCredentialId}}&currency=USD&totalAmount=100&billNumberContains=PLDT",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "bills"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
},
{
"key": "currency",
"value": "USD"
},
{
"key": "totalAmount",
"value": "100"
},
{
"key": "billNumberContains",
"value": "PLDT"
}
]
}
},
"response": []
},
{
"name": "Get Bill 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] bill 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/bills/count?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"bills",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Invoices",
"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] invoices are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('invoices');",
" pm.expect(jsonData.invoices[0]).to.not.be.null;",
" pm.expect(jsonData.invoices[0]).to.have.property('remoteId');",
" pm.expect(jsonData.invoices[0]).to.have.property('customerId');",
" pm.expect(jsonData.invoices[0]).to.have.property('invoiceNumber');",
" pm.expect(jsonData.invoices[0]).to.have.property('issueDate');",
" pm.expect(jsonData.invoices[0]).to.have.property('dueDate');",
" pm.expect(jsonData.invoices[0]).to.have.property('paidOnDate');",
" pm.expect(jsonData.invoices[0]).to.have.property('memo');",
" pm.expect(jsonData.invoices[0]).to.have.property('companyId');",
" pm.expect(jsonData.invoices[0]).to.have.property('currency');",
" pm.expect(jsonData.invoices[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.invoices[0]).to.have.property('totalDiscount');",
" pm.expect(jsonData.invoices[0]).to.have.property('subTotal');",
" pm.expect(jsonData.invoices[0]).to.have.property('invoiceStatus');",
" pm.expect(jsonData.invoices[0]).to.have.property('totalTaxAmount');",
" pm.expect(jsonData.invoices[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.invoices[0]).to.have.property('balance');",
" pm.expect(jsonData.invoices[0]).to.have.property('trackingCategories');",
" pm.expect(jsonData.invoices[0]).to.have.property('lineItems');",
" pm.expect(jsonData.invoices[0]).to.have.property('purchaseOrders');",
" pm.expect(jsonData.invoices[0]).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.invoices[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.invoices[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.invoices[0]).to.have.property('createdAt');",
" pm.expect(jsonData.invoices[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.invoices[0]).to.have.property('id');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('companyId');",
"});",
"",
"var jsonData = pm.response.json();",
"let invoiceId = jsonData.invoices[0].id;",
"postman.setEnvironmentVariable(\"invoiceId\", invoiceId);",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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/invoices?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "invoices"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "List Invoices Filters",
"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] invoices are listed correctly\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.have.property('invoices');",
" pm.expect(jsonData.invoices[0]).to.not.be.null;",
" pm.expect(jsonData.invoices[0]).to.have.property('remoteId');",
" pm.expect(jsonData.invoices[0]).to.have.property('customerId');",
" pm.expect(jsonData.invoices[0]).to.have.property('invoiceNumber');",
" pm.expect(jsonData.invoices[0]).to.have.property('issueDate');",
" pm.expect(jsonData.invoices[0]).to.have.property('dueDate');",
" pm.expect(jsonData.invoices[0]).to.have.property('paidOnDate');",
" pm.expect(jsonData.invoices[0]).to.have.property('memo');",
" pm.expect(jsonData.invoices[0]).to.have.property('companyId');",
" pm.expect(jsonData.invoices[0]).to.have.property('currency');",
" pm.expect(jsonData.invoices[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.invoices[0]).to.have.property('totalDiscount');",
" pm.expect(jsonData.invoices[0]).to.have.property('subTotal');",
" pm.expect(jsonData.invoices[0]).to.have.property('invoiceStatus');",
" pm.expect(jsonData.invoices[0]).to.have.property('totalTaxAmount');",
" pm.expect(jsonData.invoices[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.invoices[0]).to.have.property('balance');",
" pm.expect(jsonData.invoices[0]).to.have.property('trackingCategories');",
" pm.expect(jsonData.invoices[0]).to.have.property('lineItems');",
" pm.expect(jsonData.invoices[0]).to.have.property('purchaseOrders');",
" pm.expect(jsonData.invoices[0]).to.have.property('remoteCreatedAt');",
" pm.expect(jsonData.invoices[0]).to.have.property('remoteUpdatedAt');",
" pm.expect(jsonData.invoices[0]).to.have.property('remoteDeleted');",
" pm.expect(jsonData.invoices[0]).to.have.property('createdAt');",
" pm.expect(jsonData.invoices[0]).to.have.property('updatedAt');",
" pm.expect(jsonData.invoices[0]).to.have.property('id');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('id');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('remoteId');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('description');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('unitPrice');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('quantity');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('totalAmount');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('currency');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('exchangeRate');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('accountingItemId');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('accountId');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('trackingCategoryId');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('trackingCategoryIds');",
" pm.expect(jsonData.invoices[0].lineItems[0]).to.have.property('companyId');",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"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/invoices?credentialId={{nsCredentialId}}&currency=USD&totalAmount=10000",
"host": ["{{URL}}"],
"path": ["{{API_VERSION}}", "one", "accounting", "invoices"],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
},
{
"key": "currency",
"value": "USD"
},
{
"key": "totalAmount",
"value": "10000"
}
]
}
},
"response": []
},
{
"name": "Get Invoice 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] invoice 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/invoices/count?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"invoices",
"count"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
}
]
},
{
"name": "05 Delete",
"item": [
{
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"accounts",
"{{accountId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"customers",
"{{customerId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"vendors",
"{{vendorId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"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}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"items",
"{{itemId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Payment",
"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/payments/{{paymentId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"payments",
"{{paymentId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Purchase Order",
"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/purchase-orders/{{purchaseOrderId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"purchase-orders",
"{{purchaseOrderId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Bill",
"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/bills/{{billId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"bills",
"{{billId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
},
{
"name": "Delete Invoice",
"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/invoices/{{invoiceId}}?credentialId={{nsCredentialId}}",
"host": ["{{URL}}"],
"path": [
"{{API_VERSION}}",
"one",
"accounting",
"invoices",
"{{invoiceId}}"
],
"query": [
{
"key": "credentialId",
"value": "{{nsCredentialId}}"
}
]
}
},
"response": []
}
]
},
{
"name": "06 Clean Up",
"item": [
{
"name": "Remove UAPI Data",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [
{
"key": "X-Alloy-Auth",
"value": "1234567890abcdefghijklmnopqrstuvwxyz",
"type": "text"
}
],
"url": {
"raw": "{{api_base_url}}/api/testHelpers/finishUapi/NETSUITE",
"host": ["{{api_base_url}}"],
"path": ["api", "testHelpers", "finishUapi", "NETSUITE"]
}
},
"response": []
}
]
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{API_KEY}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [""]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [""]
}
}
]
}