{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"92583e97-fc4c-d52b-2457-6107bc6302fc","name":"StylusOP Vendor API Documentation - v2.9.8","description":"Welcome to the StylusOP API official documentation.  \nThis documentation is useful to you if you are a vendor and want to integrate with our fulfillment system.\n\nIntegrating a new vendor involves some manual setup before the vendor can start consuming our API  \nThis integration process involves:\n\n- Create the new **vendor** inside the STYLUS OP system\n    \n- Generate **vendorId** and API authentication token for the created vendor\n    \n- **Product setup** - Manual process when the **vendor** and the **fulfiller** (us) agree on what products will be fulfilled. Any product related details will be shared at this stage.\n    \n- API integration - The vendor is ready to consume our API.\n    \n\n# Getting Started\n\nOur API tries to follow the RESTful standard. If you are familiar with RESTful API's, then following along should be fairly easy.  \nWe support different request methods such as GET,POST,PATCH and PUT\n\nThe contents of this documentation will cover different topics such as:\n\n- Authentication\n    \n- Pushing/posting orders for production\n    \n- Listing your existing orders\n    \n- Tracking an order's status\n    \n- Cancelling an order\n    \n- Updating an order:\n    - Updating the line-items\n        \n    - Updating the artwork images\n        \n    - Updating the customer and shipping related data\n        \n- Receiving status update notifications via callback url\n    \n- NEW: Get order's activity log and events\n    \n\n| Term | Description |\n| --- | --- |\n| Vendor | The consumer of our api. This would be you |\n| Fulfiller | This would be us |\n| Token | A hashed text string. This term will be mainly used in terms of authentication |\n| Artwork | The image file(s) for us to print and fulfill. |\n\n# Usage Guidelines\n\n- All requests made to the production endpoint are done via HTTPs. Requests via insecure HTTP are not supported in production environment.\n    \n- All requests submitted to the API is structured in JSON, so the content-type should be: **application/json**\n    \n- Date/time values returned by the API are in UTC unless stated otherwise.\n    \n- {variable} in URLs should be substituted with the proper variable value.\n    \n\n# Endpoints\n\nThe endpoints will depend on the environment. There are 2 environments available to you:\n\n> **Production** -- Our live environment. Not to be used for making test requests  \n**Staging** -- Must be used during development (Sandbox) \n  \n\n**Base Url**:\n\n```\nhttps://stylusopapi-prod.stylusapparel.com/api/v2/  (production)\nhttps://stylusopapi-staging.stylusapparel.com/api/v2/ (staging)\n\n ```\n\n| Endpoint | Supported Methods | Description |\n| --- | --- | --- |\n| /orders/vendor/{vendorId} | GET, POST, PATCH | Endpoint for order creation, getting orders and updating an order |\n| /orders/{orderId}/vendor/{vendorId} | GET | Retrieves an specific order by supplying its **orderId**. |\n| /orders/{orderId}/status/vendor/{vendorId} | GET | Will return the specific order's production status only. If you are only interested on getting the status of an order, then we strongly recommend using this endpoint instead of /orders/{orderId}. Doing so will save you some bandwidth specially if you are planning on fetching the status of an order frequently |\n| /orders/{orderId}/activity/vendor/{vendorId} | GET | Get the order's latest activity. As of now, a maximum of 100 entries are returned per page. |\n| /orders/{orderId}/cancel/vendor/{vendorId} | POST | Cancel an order / line-item(s). |\n| /products/vendor/{vendorId} | GET | List all the vendor's linked products |\n| /stock/sku/{variantSku}/vendor/{vendorId} | GET | Get the product variant's stock levels |\n\n# Authentication\n\nTo use our API, you will have to make authenticated requests by using either _**Bearer Token**_ or _**Basic Auth**_ method as follows:\n\n```\n\"Authorization\": Bearer {authToken}    (Bearer)\n\n ```\n\nor\n\n```\n \"Authorization\": Basic {apiSecret}    (Basic)\n\n ```\n\n> **Note**: The authentication token will be provided by us manually. There is automated way for you to create or refresh the token yourself. \n  \n\n# HTTP Response Codes\n\nOur API will respond to your requests with either of the following http codes:\n\n| Status | Type | Description |\n| --- | --- | --- |\n| 200 | Success | General successful response |\n| 201 | Created | The order has been created successfully in our system |\n| 204 | Success No-Content | Successful response without a response body |\n| 400 | Bad Request | Invalid payload |\n| 401 | Unauthorized | Failed to provide valid authentication |\n| 403 | Forbidden | Not allowed to consume the resource |\n| 404 | Not Found | The resource is not found |\n| 408 | Timeout | Request has taken too long to be processed |\n| 409 | Conflict | Request creates a conflict with the target resource. Used as error status code for \"OrderDuplicate\" error (The resource already exists in our system) |\n| 422 | Unprocessable Entity | Request is understood however we couldn't process it |\n| 500 | Internal Error | An error occurred on our end while processing your request |\n| 503 | Unavailable | The API is temporarily down for scheduled maintenance |\n\n## Error Handling\n\nIn order to properly handle errors returned by the API, the Stylus API defines a set of **error codes** that are included in the response whenever an error occurs.  \nPlease make sure your application is aware of these error codes.\n\nAn example of an error response would look like this:\n\n``` $xslt\n{   \n    \"success\": false,\n    \"message\": \"Error creating new order: ApiError: Payload didn't include the required fields\",\n    \"errorCode\": \"InvalidPayload\",\n    \"rawError\": \"\" // the error stack here. (Not available in Production environment)\n}\n\n ```\n\n| Error Code | Endpoint | Description |\n| --- | --- | --- |\n| `OrderDuplicate` | Create | Order or order line-item already exists. Note that we validate for order duplicates by the \"itemNumber\" rather than the \"orderId\" |\n| `WrongLineItemProperties` | Create, Update | When error is related to line-item properties, incorrect values or not properly formattted. E.g passing a \"size\" property that's not supported by the product |\n| `InvalidPayload` | Create, Update | When the payload is missing required fields, fields not properly formatted, etc |\n| `ProductNotFound` | Create, Update | When product included in the line-items array is not found in the system |\n| `StatusIssue` | Update, Cancel | when order or line-item status is too far in production for it to be updated |\n| `ItemSkuIssue` | Create, Update | When sku in line-item is incorrect or not properly formatted |\n| `WrongLineItem` | Cancel | When one or more line-items defined in the \"items\" array does not belong to the order |\n\n# API Models\n\n## Model - Order\n\n| Name | Data Type | Required | Description |\n| --- | --- | --- | --- |\n| `orderKey` | string | Read-Only | The internal unique identifier for the order. This is a read-only field. |\n| `orderId` | number | Required | The user-defined identifier for the order. This is a read-only field. |\n| `orderStatus` | string | Read-Only | The status of the order. This is a read-only field. Possible values: `ordered`,`printed`, `picked`,`shipped`, `cancelled`, `voided`, `completed`, `delayed`, `error`. |\n| `callbackUri` | string | Optional | A user-defined url for us to send **Status Update Notifications** to. It allows the vendor to receive updates on the status of an order during production |\n| `companyRefId` | string | Required | The vendor's username. |\n| `customerName` (deprecated) | string | Optional | This field has been marked for deprecation in favor of the \"shippingInfo.name\" field. |\n| `shippingInfo` | **Address** | Required | The customer's shipping address. Please check the Address model for reference of these values. |\n| `returnToAddress` | **Address** | Optional | Allows a \"Return to address\" or \"Ship from location\" to be specified. This is particularly useful when creating shipping labels to indicate we want the goods to be returned to a particular location. Vendors may use this option to specify their own warehouse locations |\n| `shippingMethod` | string | Optional | User defined shipping method. Values could be 'standard' or 'express' |\n| `created_date` | string | Read-Only | The timestamp the order was created in our database. Read-Only. |\n| `sale_datetime` | string | Optional | The user-provided timestamp the order was purchased. |\n| `items` | \\[**LineItem\\[\\]**\\] | Required | Array of purchased order line-items. Please refer to the LineItem model. |\n| `artworksInOrder` | \\[**Artwork\\[\\]**\\] | Read-Only | An array of the artwork images defined inside this order. Please refer to the Artwork model. |\n| `packingSheetUrl` | string | Optional | A user-defined public url used for providing your own custom packing sheet. If specified, we will use this document during packing and shipping. |\n| `cancelledAt` | string | Read-Only | Specifies the datetime when the entire order was cancelled |\n\n## Model - Address\n\n| Name | Data Type | Required | Description |\n| --- | --- | --- | --- |\n| `name` | string | Required | The customer's full name. This value can be updated by the vendor later on. |\n| `company` | string | Optional | The company's name. Useful when using inside \"returnToAddress\". |\n| `email` | string | Optional | The customer's email. |\n| `street1` | string | Required | The shipping address street 1. |\n| `street2` | string | Optional | Additional address or reference |\n| `city` | string | Required | The shipping address' city. |\n| `state` | string | Required | The shipping address' state / province. UPDATE: This field might not be required for countries that don't support states |\n| `phone` | string | Optional | The customer's phone number |\n| `postcode` | string | Required | The shipping address' postal code. UPDATE: This field might not be required for countries that don't support states |\n| `country_code` | string | Required | The shipping address's country code. E.g: 'US', 'CA', 'AU'. |\n\n## Model - LineItem\\[\\]\n\n| Name | Data Type | Required | Description |\n| --- | --- | --- | --- |\n| `itemId` | number | Read-only | The internal identifier for the line-item in our system. This is a read-only field. |\n| `itemNumber` | number | Required | The user-defined identifier for the line-item. |\n| `product` | string | Required | The product type. For instance: `legging`,`capri`, `scarf`,`hoodie`. The value of this property will be discussed with us during integration. |\n| `properties` | **ItemProperties** | Optional | A user-defined set of properties that includes data such as product color, size. Please refer to the **ItemProperties** model |\n| `sku` | string | Required | A user-defined sku for the line-item |\n| `previewImgUrl` | string | Optional | A catalog-style image thumbnail for this product item. |\n| `assets` | **Assets\\[\\]** | Required | An array of artwork images for this specific line-item. Please refer to the **Assets\\[\\]** model. |\n| `quantity` | number | Required | The quantity for this line-item. This will reflect on how many prints we do of the artworks defined inside \"assets\" |\n| `price` | number | Required | A user-defined unit price for this line-item. Please be aware that this is unit price, meaning, it should NOT be computed with the item quantity. |\n| `weight` | **ItemWeight** | Read-Only | An object with data about the item's weight. Please refer to the **ItemWeight** model. |\n\n## Model - ItemProperties\n\n| Name | Data Type | Required | Description |\n| --- | --- | --- | --- |\n| `size` | string | Optional | The size of the line-item if applicable. Defaults to \"OS\", which stands for \"One Size\". |\n| `color` | string | Optional | The color of the line-item if applicable. Defaults to \"OS\". |\n\n## Model - Assets\\[\\]\n\n| Name | Data Type | Required | Description |\n| --- | --- | --- | --- |\n| `description` | string | Optional | A small description of the artwork file. Important!: When line-item has multiple sides defined in \"assets\", then use this field to specify the \"side\" name or id. Ie: \"front\", \"back\", \"left-sleeve\", etc. |\n| `url` | string | Required | A public or pre-authenticated url of the artwork image file in full size. |\n| `preview_url` | string | Optional | A public or pre-authenticated url of a thumbnail of the artwork image file, if available. |\n\n## Model - ItemWeight\n\n| Name | Data Type | Required | Description |\n| --- | --- | --- | --- |\n| `value` | number | Read-Only | The weight value of the product. |\n| `units` | string | Optional | The measuring unit system of the weight value. Ie: 'oz', 'lb'. |\n\n## API Deprecation\n\nWhen an API endpoint is scheduled for deprecation the following actions will be taken:\n\n1. The endpoint documentation will be marked as deprecated and a migration plan will be added.\n    \n2. The endpoint will have a Sunset header (Sunset HTTP Header) added to indicate the last date the endpoint should be relied upon.\n    \n3. A email will be sent to active third party developers notifying of the deprecation.\n    \n4. A entry to the API changelog will be added.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"355529","team":118510,"collectionId":"92583e97-fc4c-d52b-2457-6107bc6302fc","publishedId":"RW81tCh5","public":true,"publicUrl":"https://stylusopapi-docs.stylusapparel.com","privateUrl":"https://go.postman.co/documentation/355529-92583e97-fc4c-d52b-2457-6107bc6302fc","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.0","publishDate":"2020-06-01T17:10:34.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"StylusOP API - Staging","id":"99ca3c2b-01ac-2ffd-a889-b813bae20dff","owner":"355529","values":[{"key":"baseUrl","value":"https://stylusopapi-staging.stylusapparel.com/api","enabled":true},{"key":"orderId","value":"5bfff1005ed05f00049e937c","enabled":true},{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1Yjg3NjE2ZGQ1YmI1ZjAwMDQ1ZDA0ZGMiLCJyb2xlIjozLCJ1c2VybmFtZSI6InhsdXNpb24iLCJpYXQiOjE1NDkwMzY0MzYsImV4cCI6MTcwNDU1NjQzNn0.pnuzKH9uNJ5ru7GPSzH61FgNAuS2jc","enabled":true},{"key":"vendorId","value":"xyzclothing","enabled":true},{"key":"version","value":"v2","enabled":true}],"published":true}],"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/22000fc7333fd4d507a3707a0f64605cbce4090d1576b9aaee906fbdedb4ee6c","favicon":"https://res.cloudinary.com/postman/image/upload/v1591031549/team/rmt6ldrihpzdmhkaelqv.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"},{"label":"StylusOP API - Staging","value":"355529-99ca3c2b-01ac-2ffd-a889-b813bae20dff"}],"canonicalUrl":"https://stylusopapi-docs.stylusapparel.com/view/metadata/RW81tCh5"}