{ "info": { "_postman_id": "088b00db-9b28-4240-80cb-25869855c827", "name": "Open API (v1)", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "14942713", "_collection_link": "https://pelcro.postman.co/workspace/Open-API-(v1)~2ac257a2-8f61-40fc-9011-bd22012fc492/collection/14942713-088b00db-9b28-4240-80cb-25869855c827?action=share&source=collection_link&creator=14942713" }, "item": [ { "name": "Site", "item": [ { "name": "Get site configuration", "request": { "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/site?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "site" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nLeverage this public endpoint to retrieve a structured JSON payload containing information about your site, including payment gateway settings configured under your account, list of product and plans available for purchase online, paywalls settings and other various configuration and settings configured from the platform.\n\nFor more information related to the details of Site object returned from this endpoint, refer to this [documentation](https://null).\n\n---" }, "response": [] } ], "description": "Use this **public** endpoint to retrieve information about your site, including enabled features and settings for each, list of products, paywalls as well as payment gateway settings configured under your account. \n \nFor more information related to the details of Site object returned from this endpoint, refer to this [documentation](https://null).", "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "console.log('Pelcro Open API (v1) pre-request (Site)');" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Authentication", "item": [ { "name": "Passwordless", "item": [ { "name": "Request", "event": [ { "listen": "prerequest", "script": { "exec": [ "" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email", "value": "{{generated_customer_email}}", "description": "The customer’s email address.", "type": "text" }, { "key": "referer", "value": "", "description": "Optional parameter which can be used to hold the source from which the login has been requested.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/auth/passwordless/request?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "auth", "passwordless", "request" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this endpoint to allow your customers to request a passwordless login link. It will trigger a \"[customer.passwordless_login_request](https://null)\" event containing the `passwordless_token`, which you can listen to by setting up a [webhook endpoint](https://null).\n\nThe passwordless authentication feature must be enabled in your site settings to be able to use this endpoint.\n\n#### Related features\n\n- Passwordless authentication\n \n\n---" }, "response": [] }, { "name": "Login", "event": [ { "listen": "prerequest", "script": { "exec": [ "" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "// Retrieve and save authentication token from Customer resource response\r", "const key = \"auth_token\";\r", "if (200 === pm.response.code) {\r", " const val = JSON.parse(responseBody).data.auth_token;\r", " console.log(`Saving ${key} as ${val}`);\r", " postman.setEnvironmentVariable(key, val);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "passwordless_token", "value": "", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/auth/passwordless/login?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "auth", "passwordless", "login" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this endpoint to allow your customers to login without entering their password. It returns a [Customer resource](https://null) when successful, which contains a valid JSON Web Token (JWT) to be used in subsequent request to any protected endpoints.\n\nThe passwordless authentication feature must be enabled in your site settings to be able to use this endpoint.\n\n#### Related features\n\n- Passwordless authentication\n \n\n---" }, "response": [] } ] }, { "name": "Register", "event": [ { "listen": "prerequest", "script": { "exec": [ "window = {};\r", "let lodash = require('lodash');\r", "\r", "/* @see https://www.npmjs.com/package/faker/v/3.1.0 */\r", "pm.sendRequest(\"https://cdnjs.cloudflare.com/ajax/libs/Faker/3.1.0/faker.min.js\", (error, response) => {\r", " var text = response.text();\r", " (new Function(text))();\r", "\r", " window.faker.locale = pm.environment.get(\"default_language\") ?? \"en\";\r", " \r", " const fakeName = window.faker.name;\r", " const fakePhone = window.faker.phone;\r", " const fakeRandom = window.faker.random;\r", " const fakeCompany = window.faker.company;\r", "\r", " const first_name = fakeName.firstName();\r", " const last_name = fakeName.lastName();\r", "\r", " pm.environment.set(\"generated_customer_email\", lodash.deburr(first_name + last_name) + '@example.com');\r", " pm.environment.set(\"generated_customer_username\", lodash.kebabCase(first_name + ' ' + last_name));\r", " pm.environment.set(\"generated_customer_password\", generatePassword());\r", " pm.environment.set(\"generated_customer_first_name\", first_name);\r", " pm.environment.set(\"generated_customer_last_name\", last_name);\r", " pm.environment.set(\"generated_customer_title\", fakeName.title());\r", " pm.environment.set(\"generated_customer_salutation\", fakeName.prefix());\r", " pm.environment.set(\"generated_customer_phone\", fakePhone.phoneNumber());\r", " pm.environment.set(\"generated_organization\", fakeCompany.companyName());\r", " pm.environment.set(\"generated_old_provider_id\", fakeRandom.uuid());\r", " pm.environment.set(\"generated_email_hardbounce\", Number(fakeRandom.boolean())); \r", "})\r", "\r", "/**\r", " * Simple strong password generator.\r", " */\r", "function generatePassword(length = 21)\r", "{\r", " var stack = [];\r", " stack += \"abcdefghijklmnopqrstuvwxyz\"\r", " stack += \"ABCDEFGHIJKLMNOPQRSTUVWXZ\"\r", " stack += \"0123456789\"\r", " stack += \"!@#$%^&*()?.<\\>|=+:;,[-_]\"\r", " let string = \"\"\r", " for (let i = 0; i < length; i++) {\r", " let rng = [Math.floor(Math.random() * stack.length)];\r", " string = string + stack[rng];\r", " }\r", " return string;\r", "}" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "// Retrieve and save authentication token from Customer resource response\r", "const key = \"auth_token\";\r", "if (200 === pm.response.code) {\r", " const val = JSON.parse(responseBody).data.auth_token;\r", " console.log(`Saving ${key} as ${val}`);\r", " postman.setEnvironmentVariable(key, val);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email", "value": "{{generated_customer_email}}", "description": "The customer’s email address. Must have a valid syntax as per RFC 822 standard and be unique under the same account.", "type": "text" }, { "key": "password", "value": "{{generated_customer_password}}", "description": "The customer’s password. Must contain at least 6 characters by default, and when [Strong Password Enforcement](doc:security-overview#strong-password-enforcement) security setting is enabled, it must contain between 8 and 30 characters, include at least one number, one symbol, one lowercase, and one uppercase alphabetic character.", "type": "text" }, { "key": "language", "value": "{{default_language}}", "description": "The customer’s preferred language as a two-letter code, defined by ISO 639-1 standard.", "type": "text" }, { "key": "username", "value": "{{generated_customer_username}}", "description": "The customer's username. Must contain only alpha-numeric characters, dashes or underscores, as well as being unique under the same account.", "type": "text" }, { "key": "display_name", "value": "{{generated_customer_first_name}} {{generated_customer_last_name}}", "description": "A display name that can be used by the customer, the primary use case of this is for commenting systems.", "type": "text" }, { "key": "email_hardbounce", "value": "{{generated_email_hardbounce}}", "description": "A boolean on whether the customer's email is hardbounce.", "type": "text" }, { "key": "first_name", "value": "{{generated_customer_first_name}}", "description": "The customer’s first name.", "type": "text" }, { "key": "last_name", "value": "{{generated_customer_last_name}}", "description": "The customer’s last name.", "type": "text" }, { "key": "metadata[key1]", "value": "value_for_metadata_key1", "description": "Set of key-value pairs that can be saved on customer level. This can be useful for storing additional information about the object in a structured format.", "type": "text" }, { "key": "metadata[key2]", "value": "value_for_metadata_key2", "description": "Set of key-value pairs that can be saved on customer level. This can be useful for storing additional information about the object in a structured format.", "type": "text" }, { "key": "old_provider_id", "value": "{{generated_old_provider_id}}", "description": "The ID of customer before migrating into Pelcro, this field will be searchable from the platform.", "type": "text" }, { "key": "organization", "value": "{{generated_organization}}", "description": "The customer organization.", "type": "text" }, { "key": "phone", "value": "{{generated_customer_phone}}", "description": "The customer phone number. Any string is accepted, which will be stripped of any non-numeric characters.", "type": "text" }, { "key": "salutation", "value": "{{generated_customer_salutation}}", "description": "The customer’s salutation.", "type": "text" }, { "key": "title", "value": "{{generated_customer_title}}", "description": "The customer’s title.", "type": "text" }, { "key": "security_token", "value": "", "description": "Required when [Risk Assessment](doc:security-overview#risk-assessment) feature is enabled.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/auth/register?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "auth", "register" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this public endpoint to create a new customer linked to your site and account. It will trigger a \"[customer.created](https://null)\" event which you can listen to by setting up a [webhook endpoint](https://null) and returns a [Customer resource](https://null) when successful, which contains a valid JSON Web Token (JWT) to be used in subsequent request to any protected endpoints.\n\nSafeguarding your account from fraud is crucial for smooth business operations. This feature mitigate threats like card testing attacks and fraudulent account creation, both prevalent online. When this feature is enabled, the `security_token` attribute will always be required, read the [related documentation](https://null) for more information.\n\n#### Related features\n\n- [Risk Assessment](https://null)\n \n- [Group Subscriptions](https://null)\n \n- [Platform activity logs](https://null)\n \n\n---\n\n### Request Parameters\n\n- `email`: The customer’s email address. Must have a valid syntax as per RFC 822 standard and be unique under the same account.\n- `password`: The customer’s password. Must meet specific criteria based on security settings.\n- `language`: The customer’s preferred language as a two-letter code, defined by ISO 639-1 standard.\n- `username`: The customer's username. Must be unique under the same account.\n- `display_name`: A display name that can be used by the customer.\n- `email_hardbounce`: A boolean indicating whether the customer's email is hardbounce.\n- `first_name`: The customer’s first name.\n- `last_name`: The customer’s last name.\n- `metadata`: Set of key-value pairs that can be saved on customer level.\n- `old_provider_id`: The ID of customer before migrating into Pelcro.\n- `organization`: The customer organization.\n- `phone`: The customer phone number.\n- `salutation`: The customer’s salutation.\n- `title`: The customer’s title.\n- `security_token`: Required when \\[Risk Assessment\\](doc:security-overview#risk-assessment) feature is enabled.\n \n\n### Response\n\nUpon successful registration, the API returns a status code of 200 and a JSON response containing the newly registered customer's details, including their ID, name, email, organization, phone number, language, and other relevant information.\n\nSee [https://docs.pelcro.com/reference/api-open-resources#customer-resource](https://docs.pelcro.com/reference/api-open-resources#customer-resource) for more details." }, "response": [ { "name": "Register with only required attributes", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email", "value": "{{generated_customer_email}}", "type": "text" }, { "key": "password", "value": "{{generated_customer_password}}", "type": "text" }, { "key": "language", "value": "{{default_language}}", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/auth/register?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "auth", "register" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "Text", "header": [], "cookie": [], "body": "" } ] }, { "name": "Login", "event": [ { "listen": "prerequest", "script": { "exec": [ "" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "// Retrieve and save authentication token from Customer resource response\r", "const key = \"auth_token\";\r", "if (200 === pm.response.code) {\r", " const val = JSON.parse(responseBody).data.auth_token;\r", " console.log(`Saving ${key} as ${val}`);\r", " postman.setEnvironmentVariable(key, val);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email", "value": "{{generated_customer_email}}", "description": "The email identifying the customer under the site. Required if the username is not provided.", "type": "text" }, { "key": "username", "value": "", "description": "The username identifying the customer under the site. Required if the email is not provided.", "type": "text", "disabled": true }, { "key": "password", "value": "{{generated_customer_password}}", "description": "The password", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/auth/login?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "auth", "login" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "## Customer login\n\n### Description\n\nUse this public endpoint to authenticate the customer using a password and either the `email` or the `username`. It returns a [Customer resource](https://null) when successful, which contains a valid JSON Web Token (JWT) to be used in subsequent request to any protected endpoints.\n\n#### Related features\n\n- [Failed Login Attempts Lockout](https://null)\n \n- [Group Subscriptions](https://null)\n \n\n---\n\n### Request Parameters\n\n- `site_id` (text, required): The unique identifier of the site associated with your account.\n- `email` (text, optional): The email identifying the customer under the site. Required if the username is not provided.\n- `username` (text, optional): The username identifying the customer under the site. Required if the email is not provided.\n- `password` (text, required): The password.\n \n\n### Response\n\nUpon successful login, the API returns a status code of 200 and a JSON response containing the customer's details, including their ID, name, email, organization, phone number, language, and other relevant information.\n\nSee [https://docs.pelcro.com/reference/api-open-resources#customer-resource](https://docs.pelcro.com/reference/api-open-resources#customer-resource) for more details.\n\n#### Response Body\n\n``` json\n{\n \"data\": {\n \"id\": 0,\n \"name\": null,\n \"full_name\": null,\n \"first_name\": null,\n \"last_name\": null,\n \"display_name\": null,\n \"username\": null,\n \"email\": \"\",\n \"organization\": null,\n \"phone\": null,\n \"language\": \"\",\n \"balance\": 0,\n \"email_confirm\": true,\n \"email_hardbounce\": true,\n \"phone_confirm\": true,\n \"tin\": null,\n \"salutation\": null,\n \"title\": null,\n \"profile_photo\": null,\n \"currency\": null,\n \"subscriptions\": null,\n \"memberships\": null,\n \"gift_recipients\": null,\n \"expired_subscriptions\": null,\n \"addresses\": null,\n \"invoices\": null,\n \"charges\": null,\n \"orders\": null,\n \"source\": null,\n \"sources\": [],\n \"metadata\": [],\n \"is_created\": true,\n \"last_login_method\": \"\",\n \"auth_token\": \"\",\n \"token\": \"\"\n },\n \"status\": \"\"\n}\n\n ```" }, "response": [ { "name": "Login by email", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email", "value": "{{generated_customer_email}}", "type": "text" }, { "key": "password", "value": "{{generated_customer_password}}", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/auth/login?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "auth", "login" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "Text", "header": [], "cookie": [], "body": "" }, { "name": "Login by username", "originalRequest": { "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/x-www-form-urlencoded", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "username", "value": "{{generated_customer_username}}", "type": "text" }, { "key": "password", "value": "{{generated_customer_password}}", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/auth/login?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "auth", "login" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "Text", "header": [], "cookie": [], "body": "" } ] }, { "name": "Social login", "event": [ { "listen": "prerequest", "script": { "exec": [ "" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "// Retrieve and save authentication token from Customer resource response\r", "const key = \"auth_token\";\r", "if (200 === pm.response.code) {\r", " const val = JSON.parse(responseBody).data.auth_token;\r", " console.log(`Saving ${key} as ${val}`);\r", " postman.setEnvironmentVariable(key, val);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email", "value": "", "description": "The email identifying the customer.", "type": "text" }, { "key": "idp_name", "value": "", "description": "The identity provider name.", "type": "text" }, { "key": "idp_token", "value": "", "description": "The identity provider token.", "type": "text" }, { "key": "language", "value": "{{default_language}}", "description": "The customer’s language as a two-letter code, defined by ISO 639-1 standard.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/auth/idp/login?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "auth", "idp", "login" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this endpoint to allow your customers to login via supported external [social identity providers](https://null). It returns a [Customer resource](https://null) when successful, which contains a valid JSON Web Token (JWT) to be used in subsequent request to any protected endpoints.\n\n---" }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "console.log('Pelcro Open API (v1) pre-request (Authentication)');" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Customer", "item": [ { "name": "Segments", "item": [ { "name": "Eligible plans", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/customer/plans?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "customer", "plans" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to list all plans that are associated with [segments](https://null) which are valid for the customer. It will return a list of [Plan resource](https://null) when successful.\n\n#### Related features\n\n- [Customer segments](https://null)\n \n\n---" }, "response": [] }, { "name": "Eligible coupons", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/customer/coupons?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "customer", "coupons" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to list all coupons that are associated with [segments](https://null) which are valid for the customer. It will return a list of [Coupon resource](https://null) when successful.\n\n#### Related features\n\n- [Customer segments](https://null)" }, "response": [] }, { "name": "Eligible product skus", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/customer/product_sku?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "customer", "product_sku" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to list all product skus that are associated with [segments](https://null) which are valid for the customer. It will return a list of [Product SKU resource](https://null) when successful.\n\n#### Related features\n\n- [Customer segments](https://null)" }, "response": [] } ] }, { "name": "Email verification", "item": [ { "name": "Request", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/customer/email/verify?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "customer", "email", "verify" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to send a verification email request to the authenticated customer. It will return a [Customer resource](https://null) when successful and a [customer.email_verification_request](https://null) \" event will be triggered, which you can listen to by setting up a [webhook endpoint](https://null)\n\n#### Related features\n\n- [Customer email verification](https://null)\n \n\n---" }, "response": [] }, { "name": "Verify", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email_verify_token", "value": "", "description": "The email verification token that was sent to the customer's inbox.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/customer/email/verify?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "customer", "email", "verify" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this public endpoint to verify a customer's email address using the `email_verify_token` sent to the customer. It will return a [Customer resource](https://null) when successful and a [customer.email_verification_succeeded](https://null) \" event will be triggered, which you can listen to by setting up a [webhook endpoint](https://null)\n\n#### Related features\n\n- [Customer email verification](https://null)\n \n\n---" }, "response": [] } ] }, { "name": "Profile picture", "item": [ { "name": "Upload", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "profile_picture", "type": "file", "src": [] } ] }, "url": { "raw": "{{open_api_url}}/customer/picture?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "customer", "picture" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to upload a profile picture for the authenticated customer. It will return a [Customer resource](https://null) when successful.\n\n---" }, "response": [] }, { "name": "Delete", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{open_api_url}}/customer/picture?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "customer", "picture" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to delete the existing profile picture associated to the authenticated customer. It will return a [Customer resource](https://null) when successful.\n\n---" }, "response": [] } ] }, { "name": "Get customer", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "url": { "raw": "{{open_api_url}}/customer?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "customer" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to retrieve information about the authenticated customer. It will return a [Customer resource](https://null) when successful.\n\n---" }, "response": [] }, { "name": "Refresh customer", "event": [ { "listen": "test", "script": { "exec": [ "// Retrieve and save authentication token from Customer resource response\r", "const key = \"auth_token\";\r", "if (200 === pm.response.code) {\r", " const val = JSON.parse(responseBody).data.auth_token;\r", " console.log(`Saving ${key} as ${val}`);\r", " postman.setEnvironmentVariable(key, val);\r", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "url": { "raw": "{{open_api_url}}/customer/refresh?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "customer", "refresh" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to generate fresh authentication token for the customer. It will return a [Customer resource](https://null) when successful, containing the refreshed JSON Web Token (JWT) to be used in subsequent request to any protected endpoints.\n\n---" }, "response": [] }, { "name": "Update customer", "event": [ { "listen": "prerequest", "script": { "exec": [ "window = {};\r", "let lodash = require('lodash');\r", "\r", "/* @see https://www.npmjs.com/package/faker/v/3.1.0 */\r", "pm.sendRequest(\"https://cdnjs.cloudflare.com/ajax/libs/Faker/3.1.0/faker.min.js\", (error, response) => {\r", " var text = response.text();\r", " (new Function(text))();\r", "\r", " window.faker.locale = pm.environment.get(\"default_language\") ?? \"en\";\r", " \r", " const fakeName = window.faker.name;\r", " const fakePhone = window.faker.phone;\r", " const fakeRandom = window.faker.random;\r", " const fakeCompany = window.faker.company;\r", "\r", " const first_name = fakeName.firstName();\r", " const last_name = fakeName.lastName();\r", "\r", " pm.environment.set(\"generated_customer_email\", lodash.deburr(first_name + last_name) + '@example.com');\r", " pm.environment.set(\"generated_customer_username\", lodash.kebabCase(first_name + ' ' + last_name));\r", " pm.environment.set(\"generated_customer_password\", generatePassword());\r", " pm.environment.set(\"generated_customer_first_name\", first_name);\r", " pm.environment.set(\"generated_customer_last_name\", last_name);\r", " pm.environment.set(\"generated_customer_title\", fakeName.title());\r", " pm.environment.set(\"generated_customer_salutation\", fakeName.prefix());\r", " pm.environment.set(\"generated_customer_phone\", fakePhone.phoneNumber());\r", " pm.environment.set(\"generated_organization\", fakeCompany.companyName());\r", " pm.environment.set(\"generated_old_provider_id\", fakeRandom.uuid());\r", " pm.environment.set(\"generated_email_hardbounce\", Number(fakeRandom.boolean())); \r", " pm.environment.set(\"generated_email_confirm\", Number(fakeRandom.boolean()));\r", " pm.environment.set(\"generated_phone_confirm\", Number(fakeRandom.boolean()));\r", "})\r", "\r", "/**\r", " * Simple strong password generator.\r", " */\r", "function generatePassword(length = 21)\r", "{\r", " var stack = [];\r", " stack += \"abcdefghijklmnopqrstuvwxyz\"\r", " stack += \"ABCDEFGHIJKLMNOPQRSTUVWXZ\"\r", " stack += \"0123456789\"\r", " stack += \"!@#$%^&*()?.<\\>|=+:;,[-_]\"\r", " let string = \"\"\r", " for (let i = 0; i < length; i++) {\r", " let rng = [Math.floor(Math.random() * stack.length)];\r", " string = string + stack[rng];\r", " }\r", " return string;\r", "}" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "disabledSystemHeaders": {} }, "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "_method", "value": "PUT", "description": "This endpoint accepts PUT HTTP method only.", "type": "text" }, { "key": "email", "value": "{{generated_customer_email}}", "description": "The customer's email address. If customer used social login or is a member of any group subscriptions, changing email is not allowed.", "type": "text" }, { "key": "username", "value": "{{generated_customer_username}}", "description": "The customer's username. Must contain only alpha-numeric characters, dashes or underscores, as well as being unique under the same account.", "type": "text" }, { "key": "display_name", "value": "{{generated_customer_first_name}} {{generated_customer_last_name}}", "description": "The customer's display name.", "type": "text" }, { "key": "email_confirm", "value": "{{generated_email_confirm}}", "description": "A boolean on whether the customer's email address was confirmed.", "type": "text" }, { "key": "email_hardbounce", "value": "{{generated_email_hardbounce}}", "description": "A boolean on whether the customer's email is hardbounce.", "type": "text" }, { "key": "first_name", "value": "{{generated_customer_first_name}}", "description": "The customer's first name. Always required if active payment gateway is `tap`.", "type": "text" }, { "key": "last_name", "value": "{{generated_customer_last_name}}", "description": "The customer's last name. Always required if active payment gateway is `tap`.", "type": "text" }, { "key": "metadata[key1]", "value": "updated_value_for_metadata_key1", "type": "text" }, { "key": "metadata[key2]", "value": "updated_value_for_metadata_key2", "type": "text" }, { "key": "organization", "value": "{{generated_organization}}", "description": "The customer's organization.", "type": "text" }, { "key": "phone", "value": "{{generated_customer_phone}}", "description": "The customer's phone number. Must be preformatted and contain only numbers (length min: 5, length max: 20).", "type": "text" }, { "key": "phone_confirm", "value": "{{generated_phone_confirm}}", "description": "A boolean on whether the customer's phone was confirmed.", "type": "text" }, { "key": "salutation", "value": "{{generated_customer_salutation}}", "description": "The customer's salutation.", "type": "text" }, { "key": "title", "value": "{{generated_customer_title}}", "description": "The customer's title.", "type": "text" }, { "key": "tin", "value": "0123456789", "description": "The customer's tax identification number.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/customer?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "customer" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to update an authenticated customer. It will return a [Customer resource](https://null) when successful. When this feature is enabled in your site settings and the customer's email is changed, a \"[customer.email_verification_request](https://null) \" event will be triggered, which you can listen to by setting up a [webhook endpoint](https://null)\n\n#### Related features\n\n- [Customer email verification](https://null)\n- [Platform activity logs](https://null)\n \n\n---" }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "console.log('Pelcro Open API (v1) pre-request (Customer)');" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Subscription", "item": [ { "name": "Create subscription", "event": [ { "listen": "test", "script": { "exec": [ "// Retrieve and save the last subscription ID from the Customer resource response\r", "var key = \"last_created_subscription_id\";\r", "if (200 === pm.response.code) {\r", " const val = JSON.parse(responseBody).data.subscriptions[JSON.parse(responseBody).data.subscriptions.length - 1].id;\r", " console.log(`Saving ${key} as ${val}`);\r", " postman.setEnvironmentVariable(key, val);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}\r", "\r", "// Retrieve and save the last created invoice ID from the Customer resource response\r", "var key = \"last_created_invoice_id\";\r", "if (200 === pm.response.code) {\r", " const val = JSON.parse(responseBody).data.invoices[JSON.parse(responseBody).data.invoices.length - 1].id;\r", " console.log(`Saving ${key} as ${val}`);\r", " postman.setEnvironmentVariable(key, val);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}" ], "type": "text/javascript", "packages": {} } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "payment_gateway", "value": "{{payment_gateway}}", "description": "The optional payment gateway, one of `stripe`, `braintree`, `vantiv`, `tap` or `cybersource`. Always defaults to stripe.", "type": "text", "disabled": true }, { "key": "gateway_token", "value": "pm_card_visa", "description": "The single-use token that represents the payment method details. Typically generated using the payment gateway's tools and libraries. This payment method will be used to attempt payments for this newly created subscription.", "type": "text", "disabled": true }, { "key": "plan_id", "value": "", "description": "The unique identifier of plan. If you associated a customer [segment](doc:segments) to the plan, a validation will be performed. Therefore, it is recommended to validate against [eligible plans](ref:api-open-segments-eligible-plans) for the customer first. Always required.", "type": "text" }, { "key": "source_id", "value": "{{last_created_payment_method_id}}", "description": "The unique identifier of an existing chargeable payment method already attached to the customer, which will be used to attempt payments for this subscription.", "type": "text" }, { "key": "address_id", "value": "{{last_created_address_id}}", "description": "The shipping address identifier. Required if related product requires an address, if product is available only in certain countries, or if tax feature is enabled under your account.", "type": "text", "disabled": true }, { "key": "coupon_code", "value": "", "description": "An optional coupon code to apply a discount to the subscription. If you associated a customer [segment](doc:segments) to the coupon, a validation will be performed. Therefore, it is recommended to validate against [eligible coupons](ref:api-open-segments-eligible-coupons) for the customer first.", "type": "text" }, { "key": "metadata[key1]", "value": "value_for_metadata_key1", "description": "Set of key-value pairs that can be saved on subscription level. This can be useful for storing additional information about the object in a structured format.", "type": "text" }, { "key": "campaign_key", "value": "create_campaign_key", "description": "An optional campaign key associated to the subscription. If the key does not already exist, it will be created. The campaign key must be between 3 and 191 characters in length and include only letters, numbers, dashes and underscores without space.", "type": "text" }, { "key": "gift_code", "value": "", "type": "text" }, { "key": "source", "value": "Postman", "description": "An arbitrary string specifying the origin of the subscription request. (ex: web, bobile, blow-in/letter, phone, API, imported, etc.)", "type": "text" }, { "key": "quantity", "value": "1", "description": "Quantity for this subscription, always 1 by default.", "type": "text" }, { "key": "apple_iap_receipt", "value": "", "description": "The Apple in-app purchase receipt. Typically populated by leveraging our [iOS SDK](doc:ios-sdk).", "type": "text", "disabled": true } ] }, "url": { "raw": "{{open_api_url}}/subscription?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to create a subscription for an authenticated customer. This will return a [Customer resource](https://null) when successful.\n\n#### Related webhook events\n\n- [subscription.created](https://null)\n \n\n#### Related features\n\n- [Subscriptions](https://null)\n \n\n---" }, "response": [ { "name": "Create membership subscription", "originalRequest": { "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/x-www-form-urlencoded", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "plan_id", "value": "27451", "type": "text" }, { "key": "pay_via_send_invoice", "value": "1", "type": "text" }, { "key": "ip_addresses[]", "value": "74.58.161.216", "description": "IP addresses that will allow end-users to be members of this subscription upon registration/login. This attribute can only be set when the subscription plan type is membership.", "type": "text" }, { "key": "domains[]", "value": "example.com", "description": "Email domains that will allow end-users with these domains to be members of this subscription upon registration/login. This attribute can only be set when the subscription plan type is membership.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/subscription?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "_postman_previewlanguage": "Text", "header": [], "cookie": [], "body": "" }, { "name": "Create using Stripe", "originalRequest": { "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/x-www-form-urlencoded", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "payment_gateway", "value": "stripe", "type": "text" }, { "key": "gateway_token", "value": "pm_card_visa", "type": "text" }, { "key": "plan_id", "value": "", "type": "text" }, { "key": "address_id", "value": "", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/subscription?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "_postman_previewlanguage": "Text", "header": [], "cookie": [], "body": "" }, { "name": "Create using Vantiv", "originalRequest": { "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/x-www-form-urlencoded", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "payment_gateway", "value": "vantiv", "type": "text" }, { "key": "gateway_token", "value": "", "type": "text" }, { "key": "plan_id", "value": "27448", "type": "text" }, { "key": "address_id", "value": "2088220", "type": "text" }, { "key": "gateway_token[paypageRegistrationId]", "value": "", "type": "text" }, { "key": "gateway_token[bin]", "value": "", "type": "text" }, { "key": "gateway_token[firstSix]", "value": "", "type": "text" }, { "key": "gateway_token[id]", "value": "", "type": "text" }, { "key": "gateway_token[invokeMerchantCallback]", "value": "", "type": "text" }, { "key": "gateway_token[lastFour]", "value": "", "type": "text" }, { "key": "gateway_token[message]", "value": "", "type": "text" }, { "key": "gateway_token[orderId]", "value": "", "type": "text" }, { "key": "gateway_token[reportGroup]", "value": "", "type": "text" }, { "key": "gateway_token[response]", "value": "", "type": "text" }, { "key": "gateway_token[responseTime]", "value": "", "type": "text" }, { "key": "gateway_token[targetServer]", "value": "", "type": "text" }, { "key": "gateway_token[type]", "value": "", "type": "text" }, { "key": "gateway_token[vantivTxnId]", "value": "", "type": "text" }, { "key": "gateway_token[expYear]", "value": "", "type": "text" }, { "key": "gateway_token[expMonth]", "value": "", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/subscription?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "_postman_previewlanguage": "Text", "header": [], "cookie": [], "body": "" }, { "name": "Paid by send_invoice", "originalRequest": { "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/x-www-form-urlencoded", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "plan_id", "value": "27450", "type": "text" }, { "key": "address_id", "value": "", "type": "text", "disabled": true }, { "key": "pay_via_send_invoice", "value": "1", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/subscription?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "_postman_previewlanguage": "Text", "header": [], "cookie": [], "body": "" } ] }, { "name": "Cancel subscription", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "subscription_id", "value": "{{last_created_subscription_id}}", "description": "The unique identifier of the subscription to cancel.", "type": "text" }, { "key": "mode", "value": "", "description": "Defines the cancellation mode, one of `now`, `current_period_end` or `last_period_end`. Choosing `now` will cancel it immediately and refund the prorated amount, if applicable. Default is to cancel at `last_period_end`.", "type": "text" }, { "key": "reason", "value": "", "description": "The cancellation reason.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/subscription/cancel?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription", "cancel" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to cancel an existing subscription, which will return a [Customer resource](https://null) when successful. Cancelling immediately via `now` mode is dependent on enabling immediate subscription cancellation on customer dashboard option from your site settings.\n\n#### Related webhook events\n\n- [subscription.updated](https://null)\n \n- [subscription.canceled](https://null)\n \n- [subscription.expired](https://null)\n \n\n#### Related features\n\n- [Subscriptions](https://null)\n \n\n---" }, "response": [ { "name": "Cancel now", "originalRequest": { "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/x-www-form-urlencoded", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "subscription_id", "value": "{{last_created_subscription_id}}", "type": "text" }, { "key": "mode", "value": "now", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/subscription/cancel?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription", "cancel" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "_postman_previewlanguage": "Text", "header": [], "cookie": [], "body": "" }, { "name": "Cancel at current_period_end", "originalRequest": { "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/x-www-form-urlencoded", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "subscription_id", "value": "{{last_created_subscription_id}}", "type": "text" }, { "key": "mode", "value": "current_period_end", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/subscription/cancel?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription", "cancel" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "_postman_previewlanguage": "Text", "header": [], "cookie": [], "body": "" } ] }, { "name": "Reactivate subscription", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "subscription_id", "value": "{{last_created_subscription_id}}", "description": "The unique identifier of the subscription to reactivate.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/subscription/reactivate?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription", "reactivate" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to reactivate a subscription which is scheduled to be canceled. This will return a [Customer resource](https://null) when successful.\n\n#### Related webhook events\n\n- [subscription.updated](https://null)\n \n\n#### Related features\n\n- [Subscriptions](https://null)\n \n\n---" }, "response": [] }, { "name": "Renew subscription", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript", "packages": {} } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "plan_id", "value": "", "description": "The unique identifier of plan the subscription should renew on. If you associated a customer [segment](doc:segments) to the plan, a validation will be performed. Therefore, it is recommended to validate against [eligible plans](ref:api-open-segments-eligible-plans) for the customer first. Always required.", "type": "text" }, { "key": "subscription_id", "value": "{{last_created_subscription_id}}", "description": "The unique identifier of the subscription to renew. Always required.", "type": "text" }, { "key": "language", "value": "{{default_language}}", "description": "The customer’s preferred language as a two-letter code, defined by ISO 639-1 standard.", "type": "text" }, { "key": "payment_gateway", "value": "stripe", "description": "The optional [payment gateway](doc:payment-gateways), one of `stripe`, `braintree`, `vantiv`, `tap` or `cybersource`. Always defaults to `stripe`.", "type": "text", "disabled": true }, { "key": "gateway_token", "value": "pm_card_visa", "description": "The single-use token that represents the payment method details. Typically generated using the payment gateway's tools and libraries. This payment method will be used to attempt payments for the subscription.", "type": "text", "disabled": true }, { "key": "address_id", "value": "{{last_created_address_id}}", "description": "The shipping address identifier. Required if related product requires an address, if product is available only in certain countries, or if tax feature is enabled under your account.", "type": "text", "disabled": true }, { "key": "campaign_key", "value": "renewal_campaign_key", "description": "The campaign associated to the subscription. If the key does not already exist, it will be created. The campaign key must be between 3 and 191 characters in length and include only letters, numbers, dashes and underscores without space.", "type": "text", "disabled": true }, { "key": "source_id", "value": "{{last_created_payment_method_id}}", "description": "The unique identifier of chargeable payment method already attached to the customer, which will be used to attempt payments for this subscription.", "type": "text", "disabled": true }, { "key": "coupon_code", "value": "", "description": "An optional coupon code to apply a discount to the subscription. If you associated a customer [segment](doc:segments) to the coupon, a validation will be performed. Therefore, it is recommended to validate against [eligible coupons](ref:api-open-segments-eligible-coupons) for the customer first.", "type": "text", "disabled": true }, { "key": "source", "value": "Postman", "description": "An arbitrary string specifying the origin of the subscription request. (ex: web, bobile, blow-in/letter, phone, API, imported, etc.)", "type": "text", "disabled": true } ] }, "url": { "raw": "{{open_api_url}}/subscription/renew?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription", "renew" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to renew an existing subscription for an authenticated customer. This will return a [Customer resource](https://null) when successful.\n\n#### Related webhook events\n\n- [subscription.renewed](https://null)\n \n- [subscription.updated](https://null)\n \n\n#### Related features\n\n- [Subscriptions](https://null)\n \n- [Charge upon renewal](https://null)\n \n\n---" }, "response": [] }, { "name": "Order subscription", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "plan_id", "value": "", "description": "The unique identifier of plan. Always required.", "type": "text" }, { "key": "coupon_code", "value": "", "description": "An optional coupon code to apply a discount to the subscription. If you associated a customer [segment](doc:segments) to the coupon, a validation will be performed. Therefore, it is recommended to validate against [eligible coupons](ref:api-open-segments-eligible-coupons) for the customer first.", "type": "text" }, { "key": "address_id", "value": "", "description": "The identifier of the shipping address to associate with the subscription. Required if related product requires an address, if product is available only in certain countries, or if tax feature is enabled under your account.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/order?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "order" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "Given a specific plan identifier, optional coupon code and shipping address, this endpoint returns information about subtotal, total and taxes, useful to display to the customer in the context of a checkout flow. \n \nThis is a **protected** endpoint which requires proper [authorization header](https://null) to authenticate the customer." }, "response": [] }, { "name": "Change subscription", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "subscription_id", "value": "", "description": "The unique identifier of the subscription to reactivate.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/subscription/reactivate?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "subscription", "reactivate" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "This endpoint can be used to reactivate a subscription which is scheduled to be canceled. \n \nThis is a **protected** endpoint which requires proper [authorization header](https://null) to authenticate the customer and returns a [Customer resource](https://null)." }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "console.log('Pelcro Open API (v1) pre-request (Subscription)');" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Source", "item": [ { "name": "Create source", "event": [ { "listen": "test", "script": { "exec": [ "// Retrieve and save the last created source ID from the Custoemr resource response\r", "const key = \"last_created_source_id\";\r", "if (200 === pm.response.code) {\r", " const val = JSON.parse(responseBody).data.sources[JSON.parse(responseBody).data.sources.length - 1].id;\r", " console.log(`Saving ${key} as ${val}`);\r", " postman.setEnvironmentVariable(key, val);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}\r", "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "payment_gateway", "value": "stripe", "description": "The optional [payment gateway](doc:payment-gateways), one of `stripe`, `braintree`, `vantiv`, `tap` or `cybersource`. Always defaults to `stripe`.", "type": "text" }, { "key": "token", "value": "tok_visa", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/source?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "source" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "_This endpoint is deprecated and will be removed in a future version. Use_ [Create payment method](https://create-payment-method) _endpoint instead._\n\n### Description\n\nUse this protected endpoint to create a new payment method, attach it to the authenticated customer and set it as the default. It will return a [Customer resource](https://null) when successful, with additional information about the `setupIntent`, if applicable.\n\n#### Related features\n\n- [Automatic collection method transition](https://null)\n \n\n---" }, "response": [] }, { "name": "Update source", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "_method", "value": "PUT", "description": "This endpoint accepts PUT HTTP method only.", "type": "text" }, { "key": "cc_exp", "value": "06/30", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/source/{{last_created_source_id}}?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "source", "{{last_created_source_id}}" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "_This endpoint is deprecated and will be removed in a future version. Use_ [Update payment method](https://update-payment-method) _endpoint instead._\n\n### Description\n\nUse this protected endpoint to update the expiration date of an existing payment method already attached to an authenticated customer. It will return a [Customer resource](https://null) when successful. Only supports `stripe` [payment gateway](https://null).\n\n---\n\n---" }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "console.log('Pelcro Open API (v1) pre-request (Customer)');" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Payment methods", "item": [ { "name": "Create payment method", "event": [ { "listen": "test", "script": { "exec": [ "// Retrieve and save the last created payment method ID from the PaymentMethod resource response\r", "const key = \"last_created_payment_method_id\";\r", "if ([200, 201].includes(pm.response.code)) {\r", " const val = JSON.parse(responseBody).data.id;\r", " console.log(`Saving ${key} as ${val}`);\r", " postman.setEnvironmentVariable(key, val);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "payment_gateway", "value": "stripe", "type": "text" }, { "key": "token", "value": "pm_card_visa", "description": "The single-use token that represents the payment method details. Typically generated using the payment gateway's tools and libraries.", "type": "text" }, { "key": "is_default", "value": "", "description": "Boolean value indicating whether the newly added card should be set as the default option or not.", "type": "text", "disabled": true } ] }, "url": { "raw": "{{open_api_url}}/payment_methods?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "payment_methods" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to create a new payment method, attach it to the authenticated customer set it as the default. It will return a [Payment method resource](https://null)when successful, with additional information about the `setupIntent`, if applicable.\n\n#### Related webhook events\n\n- [source.created](https://null)\n \n\n#### Related features\n\n- [Automatic collection method transition](https://null)\n \n\n---" }, "response": [] }, { "name": "Update payment method", "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "_method", "value": "PUT", "type": "text" }, { "key": "payment_gateway", "value": "stripe", "type": "text" }, { "key": "is_default", "value": "1", "description": "Flag to set if the payment method should become the default.", "type": "text" }, { "key": "exp_month", "value": "12", "description": "The expiry month for the payment method. Always required.", "type": "text" }, { "key": "exp_year", "value": "2025", "description": "The expiry year for the payment method. Always required.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/payment_methods/{{last_created_payment_method_id}}?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "payment_methods", "{{last_created_payment_method_id}}" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to update the expiration date of an existing payment method already attached to an authenticated customer, or set it as the new default. It will return a [Payment method resource](https://null)when successful.\n\n#### Related webhook events\n\n- [source.updated](https://null)\n \n\n---" }, "response": [] }, { "name": "List payment methods", "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/payment_methods?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "payment_methods" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "Use this protected endpoint to list all payment methods associated to the authenticated customer. It will return a list of [Payment method resource](https://null) when successful." }, "response": [] }, { "name": "Retrieve payment method", "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/payment_methods/{{last_created_payment_method_id}}?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "payment_methods", "{{last_created_payment_method_id}}" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "Use this protected endpoint to list all payment methods associated to the authenticated customer. It will return a [Payment method resource](https://null) when successful.\n\n---" }, "response": [] }, { "name": "Delete payment method", "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{open_api_url}}/payment_methods/{{last_created_payment_method_id}}?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "payment_methods", "{{last_created_payment_method_id}}" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to delete a payment method associated to the authenticated customer. Note that the `deletable` attribute must be set to true to be able to perform this operation. If the payment method has `is_default` attribute set to true or is associated to valid subscriptions, it cannot be deleted.\n\nReturns a [Payment method resource](https://null) when successful.\n\n#### Related webhook events\n\n- [source.deleted](https://null)" }, "response": [] } ] }, { "name": "Address", "item": [ { "name": "Create address", "event": [ { "listen": "test", "script": { "exec": [ "// Retrieve and save the last created address ID from the Customer resource response\r", "const key = \"last_created_address_id\";\r", "if (200 === pm.response.code) {\r", " const val = JSON.parse(responseBody).data.addresses[JSON.parse(responseBody).data.addresses.length - 1].id;\r", " console.log(`Saving ${key} as ${val}`);\r", " postman.setEnvironmentVariable(key, val);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}\r", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "window = {}\r", "\r", "/* @see https://www.npmjs.com/package/faker/v/3.1.0 */\r", "pm.sendRequest(\"https://cdnjs.cloudflare.com/ajax/libs/Faker/3.1.0/faker.min.js\", (error, response) => {\r", " var text = response.text();\r", " (new Function(text))();\r", "\r", " window.faker.locale = pm.environment.get(\"default_language\") ?? \"en\";\r", "\r", " const fakeAddress = window.faker.address;\r", " const fakePhone = window.faker.phone;\r", " \r", " const line1 = fakeAddress.streetAddress();\r", " const city = fakeAddress.zipCode();\r", " const state = fakeAddress.stateAbbr();\r", " const postal_code = fakeAddress.zipCode();\r", " \r", " pm.environment.set(\"generated_address_line1\", line1);\r", " pm.environment.set(\"generated_address_city\", city);\r", " pm.environment.set(\"generated_address_state\", state);\r", " pm.environment.set(\"generated_address_postal_code\", postal_code);\r", " pm.environment.set(\"generated_address_phone\", fakePhone.phoneNumber());\r", "})\r", "\r", "/* An alternative to the \"old\" Faker lib, but it's not mature enough */\r", "// pm.sendRequest(\"https://chancejs.com/chance.min.js\", (error, response) => {\r", "\r", " // Convert response to text and save it as an environment variable.\r", " // pm.collectionVariables.set(\"chancejs_library\", response.text());\r", "\r", " // Eval the JavaScript code and intialize it.\r", " // eval(pm.collectionVariables.get(\"chancejs_library\"));\r", "\r", " // console.log(window.chance.address());\r", "//})" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "type", "value": "shipping", "description": "The address type, one of either \"shipping\" or \"billing\".", "type": "text" }, { "key": "country", "value": "US", "description": "The two-letter code of the country, as specified by [ISO 3166 alpha-2 standard](https://www.iso.org/obp/ui/#search/code/). Always required.", "type": "text" }, { "key": "line1", "value": "{{generated_address_line1}}", "description": "The first line of the address. Always required.", "type": "text" }, { "key": "language", "value": "{{default_language}}", "description": "The customer’s preferred language as a two-letter code, defined by ISO 639-1 standard. Always required.", "type": "text" }, { "key": "first_name", "value": "", "description": "The address's first name that belongs to the customer.", "type": "text" }, { "key": "last_name", "value": "", "description": "The address's last name that belongs to the customer.", "type": "text" }, { "key": "line2", "value": "", "description": "The second line of the address.", "type": "text" }, { "key": "city", "value": "{{generated_address_city}}", "description": "The name of a city, town, village, etc.", "type": "text" }, { "key": "state", "value": "{{generated_address_state}}", "description": "The two-letter code of the state, region, or province.", "type": "text" }, { "key": "postal_code", "value": "{{generated_address_postal_code}}", "description": "Postal code or zip associated with the address.", "type": "text" }, { "key": "is_default", "value": "1", "description": "Set this address as the new default. Only one default address of the same type can be set at all times.", "type": "text" }, { "key": "phone", "value": "{{generated_address_phone}}", "description": "Numeric phone number associated with the address. Must be preformatted and contain only numbers (length min: 5, length max: 20).", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/address?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "address" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to create an address for the authenticated customer. It will return a [Customer resource](https://null) when successful.\n\n#### Related webhook events\n\n- [address.created](https://null)\n \n\n---" }, "response": [] }, { "name": "Update address", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "window = {};\r", "\r", "/* @see https://www.npmjs.com/package/faker/v/3.1.0 */\r", "pm.sendRequest(\"https://cdnjs.cloudflare.com/ajax/libs/Faker/3.1.0/faker.min.js\", (error, response) => {\r", " var text = response.text();\r", " (new Function(text))();\r", " window.faker.locale = \"en\";\r", " let city = window.faker.address.zipCode();\r", " let line1 = window.faker.address.streetAddress();\r", " let state = window.faker.address.stateAbbr();\r", " let postal_code = window.faker.address.zipCode();\r", " \r", " pm.environment.set(\"address_city\", city);\r", " pm.environment.set(\"address_line1\", line1);\r", " pm.environment.set(\"address_state\", state);\r", " pm.environment.set(\"address_postal_code\", postal_code);\r", "})" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "_method", "value": "PUT", "type": "text" }, { "key": "country", "value": "US", "description": "The two-letter code of the country, as specified by [ISO 3166 alpha-2 standard](https://www.iso.org/obp/ui/#search/code/). Always required.", "type": "text" }, { "key": "line1", "value": "{{address_line1}}", "description": "The first line of the address. Always required.", "type": "text" }, { "key": "language", "value": "{{default_language}}", "description": "The customer’s preferred language as a two-letter code, defined by ISO 639-1 standard. Always required.", "type": "text" }, { "key": "first_name", "value": "first_name", "description": "The address's first name that belongs to the customer. Always required.", "type": "text" }, { "key": "last_name", "value": "last_name", "description": "The address's last name that belongs to the customer. Always required.", "type": "text" }, { "key": "line2", "value": "", "description": "The second line of the address.", "type": "text" }, { "key": "city", "value": "{{address_city}}", "description": "The name of a city, town, village, etc. Always required.", "type": "text" }, { "key": "state", "value": "{{address_state}}", "description": "The two-letter code of the state, region, or province. Always required.", "type": "text" }, { "key": "postal_code", "value": "{{address_postal_code}}", "description": "Postal code or zip associated with the address. Always required.", "type": "text" }, { "key": "is_default", "value": "1", "description": "Set this address as the new default. Only one default address of the same type can be set at all times.", "type": "text" }, { "key": "phone", "value": "", "description": "Numeric phone number associated with the address. Must be preformatted and contain only numbers (length min: 5, length max: 20).", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/address/{{last_created_address_id}}?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "address", "{{last_created_address_id}}" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to update existing an address for the authenticated customer. It will return a [Customer resource](https://null) when successful.\n\n#### Related webhook events\n\n- [address.updated](https://null)\n \n\n---" }, "response": [] } ] }, { "name": "Newsletter", "item": [ { "name": "Create newsletter", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "window = {};\r", "let lodash = require('lodash');\r", "\r", "const sources = ['web', 'phone', 'mail', 'other'];\r", "const lists = ['list1', 'list2', 'list3', 'list4', 'list5', 'list6', 'list7'];\r", "const consent_types = ['explicit', 'implicit', 'landing'];\r", "\r", "/* @see https://www.npmjs.com/package/faker/v/3.1.0 */\r", "pm.sendRequest(\"https://cdnjs.cloudflare.com/ajax/libs/Faker/3.1.0/faker.min.js\", (error, response) => {\r", " var text = response.text();\r", " (new Function(text))();\r", "\r", " window.faker.locale = pm.environment.get(\"default_language\") ?? \"en\";\r", " \r", " const fakeName = window.faker.name;\r", " const fakeLorem = window.faker.lorem;\r", " const fakeInternet = window.faker.internet;\r", "\r", " const first_name = pm.environment.get(\"generated_customer_first_name\") ?? fakeName.firstName();\r", " const last_name = pm.environment.get(\"generated_customer_last_name\") ?? fakeName.firstName();\r", "\r", " pm.environment.set(\"generated_newsletter_source\", lodash.sample(sources));\r", " pm.environment.set(\"generated_newsletter_lists\", lodash.sampleSize(lists, lodash.random(1, lists.length)).join(','));\r", " pm.environment.set(\"generated_newsletter_consent_type\", lodash.sample(consent_types));\r", " pm.environment.set(\"generated_newsletter_consent_url\", fakeInternet.url());\r", " pm.environment.set(\"generated_newsletter_consent_text\", fakeLorem.sentence());\r", " pm.environment.set(\"generated_newsletter_consent_ip\", fakeInternet.ip());\r", " pm.environment.set(\"generated_newsletter_first_name\", first_name);\r", " pm.environment.set(\"generated_newsletter_last_name\", last_name);\r", "})" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email", "value": "{{generated_customer_email}}", "description": "The email address to associate to the newsletter subscription. Always required.", "type": "text" }, { "key": "source", "value": "{{generated_newsletter_source}}", "description": "Optional source for the newsletter subscription request (web, phone, mail, other), maximum 32 characters.", "type": "text" }, { "key": "lists", "value": "{{generated_newsletter_lists}}", "description": "Optional comma separated lists.", "type": "text" }, { "key": "first_name", "value": "{{generated_newsletter_first_name}}", "description": "Optional first name of the newsletter subscriber.", "type": "text" }, { "key": "last_name", "value": "{{generated_newsletter_last_name}}", "description": "Optional last name of the newsletter subscriber.", "type": "text" }, { "key": "consent_url", "value": "{{generated_newsletter_consent_url}}", "description": "Optional URL from which the customer subscribed to the newsletter.", "type": "text" }, { "key": "consent_text", "value": "{{generated_newsletter_consent_text}}", "description": "Optional consent text which customer read before subscribing to the newsletter, maximum 100 characters.", "type": "text" }, { "key": "consent_type", "value": "{{generated_newsletter_consent_type}}", "description": "Optional consent type.", "type": "text" }, { "key": "consent_ip", "value": "{{generated_newsletter_consent_ip}}", "description": "Optional IP address from which the consent was given.", "type": "text" }, { "key": "postal_code", "value": "", "description": "Optional postal code of the newsletter subscriber.", "type": "text", "disabled": true } ] }, "url": { "raw": "{{open_api_url}}/newsletter?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "newsletter" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this public endpoint to create a newsletter entry for a given email address. Only one entry per email, per site is allowed.\n\n#### Related webhook events\n\n- [newsletter.created](https://null)\n \n\n---" }, "response": [] }, { "name": "Get newsletter", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/newsletter/{{generated_customer_email}}?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "newsletter", "{{generated_customer_email}}" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this public endpoint to retrieve the first newsletter entry a given email address belongs to.\n\n---" }, "response": [] }, { "name": "Update newsletter", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "window = {};\r", "let lodash = require('lodash');\r", "\r", "const sources = ['web', 'phone', 'mail', 'other'];\r", "const lists = ['list1', 'list2', 'list3', 'list4', 'list5', 'list6', 'list7'];\r", "const consent_types = ['explicit', 'implicit', 'landing'];\r", "\r", "/* @see https://www.npmjs.com/package/faker/v/3.1.0 */\r", "pm.sendRequest(\"https://cdnjs.cloudflare.com/ajax/libs/Faker/3.1.0/faker.min.js\", (error, response) => {\r", " var text = response.text();\r", " (new Function(text))();\r", "\r", " window.faker.locale = pm.environment.get(\"default_language\") ?? \"en\";\r", " \r", " const fakeName = window.faker.name;\r", " const fakeLorem = window.faker.lorem;\r", " const fakeInternet = window.faker.internet;\r", "\r", " const first_name = pm.environment.get(\"generated_customer_first_name\") ?? fakeName.firstName();\r", " const last_name = pm.environment.get(\"generated_customer_last_name\") ?? fakeName.firstName();\r", "\r", " pm.environment.set(\"generated_newsletter_source\", lodash.sample(sources));\r", " pm.environment.set(\"generated_newsletter_lists\", lodash.sampleSize(lists, lodash.random(1, lists.length)).join(','));\r", " pm.environment.set(\"generated_newsletter_consent_type\", lodash.sample(consent_types));\r", " pm.environment.set(\"generated_newsletter_consent_url\", fakeInternet.url());\r", " pm.environment.set(\"generated_newsletter_consent_text\", fakeLorem.sentence());\r", " pm.environment.set(\"generated_newsletter_consent_ip\", fakeInternet.ip());\r", " pm.environment.set(\"generated_newsletter_first_name\", first_name);\r", " pm.environment.set(\"generated_newsletter_last_name\", last_name);\r", "})" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "_method", "value": "PUT", "type": "text" }, { "key": "source", "value": "{{generated_newsletter_source}}", "description": "Optional source for the newsletter subscription request (web, phone, mail, other), maximum 32 characters.", "type": "text" }, { "key": "lists", "value": "{{generated_newsletter_lists}}", "description": "Optional comma separated lists.", "type": "text" }, { "key": "first_name", "value": "{{generated_newsletter_first_name}}", "description": "Optional first name of the newsletter subscriber.", "type": "text" }, { "key": "last_name", "value": "{{generated_newsletter_last_name}}", "description": "Optional last name of the newsletter subscriber.", "type": "text" }, { "key": "consent_url", "value": "{{generated_newsletter_consent_url}}", "description": "Optional URL from which the customer subscribed to the newsletter.", "type": "text" }, { "key": "consent_text", "value": "{{generated_newsletter_consent_text}}", "description": "Optional consent text which customer read before subscribing to the newsletter, maximum 100 characters.", "type": "text" }, { "key": "consent_type", "value": "{{generated_newsletter_consent_type}}", "description": "Optional consent type.", "type": "text" }, { "key": "consent_ip", "value": "{{generated_newsletter_consent_ip}}", "description": "Optional IP address from which the consent was given.", "type": "text" }, { "key": "postal_code", "value": "", "description": "Optional postal code of the newsletter subscriber.", "type": "text", "disabled": true } ] }, "url": { "raw": "{{open_api_url}}/newsletter/{{generated_customer_email}}?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "newsletter", "{{generated_customer_email}}" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this public endpoint to update an existing newsletter entry.\n\n#### Related webhook events\n\n- [newsletter.updated](https://null)\n \n\n---" }, "response": [] }, { "name": "Delete newsletter", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "DELETE", "header": [], "url": { "raw": "{{open_api_url}}/newsletter/{{generated_customer_email}}?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "newsletter", "{{generated_customer_email}}" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this public endpoint to delete an existing newsletter entry.\n\n---" }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "console.log('Pelcro Open API (v1) pre-request (Customer)');" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Password", "item": [ { "name": "Forgot password", "request": { "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email", "value": "{{generated_customer_email}}", "description": "The email of the customer.", "type": "text" }, { "key": "referer", "value": "", "description": "Optional parameter which can be used to transmit from where this endpoint has been requested.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/password/forgot?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "password", "forgot" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this endpoint to enable your customers to request a password reset. This will generate a \"[customer.password.reset](https://null)\" event which you can listen to by setting up a [webhook endpoint](https://null).\n\nThis is a **public** endpoint which does not require [authorization header](https://null).\n\n---" }, "response": [] }, { "name": "Reset password", "event": [ { "listen": "prerequest", "script": { "exec": [ "const generated_customer_password_updated = generatePassword();\r", "pm.environment.set(\"generated_customer_password_updated\", generated_customer_password_updated);\r", "\r", "/**\r", " * Simple strong password generator.\r", " */\r", "function generatePassword(length = 21)\r", "{\r", " var stack = [];\r", " stack += \"abcdefghijklmnopqrstuvwxyz\"\r", " stack += \"ABCDEFGHIJKLMNOPQRSTUVWXZ\"\r", " stack += \"0123456789\"\r", " stack += \"!@#$%^&*()?.<\\>|=+:;,[-_]\"\r", " let string = \"\"\r", " for (let i = 0; i < length; i++) {\r", " let rng = [Math.floor(Math.random() * stack.length)];\r", " string = string + stack[rng];\r", " }\r", " return string;\r", "}" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "const password_old = pm.environment.get(\"generated_customer_password\");\r", "const password_new = pm.environment.get(\"generated_customer_password_updated\");\r", "if (200 === pm.response.code) {\r", " console.log(\"Old password: \" + password_old);\r", " console.log(\"New password: \" + password_new);\r", " pm.environment.set(\"generated_customer_password\", password_new);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email", "value": "{{generated_customer_email}}", "description": "The email of the customer.", "type": "text" }, { "key": "password", "value": "{{generated_customer_password_updated}}", "description": "The new password.", "type": "text" }, { "key": "password_confirmation", "value": "{{generated_customer_password_updated}}", "description": "The new password (confirmed).", "type": "text" }, { "key": "token", "value": "", "description": "The unique one-time use token.", "type": "text" }, { "key": "referer", "value": "", "description": "Optional parameter which can be used to transmit from where this endpoint has been requested.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/password/reset?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "password", "reset" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this endpoint to provide your customers the ability to reset their password. It requires a unique one-time use token, which is generated from the [Forgot password](https://null) endpoint.\n\n---" }, "response": [] }, { "name": "Update password", "event": [ { "listen": "prerequest", "script": { "exec": [ "const generated_customer_password_updated = generatePassword();\r", "\r", "pm.environment.set(\"generated_customer_password_updated\", generated_customer_password_updated);\r", "\r", "/**\r", " * Simple strong password generator.\r", " */\r", "function generatePassword(length = 21)\r", "{\r", " var stack = [];\r", " stack += \"abcdefghijklmnopqrstuvwxyz\"\r", " stack += \"ABCDEFGHIJKLMNOPQRSTUVWXZ\"\r", " stack += \"0123456789\"\r", " stack += \"!@#$%^&*()?.<\\>|=+:;,[-_]\"\r", " let string = \"\"\r", " for (let i = 0; i < length; i++) {\r", " let rng = [Math.floor(Math.random() * stack.length)];\r", " string = string + stack[rng];\r", " }\r", " return string;\r", "}" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "const password_old = pm.environment.get(\"generated_customer_password\");\r", "const password_new = pm.environment.get(\"generated_customer_password_updated\");\r", "if (200 === pm.response.code) {\r", " console.log(\"Old password: \" + password_old);\r", " console.log(\"New password: \" + password_new);\r", " pm.environment.set(\"generated_customer_password\", password_new);\r", "} else {\r", " console.error(\"Open API request failed with code: \" + pm.response.code)\r", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "old_password", "value": "{{generated_customer_password}}", "description": "The current password.", "type": "text" }, { "key": "new_password", "value": "{{generated_customer_password_updated}}", "description": "The new password.", "type": "text" }, { "key": "confirm_new_password", "value": "{{generated_customer_password_updated}}", "description": "The new password (confirmed).", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/password/update?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "password", "update" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this endpoint to provide your customers the ability to reset their password while being authenticated.\n\nThis is a **protected** endpoint which requires proper [authorization header](https://null) to authenticate the customer and returns a [Customer resource](https://null) on success.\n\n---" }, "response": [] } ] }, { "name": "E-commerce", "item": [ { "name": "List products", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [] }, "url": { "raw": "{{open_api_url}}/ecommerce/products?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "ecommerce", "products" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this endpoint to retrieve a list of all e-commerce products and related skus available for purchase on your site.\n\n#### Related features\n\n- [E-commerce orders](https://null)\n \n\n---" }, "response": [] }, { "name": "Order summary", "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "items[0][sku_id]", "value": "", "description": "The items purchased as part to the order. Requires the `sku_id` and `quantity` attributes for each item.", "type": "text" }, { "key": "items[0][quantity]", "value": "", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/ecommerce/order-summary?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "ecommerce", "order-summary" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to retrieve the summary of an order, useful to display to an authenticated customer in the context of a checkout.\n\n#### Related features\n\n- [E-commerce orders](https://null)\n \n\n---" }, "response": [] }, { "name": "Order", "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "items[0][sku_id]", "value": "546", "description": "A list produt sksu and quantities to add to the order. Always required.", "type": "text" }, { "key": "items[0][quantity]", "value": "1", "type": "text" }, { "key": "source_id", "value": "{{last_created_payment_method_id}}", "description": "The unique identifier of an existing chargeable payment method already attached to the customer, which will be used to attempt payments for the order. Always required.", "type": "text" }, { "key": "address_id", "value": "{{last_created_address_id}}", "description": "The shipping address identifier. Required if related product requires an address, if product is available only in certain countries, or if tax feature is enabled under your account.", "type": "text" }, { "key": "coupon_code", "value": "", "description": "An optional coupon code to apply a discount to the order. If you associated a customer [segment](doc:segments) to the coupon, a validation will be performed. Therefore, it is recommended to validate against [eligible coupons](ref:api-open-segments-eligible-coupons) for the customer first.", "type": "text", "disabled": true }, { "key": "campaign_key", "value": "campaign_key", "description": "An optional campaign key associated to the subscription. If the key does not already exist, it will be created. The campaign key must be between 3 and 191 characters in length and include only letters, numbers, dashes and underscores without space.", "type": "text" }, { "key": "payment_gateway", "value": "stripe", "description": "The optional [payment gateway](doc:payment-gateways), one of `stripe`, `vantiv`, `tap` or `cybersource`. Always defaults to `stripe`.", "type": "text", "disabled": true }, { "key": "gateway_token", "value": "", "description": "The single-use token that represents the payment method details. Typically generated using the payment gateway's tools and libraries. This payment method will be used to attempt payments for this newly created order.", "type": "text", "disabled": true } ] }, "url": { "raw": "{{open_api_url}}/ecommerce/order?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "ecommerce", "order" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to create a new e-commerce order for the authenticated customer.\n\n#### Related webhook events\n\n- [order.created](https://null)\n \n\n#### Related features\n\n- [E-commerce orders](https://null)\n \n\n---" }, "response": [] } ] }, { "name": "Plan", "item": [ { "name": "Get IP authorization", "request": { "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/plan/ip/authorization?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "", "plan", "ip", "authorization" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this endpoint to retrieve the active and free plans matching the IP address on the request with one of the plan's allowed IP addresses. Please note that the `expires_at` attribute of the plan will not have any effects on the output of this endpoint.\n\n#### Related features\n\n- [Group subscriptions](https://null)\n \n- [Subscription plans](https://null)\n \n\n---" }, "response": [] }, { "name": "Get email authorization", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "email", "value": "{{generated_customer_email}}", "description": "The email address you want to authorize.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/plan/domain/authorization?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "", "plan", "domain", "authorization" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this endpoint to retrieve the active and free plans matching the email domain with one of the plan's allowed domains. Please note that the `expires_at` attribute of the plan will not have any effects on the output of this endpoint.\n\n#### Related features\n\n- [Group subscriptions](https://null)\n \n- [Subscription plans](https://null)\n \n\n---" }, "response": [] }, { "name": "Get plan", "request": { "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "plan_id", "value": "", "description": "The unique identifier of the plan.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/plan?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "plan" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this endpoint to retrieve information about any of the plan under your site.\n\n#### Related features\n\n- [Subscription plans](https://null)\n \n\n---" }, "response": [] } ] }, { "name": "Invoice", "item": [ { "name": "Pay invoice", "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{auth_token}}", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "source_id", "value": "{{last_created_payment_method_id}}", "description": "The unique identifier of an existing chargeable payment method already attached to the customer, which will be used to attempt payment for this invoice. Required when `payment_gateway` and `gateway_token` are not provided.", "type": "text" }, { "key": "payment_gateway", "value": "", "description": "The optional [payment gateway](doc:payment-gateways), one of `stripe`, `braintree`, `vantiv`, `tap` or `cybersource`. Required with `gateway_token` if `source_id` is not set.", "type": "text", "disabled": true }, { "key": "gateway_token", "value": "", "description": "The single-use token that represents the payment method details. Typically generated using the payment gateway's tools and libraries. This payment method will be used to attempt paying for this invoice. Required with `payment_gateway` if `source_id` is not set.", "type": "text", "disabled": true } ] }, "url": { "raw": "{{open_api_url}}/invoices/{{last_created_invoice_id}}/pay?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "invoices", "{{last_created_invoice_id}}", "pay" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] }, "description": "### Description\n\nUse this protected endpoint to allow an authenticated customer to pay an outstanding invoice using an existing or new payment method. This will automatically charge the customer for the full amount remaining to be paid on the invoice.\n\n#### Related webhook events\n\n- [charge.succeeded](https://null)\n \n- [charge.failed](https://null)\n \n- [invoice.payment_action_required](https://null)\n \n- [invoice.payment_succeeded](https://null)\n \n- [invoice.payment_failed](https://null)\n \n- [invoice.updated](https://null)\n \n\n#### Related features\n\n- [Invoices](https://null)\n \n- [Payments](https://null)\n \n\n---" }, "response": [] } ] }, { "name": "Membership", "item": [ { "name": "Update", "request": { "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "_method", "value": "PUT", "type": "text" }, { "key": "address_id", "value": "", "description": "The member's unique address identifier that's associated with the membership subscription.", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/members/{{membership_id}}?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "members", "{{membership_id}}" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "response": [] }, { "name": "IP authorization", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [] }, "url": { "raw": "{{open_api_url}}/members/ip/authorization?site_id={{site_id}}", "host": [ "{{open_api_url}}" ], "path": [ "members", "ip", "authorization" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." } ] } }, "response": [] }, { "name": "Domain authorization", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [] }, "url": { "raw": "{{open_api_url}}/members/domain/authorization?site_id={{site_id}}&email={{generated_customer_email}}", "host": [ "{{open_api_url}}" ], "path": [ "members", "domain", "authorization" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." }, { "key": "email", "value": "{{generated_customer_email}}" } ] } }, "response": [] } ] }, { "name": "Campaign", "item": [ { "name": "Get campaign", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "campaign_id", "value": "1", "type": "text" } ] }, "url": { "raw": "{{open_api_url}}/campaign?site_id={{site_id}}&campaign_id=&campaign_key", "host": [ "{{open_api_url}}" ], "path": [ "campaign" ], "query": [ { "key": "site_id", "value": "{{site_id}}", "description": "The unique identifier of the site associated with your account." }, { "key": "campaign_id", "value": "", "description": "The campaign unique identifier. Required if `campaign_key` is not provided." }, { "key": "campaign_key", "value": null, "description": "The campaign key. Required if `campaign_id` is not provided." } ] } }, "response": [] } ] }, { "name": "Geo", "item": [ { "name": "Get", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "GET", "header": [], "body": { "mode": "raw", "raw": "", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{open_api_url}}/geo/country?site_id={{site_id}}&language=en&locale=en", "host": [ "{{open_api_url}}" ], "path": [ "geo", "country" ], "query": [ { "key": "site_id", "value": "{{site_id}}" }, { "key": "language", "value": "en" }, { "key": "locale", "value": "en" } ] } }, "response": [] } ] }, { "name": "Definitions", "request": { "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/definitions", "host": [ "{{open_api_url}}" ], "path": [ "definitions" ] } }, "response": [ { "name": "Postman", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{open_api_url}}/definitions/postman", "host": [ "{{open_api_url}}" ], "path": [ "definitions", "postman" ] } }, "_postman_previewlanguage": null, "header": null, "cookie": [], "body": null } ] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ], "variable": [ { "key": "api_sdk_access_token", "value": "" }, { "key": "chancejs_library", "value": "" }, { "key": "fakerjs_library", "value": "" } ] }