{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"37acd4ed-0058-4657-90c7-2d871bcfa076","name":"V.Alexander & Co. Rest API","description":"---\n\nThe V. Alexander API enables customers to create secure data integrations to optimize existing paper-driven supply-chain processes such as document transfer, accounting, commercial invoice creation, and shipping transaction updates.\n\nV. Alexander supports the following key use cases, and we are continually adding new features:\n\n- Shipping document retrieval\n- Shipping document upload\n- AR invoice data and PDF backup\n- Customs commercial invoice creation\n    \n\nIf you have a question about the API or a request for functionality, please don't hesitate to contact your V. Alexander account team.\n\n# Getting started\n\nTo get started, contact your V. Alexander account team to obtain credentials and an API key. You will need the following information:\n\n1. The email address for the technical contact at your company.\n2. The IP address (or IP addresses) you will use to send requests to the API.\n3. A list of the documented API resources you would like to use, and a description of your use case.\n    \n\n> **Note**: Access to the V. Alexander API is restricted to a list of allowed IP addresses. Please remember to make a note of the originating IP address so we can allow the new traffic.\n\n## Authentication and Authorization\n\nThe V. Alexander API uses OAuth 2.0 along with an API key for authentication and authorization. All applications follow a basic pattern when accessing a V.Alexander API using OAuth 2.0. At a high level, you follow these steps:\n\n1. Contact the V.Alexander IT team to obtain your access credentials if you don't have them before continuing.\n2. **Note:** Access tokens expire after 1 hour. Client credentials do not use refresh tokens, and you will need to re-authenticate when your token expires.\n3. Include the access token and API key with your request.  \n    After your application obtains an access token, it should send the token and API Key to the V. Alexander API in the HTTP request header.\n    - Set an `\"x-api-key\"` header with the value set to your API key.\n    - Set an `\"Authorization\"` header with the value set to your access token.\n\n## Scopes\n\nV. Alexander API controls authenticated access to resources and methods with scopes. V. Alexander configures these scopes for each customer and app client based on their needs. Please reach out to your V. Alexander team if you have any questions.\n\n### All supported scopes\n\n- _arinvoice.read:_ Use this scope to read AR Invoice data or download AR Invoice PDF documents.\n- _document.read:_ Use this scope to download shipping documents.\n- _event.customsdeclaration.z90.write:_ Use this scope to update or add documents to Customs transactions.\n- _event.forwardingshipment.z90.write:_ Use this scope to update or add documents to Forwarding transactions.\n- _request.read:_ Use this scope to read Request status for asynchronous creation requests such as POST & PUT.\n- _customsciv.write:_ Use this scope to create US Customs commercial invoices.\n    \n\n> **NOTE** To protect your data in our system, V. Alexander requires a consultation with your team before granting permission to use `event.\\*` scopes. Please contact your V. Alexander account team for more information.\n\n## Import and Test API Collection Locally in Postman\n\nV. Alexander API Collection can be imported into your local Postman app for testing. You will need the Postman application to use this feature.\n\n1. From this documentation, click `Run in Postman` and select the workspace to import the collection into.\n2. Click on the `edit` option on the imported collection.\n3. Add the following script into the `Pre-request script` section and update the `clientId`, `clientSecret`, `apiKey`, and `tokenUrl` constants. You will have received these data points from V. Alexander as part of the setup process.\n    \n\n``` js\n// update this section\nconst clientId = 'your_client_id';\nconst clientSecret = 'your_client_secret';\nconst apiKey = \"your_api_key\";\nconst tokenUrl = 'token_url';\nconst domain = 'cw.valexanderapis.com';\nconst getTokenRequest = {\n  method: \"POST\",\n  url: tokenUrl,\n  body: {\n    mode: \"urlencoded\",\n    urlencoded: [\n      { key: \"client_id\", value: clientId },\n      { key: \"client_secret\", value: clientSecret },\n      { key: \"grant_type\", value: \"client_credentials\" },\n    ],\n  },\n};\npm.sendRequest(getTokenRequest, (err, response) => {\n  if (err) {\n    console.log(err);\n  }\n  const jsonResponse = response.json();\n  const newAccessToken = jsonResponse.access_token;\n  pm.environment.set(\"domain\", domain);\n  pm.environment.set(\"api_key\", apiKey);\n  pm.environment.set(\"access_token\", newAccessToken);\n});\n\n```\n\nAfter you save the script, Postman will automatically authenticate to the API, and you will able to make request to our API.\n\n## Postman Settings\n\nTo help exploring the API, you may want to turn on some Postman settings:\n\n- Enable \\`Retain headers when clicking on links\\`. This setting allows the user to directly send a request using a link from the collection response by automatically carrying over existing auth headers to a new window. eg., invoke /v1/invoice/:transaction-number from /v1/invoices/:debtor-code response directly.\n    \n\n<img src=\"https://externalapi-postman-screenshots.s3.amazonaws.com/postman-setting.png\" alt=\"\">\n\n# Support\n\nFor help regarding accessing the V. Alexander API, please contact your V. Alexander technical contact. To help us address your request efficiently, please include the following:\n\n- A detailed description of the issue\n- The request you made, including the HTTP headers\n- The response you received from the API\n    \n\n### Troubleshooting\n\n#### `403 Forbidden`\n\nIf you receive a 403 response, check your IP address to ensure it is the same IP address we allowed during setup. Testing from behind a web VPN will change your IP address, and the API will block your request.\n\nIf receive a `5XX` error, it implies that we have hit an unexpected errors internally. Please let us know.\n\n# API Reference\n\n---\n\n### Error responses\n\nThe V. Alexander API uses a single schema for all errors. Please refer to the schema and example below.\n\n#### Error Response JSON Schema (4XX and 5XX)\n\n``` json\n{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"message\": { \"type\": \"string\" },\n    \"debugId\": { \"type\": \"string\" },\n    \"links\": {\n      \"type\": \"array\",\n      \"minItems\": 1,\n      \"items\": { \"$ref\": \"#/definitions/link\" }\n    }\n  },\n  \"definitions\": {\n    \"link\": {\n      \"properties\": {\n        \"href\": { \"type\": \"string\" },\n        \"rel\": {\n          \"type\": \"string\",\n          \"const\": \"documentation\"\n        },\n        \"method\": {\n          \"type\": \"string\",\n          \"const\": \"GET\"\n        }\n      },\n      \"type\": \"object\",\n      \"required\": [\"href\", \"rel\", \"property\", \"method\"]\n    }\n  },\n  \"required\": [\"message\", \"links\", \"debugId\"]\n}\n\n```\n\n#### Example\n\n```\n{\n  \"message\": \"message\",\n  \"debugId\": \"debugId\",\n  \"links\": [\n    {\n      \"href\": \"href\",\n      \"rel\": \"documentation\",\n      \"method\": \"GET\"\n    }\n  ]\n}\n\n```","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"12752850","team":92111,"collectionId":"37acd4ed-0058-4657-90c7-2d871bcfa076","publishedId":"UzQxMPVP","public":true,"publicUrl":"https://documentation.valexanderapis.com","privateUrl":"https://go.postman.co/documentation/12752850-37acd4ed-0058-4657-90c7-2d871bcfa076","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2022-07-18T20:47:29.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/141cc0e9ab5152ea2d5a3c5bdafe7f9f71a57cf174fd5f60cf5f2b805f58f2e6","favicon":"https://res.cloudinary.com/postman/image/upload/v1557947504/team/zwkrg64rlk5u3gfx1tcq.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documentation.valexanderapis.com/view/metadata/UzQxMPVP"}