{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"e0112034-5890-4126-897e-cd2dac2d6e82","name":"Pago Shops API","description":"The Pago Shops E-Commerce API enables external users or companies to access different resources to manage products, costumers, orders, abandoned carts, categories and coupons. This documentation provides all the tools you need to directly integrate with the Pago Shops E-Commerce API.\n\n## Authentication\n\nE-commerce API uses OAuth 2.0 to provide authentication and authorization. This authentication provides developers with a secure way to access the API data on behalf of other users. Most commonly, OAuth 2.0 authentication is useful to set up integrations between third-party applications and our system.\n\nFor more information about OAuth 2.0, see [oauth.net](https://oauth.net/2) and [RFC 6749](https://tools.ietf.org/html/rfc6749).\n\n## The OAuth 2 flow\n\nThe API uses OAuth 2.0's [authorization code grant flow](https://tools.ietf.org/html/rfc6749#section-4.1) to issue access tokens on behalf of users. And [refresh token grant](https://datatracker.ietf.org/doc/html/rfc6749#section-1.5) to obtain a new access token when the current becomes invalid or expires.\n\nWhen a user indicates that they allow you to authenticate with us on their behalf, your application will redirect them to our OAuth page, where they will login and authorize your application.\n\nThen the Auth Server will redirect the user back to your server with a query parameter named code; you'll send that code in a request from your server to us, to exchange it for an access token and a refresh token.\n\nYou will want to persist both the access token and the refresh token in your application so you can use them for all subsequent requests to the E-commerce API on the users behalf.\n\nYour application will then use the refresh token to obtain a new access token without starting the authentication and authorization process again.\n\n## Permissions\n\nYour application needs to ask the API for specific permission scopes. The list of permission is as follows:\n\n| Scope | Description |\n| --- | --- |\n| abandoned_cart_read | Abandoned Cart read permission |\n| abandoned_cart_write | Abandoned Cart write permission |\n| customer_read | Customer read permission |\n| product_read | Product read permission |\n| product_write | Product write permission |\n| order_read | Order read permission |\n| order_write | Order write permission |\n| coupon_read | Coupon read permission |\n| coupon_write | Coupon write permission |\n| script_write | Script write permission |\n| script_read | Script read permission |\n\n## Register your application\n\nIn order to set up your OAuth 2.0 workflow with us, we need to register your application and send your credentials. For that, you need to send and email to [dev@pagoshops.com](https://mailto:dev@pagoshops.com).\n\n# Request Format\n\nBuilt on RESTful principles, E-commerce API uses HTTP methods and verbs. Requests should be made using JSON, and JSON is returned by all responses.\n\n## Headers\n\nThese are the required headers in order to obtain a response from the API.\n\n```\nContent-Type: application/json\nX-Api-Version: 2\n\n ```\n\nnote: The header `X-Api-Version` is not required for the request to exchange access token or to refresh it.\n\n# HTTP Status Codes\n\nE-commerce API uses HTTP response codes to indicate the success or failure of a request. Codes within the 2xx range are considered as successfully completed transactions. Codes within the 4xx and 5xx ranges will indicate that a failure has occurred.\n\n| Code | Text | Description |\n| --- | --- | --- |\n| 200 | OK | The request has succeeded. |\n| 201 | Created | The request has succeeded and a new resource has been created as a result of it. |\n| 202 | Accepted | The request has succeeded and has been added to the queue. |\n| 204 | No Content | The request has succeeded and there is no content to send for this request. This is common for DELETE requests. |\n| 400 | Bad Request | Server cannot process the request due to something wrong with the request. |\n| 401 | Unauthorized | Client needs authentication to get requested resource. |\n| 403 | Forbidden | Client does not have access to the requested resource. |\n| 404 | Not Found | Server cannot find the requested resource. |\n| 5XX | Server Errors | Server encountered an unexpected condition. |\n\n# Rate limiting\n\nThe API supports a limit of 300 requests per application per user per minute.  \nPast the limit, it will return a `429 Too Many Requests` error.\n\n# Pagination\n\nYou can paginate your API requests to limit response results and make them easier to work with by requesting manageable chunks of data. We use `page` and `per_page` in the URL query string to paginate because it provides greater control over how you view your data.\n\n# Date and Datetime\n\nAll dates and datetime in our API are represented as string following the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). It accepts datetimes in any timezone. The data persisted will be converted to UTC.\n\n**All datetimes returned by the E-commerce API are represented in UTC**.\n\n# Webhooks\n\nWebhooks are a useful tool for apps that want to stay in sync with us or execute code after a specific event occurs in a shop. For example, you might want to trigger an action when a user creates a new product in the platform's Admin or when a customer places an order.\n\nA **webhook** is a single message sent by our system to an app's webhook endpoint. A webhook contains a JSON payload in the body and is sent in a POST request.\n\nA **topic** is a class of webhook events.\n\nAll webhooks endpoints provided by your app must be HTTPS.\n\n## Webhook structure\n\nThis is the JSON payload structure sent in the webhook request:\n\n| Attribute | Description |\n| --- | --- |\n| id | Unique identifier for the webhook. |\n| created_at | The date and time that the webhook was created as UTC, following ISO 8601 standard. |\n| topic | The topic that represents the event in our platform. |\n| data | A list of resource specific data payload. |\n| account_id | The account unique identifier. |\n\n## Topics\n\n| Event | Topic |\n| --- | --- |\n| Order | `order_created`, `order_updated` |\n| Customer | `customer_created`, `customer_updated`, `customer_deleted` |\n| Product | `product_created`, `product_updated`, `product_deleted` |\n| Coupon | `coupon_created`, `coupon_updated` |\n| Cart | `cart_created`, `cart_abandoned` |\n\n#### Abandoned Cart data payload\n\nThe structure of the abandoned cart data payload can be found here\n\n#### Customer data payload\n\nThe structure of the customer data payload can be found [here](#7ed6fa07-b074-43c0-8ed5-eb11e4d62f6a)\n\n#### Coupon data payload\n\nThe structure of the coupon data payload can be found [here](#662add43-336f-4c37-abf6-e00e1bce78fa)\n\n#### Product data payload\n\nThe structure of the product data payload can be found [here](#5c936aa3-8ff1-4e71-88dd-185def4a60da)\n\n#### Order data payload\n\nThe structure of the order data payload can be found [here](#22524483-b0f9-4664-a554-93ea120c7ea8)","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"7260560","team":684492,"collectionId":"e0112034-5890-4126-897e-cd2dac2d6e82","publishedId":"UV5UkKFU","public":true,"publicUrl":"https://dev.pagoshops.com","privateUrl":"https://go.postman.co/documentation/7260560-e0112034-5890-4126-897e-cd2dac2d6e82","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"0140BE"},"documentationLayout":"classic-single-column","customisation":null,"version":"8.10.1","publishDate":"2023-05-29T19:14:55.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"SANDBOX","id":"02410d0c-9e78-4e0d-b0ea-d39abe8aa7df","owner":"7260560","values":[{"key":"base_url","value":"http://admin.pagoshops.staging.pfshops.info/api","enabled":true},{"key":"base_admin_url","value":"http://admin.pagoshops.staging.pfshops.info/api","enabled":true},{"key":"token","value":"","enabled":true,"type":"secret"},{"key":"access_token","value":"","enabled":true,"type":"secret"},{"key":"refresh_token","value":"","enabled":true,"type":"secret"},{"key":"client_id","value":"","enabled":true,"type":"secret"},{"key":"client_secret","value":"","enabled":true,"type":"secret"},{"key":"client_redirect_uri","value":"","enabled":true,"type":"secret"}],"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/768118b36f06c94b0306958b980558e6915839447e859fe16906e29d683976f0","favicon":"https://pagoshops.com/favicon.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":"SANDBOX","value":"7260560-02410d0c-9e78-4e0d-b0ea-d39abe8aa7df"}],"canonicalUrl":"https://dev.pagoshops.com/view/metadata/UV5UkKFU"}