VAS Lifecycle

VAS (Value-Added Services) Lifecycle Event Flow

Event flow name : vas_lifecycle

This event flow contains events related to lifecycle of VAS, also known as value-added services or promotions.

❗️

The previous system for managing promotions and notifications is deprecated and this page has been updated with the newest information. Please refer to the Applying Promotions page to get started.

There are 4 available events in this flow:

Event TypeDescription
advert_vas_applied_successThe event is triggered when a VAS was applied to an advert.
advert_vas_applied_errorThe event is triggered when there's an error when you try to apply the VAS.
advert_vas_expiredThe event is triggered when an active VAS expires.
advert_vas_removedThe event is triggered when an active VAS is removed.

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.

advert_vas_applied_success

This notification is emitted when the VAS was successfully applied in the marketplace.

{  
  "destination": "{{webhook destination}}",  
  "timestamp": 1688389559898,  
  "event_timestamp": 1688389559898,  
  "transaction_id": "{{transaction_id}}",  
  "object_id": "{{vas_uuid}}",  
  "flow": "vas_lifecycle",  
  "data": {  
      "promotion_code": "{{promotion code}}",
      "advert_uuid": "{{advert_uuid}}",
      "status": "applied",  
      "custom_fields": {  
        "url": "{{ad url}}"  
      },
      "duration": "{{duration}}",
      "expires_at": "2023-07-07T13:05:59Z",  
      "created_at": "2023-07-03T13:05:24.345Z",  
      "updated_at": "2023-07-03T13:05:59.832Z"  
  },  
  "event_type": "advert_vas_applied_success"  
}
FieldDescription
transaction_idTransaction id uniquely identifies this request.
object_idThe object_id is the identifier for the VAS/Promotion. It is the promotion unique id, and it corresponds to vas_uuid in other requests.
promotion_codeCode/name of the promotion.
advert_uuidAdvert id to which you applied the promotion.
status"status": "applied" means the promotion was successfully applied. Read more about the available Promotion Status.
custom_fieldsAdditional fields such as url, olx_url, etc. Specific to each promotion. Read more the existing Custom Fields.
durationPromotion duration. Usually days, but depends on the specific promotion_code.
expires_atWhen the Promotion expires (RFC3339 format).
created_atWhen the Promotion was first created (RFC3339 format).
updated_atWhen the Promotion was last updated (RFC3339 format).

advert_vas_applied_error

This notification is emitted when there was an error while applying the VAS in the marketplace.

Check here VAS errors, and suggestions of solutions.

{
  "destination": "{{webhook destination}}",
  "timestamp": 1688392214800,
  "event_timestamp": 1688392214800,
  "transaction_id": "{{transaction_id}}",
  "object_id": "{{vas_uuid}}",
  "flow": "publish_vas",
  "error_message": "Advert status doesn't allow this promotion.",
  "data": {
    "detail": "Advert status doesn't allow this promotion.",
    "title": "BadRequestException"
  },
  "event_type": "advert_vas_applied_error"
}
FieldDescription
error_messageError describes why the promotion was not successfully applied.
titleA high-level error title.
detailSame as error_message.

status, promotion_code and custom_fields are NOT displayed for the event_type advert_vas_applied_error.

advert_vas_expired

This notification is emitted when the promotion expired in marketplace as it reached the expiration date.

{
  "destination": "{{webhook destination}}",
  "timestamp": 1688389559898,
  "event_timestamp": 1688389559898,
  "transaction_id": "{{transaction_id}}",
  "object_id": "{{vas_uuid}}",
  "flow": "vas_lifecycle",
  "data": {
    "promotion_code": "{{promotion code}}",
    "advert_uuid": "{{advert_uuid}}",
    "status": "expired",
    "custom_fields": {
      "url": "{{ad url}}"
    },
    "duration": "{{duration}}",
    "expires_at": "2023-07-25T14:11:48Z",
    "updated_at": "2023-07-25T22:45:01.679Z",
    "created_at": "2023-07-24T14:11:49.589Z"
  },
  "event_type": "advert_vas_expired"
}
FieldDescription
transaction_idTransaction id uniquely identifies this request.
object_idThe object_id is the identifier for the VAS/Promotion. It is the promotion unique id, and it corresponds to vas_uuid in other requests.
promotion_codeCode/name of the promotion.
advert_uuidAdvert id to which you applied the promotion.
status"status": "expired" means that the promotion expired as it reached the expiration date. Read more about the available Promotion Status.
custom_fieldsAdditional fields such as url, olx_url, etc. Specific to each promotion. Read more the existing Custom Fields.
durationPromotion duration. Usually days, but depends on the specific promotion_code.
expires_atWhen the Promotion expires (RFC3339 format).
created_atWhen the Promotion was first created (RFC3339 format).
updated_atWhen the Promotion was last updated (RFC3339 format).

advert_vas_removed

This notification is emitted when the promotion was removed in marketplace. Currently it is only supported by OLX VAS.

{
  "destination": "{{webhook destination}}",
  "timestamp": 1572969379247,
  "event_timestamp": 1572969379671,
  "transaction_id": "{{transaction_id}}",
  "object_id": "{{vas_uuid}}",
  "flow": "vas_lifecycle",
  "data": {
    "promotion_code": "{{promotion code}}",
    "advert_uuid": "{{advert_uuid}}",
    "status": "removed",
    "custom_fields": {
      "url": "{{ad url}}"
    },
    "duration": "{{duration}}",
    "expires_at": "2023-07-25T14:11:48Z",
    "updated_at": "2023-07-25T22:45:01.679Z",
    "created_at": "2023-07-24T14:11:49.589Z"
  },
  "event_type": "advert_vas_removed"
}
FieldDescription
transaction_idTransaction id uniquely identifies this request.
object_idThe object_id is the identifier for the VAS/Promotion. It is the promotion unique id, and it corresponds to vas_uuid in other requests.
promotion_codeCode/name of the promotion.
advert_uuidAdvert id to which you applied the promotion.
status"status": "removed" means that the promotion was removed because the ad was removed/deactivated (only for OLX promotion). Read more about the available Promotion Status.
custom_fieldsAdditional fields such as url, olx_url, etc. Specific to each promotion. Read more the existing Custom Fields.
durationPromotion duration. Usually days, but depends on the specific promotion_code.
expires_atWhen the Promotion expires (RFC3339 format).
created_atWhen the Promotion was first created (RFC3339 format).
updated_atWhen the Promotion was last updated (RFC3339 format).