{"id":706,"date":"2024-01-08T15:39:30","date_gmt":"2024-01-08T15:39:30","guid":{"rendered":"https:\/\/olxdoc.wpenginepowered.com\/?p=706"},"modified":"2024-03-06T10:15:37","modified_gmt":"2024-03-06T10:15:37","slug":"vas-lifecycle","status":"publish","type":"post","link":"https:\/\/doc.olxgroup.com\/api\/?p=706","title":{"rendered":"VAS Lifecycle"},"content":{"rendered":"\n\n\t<h1>VAS Lifecycle<\/h1>\n<p>VAS (Value-Added Services) Lifecycle Event Flow<\/p>\n\t<p><strong>Event flow name<\/strong> : <strong>vas_lifecycle<\/strong><\/p>\n<p>This event flow contains events related to\u00a0<strong>lifecycle of VAS<\/strong>, also known as value-added services or promotions.<\/p>\n\t\u2757\ufe0fThe previous system for managing promotions and notifications is deprecated and this page has been updated with the newest information. Please refer to the\u00a0<a href=\"https:\/\/developer.olxgroup.com\/docs\/applying-promotions\" target=\"_self\" rel=\"noopener\">Applying Promotions<\/a>\u00a0page to get started.\n\t<p>There are 4 available events in this flow:<\/p>\n<table>\n<thead>\n<tr>\n<th>Event Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>advert_vas_applied_success<\/td>\n<td>The event is triggered when a VAS was applied to an advert.<\/td>\n<\/tr>\n<tr>\n<td>advert_vas_applied_error<\/td>\n<td>The event is triggered when there&#8217;s an error when you try to apply the VAS.<\/td>\n<\/tr>\n<tr>\n<td>advert_vas_expired<\/td>\n<td>The event is triggered when an active VAS expires.<\/td>\n<\/tr>\n<tr>\n<td>advert_vas_removed<\/td>\n<td>The event is triggered when an active VAS is removed.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Your CRM should be prepared to handle all types of notifications and display them to the application user. Below you can find an examples of a webhook notifications regarding VASes.<\/p>\n\t<p><strong>advert_vas_applied_success<\/strong><\/p>\n\t<p>This notification is emitted when the VAS was successfully applied in the marketplace.<\/p>\n\t\n\t\t<code>Json\n{  \n  \"destination\": \"{{webhook destination}}\",  \n  \"timestamp\": 1688389559898,  \n  \"event_timestamp\": 1688389559898,  \n  \"transaction_id\": \"{{transaction_id}}\",  \n  \"object_id\": \"{{vas_uuid}}\",  \n  \"flow\": \"vas_lifecycle\",  \n  \"data\": {  \n      \"promotion_code\": \"{{promotion code}}\",\n      \"advert_uuid\": \"{{advert_uuid}}\",\n      \"status\": \"applied\",  \n      \"custom_fields\": {  \n        \"url\": \"{{ad url}}\"  \n      },\n      \"duration\": \"{{duration}}\",\n      \"expires_at\": \"2023-07-07T13:05:59Z\",  \n      \"created_at\": \"2023-07-03T13:05:24.345Z\",  \n      \"updated_at\": \"2023-07-03T13:05:59.832Z\"  \n  },  \n  \"event_type\": \"advert_vas_applied_success\"  \n}\t\t\t<\/code>\n\t\t\n\t\t<button onclick=\"copyJson('copy_19963')\">Copy<\/button>\n\t\tJson\n{  \n  &#8220;destination&#8221;: &#8220;{{webhook destination}}&#8221;,  \n  &#8220;timestamp&#8221;: 1688389559898,  \n  &#8220;event_timestamp&#8221;: 1688389559898,  \n  &#8220;transaction_id&#8221;: &#8220;{{transaction_id}}&#8221;,  \n  &#8220;object_id&#8221;: &#8220;{{vas_uuid}}&#8221;,  \n  &#8220;flow&#8221;: &#8220;vas_lifecycle&#8221;,  \n  &#8220;data&#8221;: {  \n      &#8220;promotion_code&#8221;: &#8220;{{promotion code}}&#8221;,\n      &#8220;advert_uuid&#8221;: &#8220;{{advert_uuid}}&#8221;,\n      &#8220;status&#8221;: &#8220;applied&#8221;,  \n      &#8220;custom_fields&#8221;: {  \n        &#8220;url&#8221;: &#8220;{{ad url}}&#8221;  \n      },\n      &#8220;duration&#8221;: &#8220;{{duration}}&#8221;,\n      &#8220;expires_at&#8221;: &#8220;2023-07-07T13:05:59Z&#8221;,  \n      &#8220;created_at&#8221;: &#8220;2023-07-03T13:05:24.345Z&#8221;,  \n      &#8220;updated_at&#8221;: &#8220;2023-07-03T13:05:59.832Z&#8221;  \n  },  \n  &#8220;event_type&#8221;: &#8220;advert_vas_applied_success&#8221;  \n}\n\t\tCopied to clipboard\n\t<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">transaction_id<\/code><\/td>\n<td>Transaction id uniquely identifies this request.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">object_id<\/code><\/td>\n<td>The <strong>object_id<\/strong> is the identifier for the VAS\/Promotion. It is the promotion unique id, and it corresponds to <strong>vas_uuid<\/strong>\u00a0in other requests.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">promotion_code<\/code><\/td>\n<td>Code\/name of the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">advert_uuid<\/code><\/td>\n<td>Advert id to which you applied the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">status<\/code><\/td>\n<td><strong>&#8220;status&#8221;: &#8220;applied&#8221;<\/strong>\u00a0means the promotion was successfully applied. Read more about the available <a href=\"https:\/\/developer.olxgroup.com\/docs\/promotion-status\" target=\"_self\" rel=\"noopener\">Promotion Status<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">custom_fields<\/code><\/td>\n<td>Additional fields such as <strong>url<\/strong>, <strong>olx_url<\/strong>, etc. Specific to each promotion. Read more the existing\u00a0<a href=\"https:\/\/developer.olxgroup.com\/docs\/promotion-custom-fields\" target=\"_self\" rel=\"noopener\">Custom Fields<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">duration<\/code><\/td>\n<td>Promotion duration. Usually days, but depends on the specific <strong>promotion_code<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">expires_at<\/code><\/td>\n<td>When the Promotion expires (RFC3339 format).<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">created_at<\/code><\/td>\n<td>When the Promotion was first created (RFC3339 format).<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">updated_at<\/code><\/td>\n<td>When the Promotion was last updated (RFC3339 format).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\t<p><strong>advert_vas_applied_error<\/strong><\/p>\n<p>This notification is emitted when there was an error while applying the VAS in the marketplace.<\/p>\n<p>Check\u00a0<a href=\"https:\/\/developer.olxgroup.com\/docs\/vas-errors\" target=\"_self\" rel=\"noopener\">here<\/a>\u00a0VAS errors, and suggestions of solutions.<\/p>\n\t\n\t\t<code>Json\n{\n  \"destination\": \"{{webhook destination}}\",\n  \"timestamp\": 1688392214800,\n  \"event_timestamp\": 1688392214800,\n  \"transaction_id\": \"{{transaction_id}}\",\n  \"object_id\": \"{{vas_uuid}}\",\n  \"flow\": \"publish_vas\",\n  \"error_message\": \"Advert status doesn't allow this promotion.\",\n  \"data\": {\n    \"detail\": \"Advert status doesn't allow this promotion.\",\n    \"title\": \"BadRequestException\"\n  },\n  \"event_type\": \"advert_vas_applied_error\"\n}\t\t\t<\/code>\n\t\t\n\t\t<button onclick=\"copyJson('copy_24483')\">Copy<\/button>\n\t\tJson\n{\n  &#8220;destination&#8221;: &#8220;{{webhook destination}}&#8221;,\n  &#8220;timestamp&#8221;: 1688392214800,\n  &#8220;event_timestamp&#8221;: 1688392214800,\n  &#8220;transaction_id&#8221;: &#8220;{{transaction_id}}&#8221;,\n  &#8220;object_id&#8221;: &#8220;{{vas_uuid}}&#8221;,\n  &#8220;flow&#8221;: &#8220;publish_vas&#8221;,\n  &#8220;error_message&#8221;: &#8220;Advert status doesn&#8217;t allow this promotion.&#8221;,\n  &#8220;data&#8221;: {\n    &#8220;detail&#8221;: &#8220;Advert status doesn&#8217;t allow this promotion.&#8221;,\n    &#8220;title&#8221;: &#8220;BadRequestException&#8221;\n  },\n  &#8220;event_type&#8221;: &#8220;advert_vas_applied_error&#8221;\n}\n\t\tCopied to clipboard\n\t<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">error_message<\/code><\/td>\n<td>Error describes why the promotion was not successfully applied.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">title<\/code><\/td>\n<td>A high-level error title.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">detail<\/code><\/td>\n<td>Same as <strong>error_message<\/strong>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\t<p><strong> status<\/strong>, <strong>promotion_code<\/strong> and <strong>custom_fields<\/strong> are NOT displayed for the <strong>event_type<\/strong><strong>advert_vas_applied_error.<\/strong><\/p>\n\t<p><strong>advert_vas_expired<\/strong><\/p>\n\t<p>This notification is emitted when the promotion expired in marketplace as it reached the expiration date.<\/p>\n\t\n\t\t<code>Json\n{\n  \"destination\": \"{{webhook destination}}\",\n  \"timestamp\": 1688389559898,\n  \"event_timestamp\": 1688389559898,\n  \"transaction_id\": \"{{transaction_id}}\",\n  \"object_id\": \"{{vas_uuid}}\",\n  \"flow\": \"vas_lifecycle\",\n  \"data\": {\n    \"promotion_code\": \"{{promotion code}}\",\n    \"advert_uuid\": \"{{advert_uuid}}\",\n    \"status\": \"expired\",\n    \"custom_fields\": {\n      \"url\": \"{{ad url}}\"\n    },\n    \"duration\": \"{{duration}}\",\n    \"expires_at\": \"2023-07-25T14:11:48Z\",\n    \"updated_at\": \"2023-07-25T22:45:01.679Z\",\n    \"created_at\": \"2023-07-24T14:11:49.589Z\"\n  },\n  \"event_type\": \"advert_vas_expired\"\n}\t\t\t<\/code>\n\t\t\n\t\t<button onclick=\"copyJson('copy_22318')\">Copy<\/button>\n\t\tJson\n{\n  &#8220;destination&#8221;: &#8220;{{webhook destination}}&#8221;,\n  &#8220;timestamp&#8221;: 1688389559898,\n  &#8220;event_timestamp&#8221;: 1688389559898,\n  &#8220;transaction_id&#8221;: &#8220;{{transaction_id}}&#8221;,\n  &#8220;object_id&#8221;: &#8220;{{vas_uuid}}&#8221;,\n  &#8220;flow&#8221;: &#8220;vas_lifecycle&#8221;,\n  &#8220;data&#8221;: {\n    &#8220;promotion_code&#8221;: &#8220;{{promotion code}}&#8221;,\n    &#8220;advert_uuid&#8221;: &#8220;{{advert_uuid}}&#8221;,\n    &#8220;status&#8221;: &#8220;expired&#8221;,\n    &#8220;custom_fields&#8221;: {\n      &#8220;url&#8221;: &#8220;{{ad url}}&#8221;\n    },\n    &#8220;duration&#8221;: &#8220;{{duration}}&#8221;,\n    &#8220;expires_at&#8221;: &#8220;2023-07-25T14:11:48Z&#8221;,\n    &#8220;updated_at&#8221;: &#8220;2023-07-25T22:45:01.679Z&#8221;,\n    &#8220;created_at&#8221;: &#8220;2023-07-24T14:11:49.589Z&#8221;\n  },\n  &#8220;event_type&#8221;: &#8220;advert_vas_expired&#8221;\n}\n\t\tCopied to clipboard\n\t<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">transaction_id<\/code><\/td>\n<td>Transaction id uniquely identifies this request.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">object_id<\/code><\/td>\n<td>The <strong>object_id<\/strong> is the identifier for the VAS\/Promotion. It is the promotion unique id, and it corresponds to <strong>vas_uuid<\/strong>\u00a0in other requests.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">promotion_code<\/code><\/td>\n<td>Code\/name of the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">advert_uuid<\/code><\/td>\n<td>Advert id to which you applied the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">status<\/code><\/td>\n<td><strong>&#8220;status&#8221;: &#8220;expired&#8221;<\/strong>\u00a0means that the promotion expired as it reached the expiration date. Read more about the available <a href=\"https:\/\/developer.olxgroup.com\/docs\/promotion-status\" target=\"_self\" rel=\"noopener\">Promotion Status<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">custom_fields<\/code><\/td>\n<td>Additional fields such as <strong>url<\/strong>, <strong>olx_url<\/strong>, etc. Specific to each promotion. Read more the existing\u00a0<a href=\"https:\/\/developer.olxgroup.com\/docs\/promotion-custom-fields\" target=\"_self\" rel=\"noopener\">Custom Fields<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">duration<\/code><\/td>\n<td>Promotion duration. Usually days, but depends on the specific <strong>promotion_code<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">expires_at<\/code><\/td>\n<td>When the Promotion expires (RFC3339 format).<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">created_at<\/code><\/td>\n<td>When the Promotion was first created (RFC3339 format).<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">updated_at<\/code><\/td>\n<td>When the Promotion was last updated (RFC3339 format).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\t<p><strong>advert_vas_removed<\/strong><\/p>\n\t<p>This notification is emitted when the promotion was removed in marketplace. Currently it is only supported by OLX VAS.<\/p>\n\t\n\t\t<code>Json\n{\n  \"destination\": \"{{webhook destination}}\",\n  \"timestamp\": 1572969379247,\n  \"event_timestamp\": 1572969379671,\n  \"transaction_id\": \"{{transaction_id}}\",\n  \"object_id\": \"{{vas_uuid}}\",\n  \"flow\": \"vas_lifecycle\",\n  \"data\": {\n    \"promotion_code\": \"{{promotion code}}\",\n    \"advert_uuid\": \"{{advert_uuid}}\",\n    \"status\": \"removed\",\n    \"custom_fields\": {\n      \"url\": \"{{ad url}}\"\n    },\n    \"duration\": \"{{duration}}\",\n    \"expires_at\": \"2023-07-25T14:11:48Z\",\n    \"updated_at\": \"2023-07-25T22:45:01.679Z\",\n    \"created_at\": \"2023-07-24T14:11:49.589Z\"\n  },\n  \"event_type\": \"advert_vas_removed\"\n}\t\t\t<\/code>\n\t\t\n\t\t<button onclick=\"copyJson('copy_35085')\">Copy<\/button>\n\t\tJson\n{\n  &#8220;destination&#8221;: &#8220;{{webhook destination}}&#8221;,\n  &#8220;timestamp&#8221;: 1572969379247,\n  &#8220;event_timestamp&#8221;: 1572969379671,\n  &#8220;transaction_id&#8221;: &#8220;{{transaction_id}}&#8221;,\n  &#8220;object_id&#8221;: &#8220;{{vas_uuid}}&#8221;,\n  &#8220;flow&#8221;: &#8220;vas_lifecycle&#8221;,\n  &#8220;data&#8221;: {\n    &#8220;promotion_code&#8221;: &#8220;{{promotion code}}&#8221;,\n    &#8220;advert_uuid&#8221;: &#8220;{{advert_uuid}}&#8221;,\n    &#8220;status&#8221;: &#8220;removed&#8221;,\n    &#8220;custom_fields&#8221;: {\n      &#8220;url&#8221;: &#8220;{{ad url}}&#8221;\n    },\n    &#8220;duration&#8221;: &#8220;{{duration}}&#8221;,\n    &#8220;expires_at&#8221;: &#8220;2023-07-25T14:11:48Z&#8221;,\n    &#8220;updated_at&#8221;: &#8220;2023-07-25T22:45:01.679Z&#8221;,\n    &#8220;created_at&#8221;: &#8220;2023-07-24T14:11:49.589Z&#8221;\n  },\n  &#8220;event_type&#8221;: &#8220;advert_vas_removed&#8221;\n}\n\t\tCopied to clipboard\n\t<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">transaction_id<\/code><\/td>\n<td>Transaction id uniquely identifies this request.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">object_id<\/code><\/td>\n<td>The <strong>object_id<\/strong> is the identifier for the VAS\/Promotion. It is the promotion unique id, and it corresponds to <strong>vas_uuid<\/strong>\u00a0\u00a0in other requests.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">promotion_code<\/code><\/td>\n<td>Code\/name of the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">advert_uuid<\/code><\/td>\n<td>Advert id to which you applied the promotion.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">status<\/code><\/td>\n<td><strong>&#8220;status&#8221;: &#8220;removed&#8221;<\/strong>\u00a0means that the promotion was removed because the ad was removed\/deactivated (only for OLX promotion). Read more about the available <a href=\"https:\/\/developer.olxgroup.com\/docs\/promotion-status\" target=\"_self\" rel=\"noopener\">Promotion Status<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">custom_fields<\/code><\/td>\n<td>Additional fields such as <strong>url<\/strong>, <strong>olx_url<\/strong>, etc. Specific to each promotion. Read more the existing\u00a0<a href=\"https:\/\/developer.olxgroup.com\/docs\/promotion-custom-fields\" target=\"_self\" rel=\"noopener\">Custom Fields<\/a>.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">duration<\/code><\/td>\n<td>Promotion duration. Usually days, but depends on the specific <strong>promotion_code<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">expires_at<\/code><\/td>\n<td>When the Promotion expires (RFC3339 format).<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">created_at<\/code><\/td>\n<td>When the Promotion was first created (RFC3339 format).<\/td>\n<\/tr>\n<tr>\n<td><code tabindex=\"0\" data-lang=\"\">updated_at<\/code><\/td>\n<td>When the Promotion was last updated (RFC3339 format).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n","protected":false},"excerpt":{"rendered":"<p>VAS Lifecycle VAS (Value-Added Services) Lifecycle Event Flow Event flow name : vas_lifecycle This event flow contains events related to\u00a0lifecycle of VAS, also known as value-added services or promotions. \u2757\ufe0fThe previous system for managing promotions and notifications is deprecated and this page has been updated with the newest information. Please refer to the\u00a0Applying Promotions\u00a0page to&#8230;  <a href=\"https:\/\/doc.olxgroup.com\/api\/?p=706\" title=\"Read VAS Lifecycle\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts\/706"}],"collection":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=706"}],"version-history":[{"count":0,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts\/706\/revisions"}],"wp:attachment":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}