v1

latestOpenAPI 3.0.1MIT2026-07-263151,3912.3 MB
Redemptions

Rollback Redemption

Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. This endpoint rolls back only single redemptions, meaning those that are not stacked. Stacked redemptions belong to a parent redemption. To roll back a parent redemption, including all of its individual redemptions, use the POST Rollback Stackable Redemptions

🚧 You can roll back a redemption up to 3 months back.

Effect

The operation

  • creates a rollback entry in voucher's redemption history (redemption.redemption_entries) and
  • gives 1 redemption back to the pool (decreases redeemed_quantity by 1).

Returned funds

In case of gift card vouchers, this method returns funds back according to the source redemption. In case of loyalty card vouchers, this method returns points back according to the source redemption.

post/v1/redemptions/{redemptionId}/rollback

Query parameters

reasonstring

Reason for the rollback.

tracking_idstring

Customer's source_id.

Request body

reasonstring

Reason for the rollback.

tracking_idstring

Customer's source_id.

metadataobject

A set of key/value pairs that you can send in the request body to update redemption metadata.

Response

Returns a redemption rollback object indicating the result of the rollback.

idstring required

Unique identifier of the redemption rollback.

object'redemption_rollback' required

The type of the object represented by the JSON

datestring date-time required

Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.

customer_idstring nullable required

Unique customer ID of the redeeming customer.

tracking_idstring nullable required

Hashed customer source ID.

metadataobject nullable required

The metadata object stores all custom attributes assigned to the redemption.

amountinteger

For gift cards, this represents the number of the credits restored to the card in the rolledback redemption. The number is a negative integer in the smallest currency unit, e.g. -100 cents for $1.00 added back to the card. For loyalty cards, this represents the number of loyalty points restored to the card in the rolledback redemption. The number is a negative integer.

redemptionstring nullable required

Unique redemption ID of the parent redemption.

reasonstring

System generated cause for the redemption being invalid in the context of the provided parameters.

result'SUCCESS' | 'FAILURE' required

Redemption result.

status'SUCCEEDED' | 'FAILED' required

Redemption status.

failure_codestring

If the result is FAILURE, this parameter will provide a generic reason as to why the redemption failed.

failure_messagestring

If the result is FAILURE, this parameter will provide a more expanded reason as to why the redemption failed.

related_object_type'voucher' | 'promotion_tier' | 'redemption' required

Defines the related object.

related_object_idstring required

Unique identifier of the related object. It is assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.

Example response

{
  "id": "rr_0efeb3dab05e62e599",
  "date": "2021-12-22T10:13:06.487Z",
  "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64",
  "amount": -10000,
  "redemption": "r_0c656311b5878a2031",
  "failure_code": "customer_rules_violated",
  "order": {
    "created_at": "2021-12-22T10:13:06.487Z",
    "updated_at": "2021-12-22T10:14:45.316Z",
    "customer_id": "cust_7iUa6ICKyU6gH40dBU25kQU1",
    "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix"
  },
  "channel": {
    "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH"
  },
  "voucher": {
    "id": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV",
    "code": "WVPblOYX",
    "campaign": "Gift Card Campaign",
    "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV",
    "category_id": "cat_0bb343dee3cdb5ec0c",
    "gift": {
      "amount": 10000,
      "balance": 500
    },
    "loyalty_card": {
      "points": 7000,
      "balance": 6970,
      "next_expiration_date": "2023-05-30"
    },
    "start_date": "2021-12-01T00:00:00.000Z",
    "expiration_date": "2021-12-31T00:00:00.000Z",
    "validity_timeframe": {
      "duration": "PT1H",
      "interval": "P2D"
    },
    "validity_hours": {
      "daily": [
        {
          "start_time": "12:00",
          "expiration_time": "14:00"
        }
      ]
    },
    "assets": {
      "qr": {
        "id": "U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==",
        "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D"
      },
      "barcode": {
        "id": "U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==",
        "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D"
      }
    },
    "created_at": "2021-12-22T10:13:06.487Z",
    "updated_at": "2021-12-22T10:14:45.316Z",
    "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4",
    "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv",
    "publish": {
      "url": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10"
    },
    "redemption": {
      "redeemed_quantity": 1,
      "redeemed_points": 100000,
      "url": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10"
    },
    "categories": [
      {
        "created_at": "2022-07-14T10:45:13.156Z",
        "updated_at": "2022-08-16T10:52:08.094Z"
      }
    ],
    "validation_rules_assignments": {
      "data": [
        {
          "id": "asgm_LnY1g7UNFA9KyDrD",
          "rule_id": "val_3gPNA6SnH4ae",
          "related_object_id": "camp_CZOnEGiZfwIKWmSjhIoIT7Ol",
          "related_object_type": "campaign",
          "object": "validation_rules_assignment",
          "validation_status": "PARTIALLY_VALID",
          "validation_omitted_rules": [
            "1"
          ]
        }
      ]
    }
  },
  "promotion_tier": {
    "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p",
    "created_at": "2021-12-15T11:34:01.333Z",
    "updated_at": "2022-02-09T09:20:05.603Z",
    "campaign": {
      "start_date": "2022-09-22T00:00:00.000Z",
      "expiration_date": "2022-09-30T00:00:00.000Z",
      "validity_timeframe": {
        "duration": "PT1H",
        "interval": "P2D"
      },
      "validity_hours": {
        "daily": [
          {
            "start_time": "12:00",
            "expiration_time": "14:00"
          }
        ]
      },
      "category_id": "cat_0b688929a2476386a6"
    },
    "start_date": "2022-09-23T00:00:00.000Z",
    "expiration_date": "2022-09-26T00:00:00.000Z",
    "validity_timeframe": {
      "duration": "PT1H",
      "interval": "P2D"
    },
    "validity_hours": {
      "daily": [
        {
          "start_time": "12:00",
          "expiration_time": "14:00"
        }
      ]
    },
    "validation_rule_assignments": {
      "data": [
        {
          "id": "asgm_74F7QZoYbUoljwQO",
          "rule_id": "val_4j7DCRm2IS59",
          "related_object_id": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT",
          "created_at": "2022-02-17T08:18:15.085Z"
        }
      ]
    },
    "category_id": "cat_0c9da30e7116ba6bba",
    "categories": [
      {
        "created_at": "2022-07-14T10:45:13.156Z",
        "updated_at": "2022-08-16T10:52:08.094Z"
      }
    ]
  },
  "reward": {
    "voucher": {
      "id": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV",
      "code": "WVPblOYX",
      "campaign": "Gift Card Campaign",
      "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV",
      "category_id": "cat_0bb343dee3cdb5ec0c",
      "gift": {
        "amount": 10000,
        "balance": 500
      },
      "loyalty_card": {
        "points": 7000,
        "balance": 6970,
        "next_expiration_date": "2023-05-30"
      },
      "start_date": "2021-12-01T00:00:00.000Z",
      "expiration_date": "2021-12-31T00:00:00.000Z",
      "validity_timeframe": {
        "duration": "PT1H",
        "interval": "P2D"
      },
      "validity_hours": {
        "daily": [
          {
            "start_time": "12:00",
            "expiration_time": "14:00"
          }
        ]
      },
      "assets": {
        "qr": {
          "id": "U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==",
          "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D"
        },
        "barcode": {
          "id": "U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==",
          "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D"
        }
      },
      "created_at": "2021-12-22T10:13:06.487Z",
      "updated_at": "2021-12-22T10:14:45.316Z",
      "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4",
      "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv",
      "publish": {
        "url": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10"
      },
      "redemption": {
        "redeemed_quantity": 1,
        "redeemed_points": 100000,
        "url": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10"
      },
      "categories": [
        {
          "created_at": "2022-07-14T10:45:13.156Z",
          "updated_at": "2022-08-16T10:52:08.094Z"
        }
      ],
      "validation_rules_assignments": {
        "data": [
          {
            "id": "asgm_LnY1g7UNFA9KyDrD",
            "rule_id": "val_3gPNA6SnH4ae",
            "related_object_id": "camp_CZOnEGiZfwIKWmSjhIoIT7Ol",
            "related_object_type": "campaign",
            "object": "validation_rules_assignment",
            "validation_status": "PARTIALLY_VALID",
            "validation_omitted_rules": [
              "1"
            ]
          }
        ]
      }
    },
    "product": {
      "id": "prod_0b1da8105693710357",
      "source_id": "productSourceID16",
      "name": "T-shirt",
      "image_url": "https://images.com/original.jpg",
      "created_at": "2022-05-23T06:52:55.008Z",
      "updated_at": "2022-05-23T09:24:07.405Z",
      "skus": {
        "data": [
          {
            "id": "sku_0b1621b319d248b79f",
            "source_id": "sku_source_id_4",
            "product_id": "prod_0b15f6b9f650c16990",
            "sku": "Large Pink Shirt",
            "currency": "USD",
            "created_at": "2022-05-17T10:36:30.187Z",
            "updated_at": "2022-05-17T10:55:09.137Z"
          }
        ]
      }
    },
    "sku": {
      "id": "sku_0b1621b319d248b79f",
      "source_id": "sku_source_id_4",
      "product_id": "prod_0b15f6b9f650c16990",
      "sku": "Large Pink Shirt",
      "currency": "USD",
      "created_at": "2022-05-17T10:36:30.187Z",
      "updated_at": "2022-05-17T10:55:09.137Z"
    },
    "id": "rew_0bc92f81a6801f9bca",
    "name": "Reward Name",
    "created_at": "2021-12-22T10:13:06.487Z",
    "updated_at": "2022-10-03T12:24:58.008Z",
    "parameters": {
      "campaign": {
        "id": "camp_13BbZ0kQsNinhqsX3wUts2UP"
      },
      "product": {
        "id": "prod_0b7d7dfb05cbe5c616",
        "sku_id": "sku_0a41e31c7b41c28358"
      }
    }
  }
}