|\n| **CUSTOMERS** | |\n| CUSTOMERS.IMPORT_CSV | **POST** [/customers/importCSV](ref:import-customers-using-csv) |\n| CUSTOMERS.BULK_UPDATE | **POST** [/customers/bulk/async](ref:update-customers-in-bulk) |\n| CUSTOMERS.METADATA_UPDATE | **POST** [/customers/metadata/async](ref:update-customers-metadata-in-bulk) |\n| **PRODUCTS** | |\n| PRODUCTS.BULK_UPDATE | **POST** [/products/bulk/async](ref:update-products-in-bulk)
|\n| PRODUCTS.METADATA_UPDATE | **POST** [/products/metadata/async](ref:update-products-metadata-in-bulk) |\n| PRODUCTS.IMPORT_CSV | **POST** [/products/importCSV](ref:import-products-using-csv) |\n| SKUS.IMPORT_CSV | **POST** [/skus/importCSV](ref:import-skus-using-csv) |\n| **VOUCHERS** | |\n| VOUCHERS.IMPORT | **POST** [/vouchers/import](ref:import-vouchers) |\n| VOUCHERS.IMPORT_CSV | **POST** [/vouchers/importCSV](ref:import-vouchers-using-csv) |\n| VOUCHERS.BULK_UPDATE | **POST** [/vouchers/bulk/async](ref:update-vouchers-in-bulk)
|\n| VOUCHERS.METADATA_UPDATE | **POST** [/vouchers/metadata/async](ref:update-vouchers-metadata-in-bulk) | \n| **ORDERS** | |\n| ORDERS.IMPORT | **POST** [/orders/import](ref:import-orders) |\n| **METADATA KEY PURGE** | |\n| CAMPAIGNS.METADATA_KEY_PURGE
CUSTOMERS.METADATA_KEY_PURGE
PRODUCTS.METADATA_KEY_PURGE
VOUCHERS.METADATA_KEY_PURGE
ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](https://support.voucherify.io/article/99-schema-validation-metadata#maintenance) |",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns detailed information about the async action result.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/17_obj_async_action_object"
},
- "400": {
- "description": "Returns an error if an invalid payload is provided.",
- "content": {
- "application/json": {
- "schema": {
- "anyOf": [
+ "examples": {
+ "CAMPAIGN.VOUCHERS_IMPORT": {
+ "value": {
+ "id": "aa_0af9b22296cf473a10",
+ "type": "CAMPAIGN.VOUCHERS_IMPORT",
+ "status": "DONE",
+ "result": {
+ "message": "0 voucher(s) imported successfully, 3 failed.",
+ "failed": [
+ {
+ "code": "CODE9",
+ "reason": "unit: must be a number, property is required (actual value is 'EUR')"
+ },
{
- "$ref": "#/components/schemas/e_400_invalid_payload"
+ "code": "CODE8",
+ "reason": "unit: must be a number, property is required (actual value is 'EUR')"
},
{
- "$ref": "#/components/schemas/e_400_invalid_export_fields"
+ "code": "CODE7",
+ "reason": "unit: must be a number, property is required (actual value is 'EUR')"
}
- ]
+ ],
+ "done_count": 0,
+ "failed_count": 3
+ },
+ "created_at": "2023-01-20T07:23:43.289Z",
+ "updated_at": "2023-01-20T07:23:44.044Z",
+ "request_id": "v-0c553fdb325688d510",
+ "progress": 100,
+ "processing_time": 755,
+ "object": "async_action"
+ }
+ },
+ "CAMPAIGN.VOUCHERS_IMPORT_CSV": {
+ "value": {
+ "id": "aa_0c5543f00797b6113f",
+ "type": "CUSTOMERS.IMPORT_CSV",
+ "status": "DONE",
+ "result": {
+ "message": "0 customer(s) imported successfully, 2 failed.",
+ "failed": [
+ {
+ "source_id": "test-user@voucherify.io",
+ "row": 1,
+ "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'snap')"
+ },
+ {
+ "source_id": "",
+ "row": 2,
+ "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'insta')"
+ }
+ ],
+ "done_count": 0,
+ "failed_count": 2
+ },
+ "created_at": "2023-01-20T07:41:33.086Z",
+ "updated_at": "2023-01-20T07:41:33.216Z",
+ "request_id": "v-0c5543eff2cb0f547f",
+ "progress": 100,
+ "processing_time": 130,
+ "object": "async_action"
+ }
+ },
+ "CAMPAIGN.VOUCHERS_DELETE": {
+ "value": {
+ "id": "aa_0c553853d957b67bd4",
+ "type": "CAMPAIGN.VOUCHERS_DELETE",
+ "status": "DONE",
+ "result": {
+ "message": "Deleted 2 vouchers.",
+ "done_count": 2
+ },
+ "created_at": "2023-01-20T06:50:49.573Z",
+ "updated_at": "2023-01-20T06:50:50.053Z",
+ "request_id": "v-0c553853b5c418c826",
+ "progress": 100,
+ "processing_time": 480,
+ "object": "async_action"
+ }
+ },
+ "CAMPAIGN.VOUCHERS_UPDATE": {
+ "value": {
+ "id": "aa_0c5440c25c0e5728d0",
+ "type": "CAMPAIGN.VOUCHERS_UPDATE",
+ "status": "DONE",
+ "result": {
+ "message": "Updated 1 vouchers.",
+ "done_count": 1
+ },
+ "created_at": "2023-01-19T12:49:11.024Z",
+ "updated_at": "2023-01-19T12:49:11.852Z",
+ "request_id": "v-0c5440c24304189e44",
+ "progress": 100,
+ "processing_time": 828,
+ "object": "async_action"
+ }
+ },
+ "CAMPAIGN.VOUCHERS_GENERATE": {
+ "value": {
+ "id": "aa_0c54441d14d7b60014",
+ "type": "CAMPAIGN.VOUCHERS_GENERATE",
+ "status": "DONE",
+ "result": {
+ "message": "Generated 2 vouchers.",
+ "done_count": 2
+ },
+ "created_at": "2023-01-19T13:03:50.355Z",
+ "updated_at": "2023-01-19T13:03:51.030Z",
+ "request_id": "v-0c54441d0e4418b647",
+ "progress": 100,
+ "processing_time": 675,
+ "object": "async_action"
+ }
+ },
+ "CAMPAIGNS.METADATA_KEY_PURGE": {
+ "value": {
+ "id": "aa_0c554b22664a0eb5fc",
+ "type": "CAMPAIGNS.METADATA_KEY_PURGE",
+ "status": "DONE",
+ "result": {
+ "message": "Updated 0 campaigns.",
+ "done_count": 0
+ },
+ "created_at": "2023-01-20T08:12:59.673Z",
+ "updated_at": "2023-01-20T08:13:00.638Z",
+ "request_id": "w-0c554b225f8a0eb5fb",
+ "progress": 100,
+ "processing_time": 965,
+ "object": "async_action"
+ }
+ },
+ "CUSTOMERS.IMPORT_CSV": {
+ "value": {
+ "id": "aa_0c5543f00797b6113f",
+ "type": "CUSTOMERS.IMPORT_CSV",
+ "status": "DONE",
+ "result": {
+ "message": "0 customer(s) imported successfully, 2 failed.",
+ "failed": [
+ {
+ "source_id": "test-user@voucherify.io",
+ "row": 1,
+ "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'snap')"
+ },
+ {
+ "source_id": "",
+ "row": 2,
+ "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'insta')"
+ }
+ ],
+ "done_count": 0,
+ "failed_count": 2
+ },
+ "created_at": "2023-01-20T07:41:33.086Z",
+ "updated_at": "2023-01-20T07:41:33.216Z",
+ "request_id": "v-0c5543eff2cb0f547f",
+ "progress": 100,
+ "processing_time": 130,
+ "object": "async_action"
+ }
+ },
+ "CUSTOMERS.BULK_UPDATE": {
+ "value": {
+ "id": "aa_0c5547cc5e17b617b6",
+ "type": "CUSTOMERS.BULK_UPDATE",
+ "status": "DONE",
+ "result": {
+ "results": [
+ {
+ "source_id": "source_id_1",
+ "updated": true,
+ "found": true
+ },
+ {
+ "source_id": "source_id_2",
+ "updated": true,
+ "found": true
+ },
+ {
+ "source_id": "source_id_3",
+ "updated": true,
+ "found": true
+ }
+ ],
+ "done_count": 3
+ },
+ "created_at": "2023-01-20T07:58:25.144Z",
+ "updated_at": "2023-01-20T07:58:25.869Z",
+ "request_id": "v-0c5547cc4d8b0f5be4",
+ "progress": 100,
+ "processing_time": 725,
+ "object": "async_action"
+ }
+ },
+ "CUSTOMERS.METADATA_UPDATE": {
+ "value": {
+ "id": "aa_0c554a92030e576181",
+ "type": "CUSTOMERS.METADATA_UPDATE",
+ "status": "DONE",
+ "result": {
+ "results": [
+ {
+ "source_id": "source_1",
+ "updated": true,
+ "found": true
+ },
+ {
+ "source_id": "source_2",
+ "updated": true,
+ "found": true
+ }
+ ],
+ "done_count": 2
},
- "examples": {
- "Invalid Export Fields": {
- "value": {
- "code": 400,
- "key": "invalid_export_fields",
- "message": "Invalid Export",
- "details": "Unsupported field used. Allowed fields: id, object, date, voucher_code, campaign, promotion_tier_id, customer_id, customer_source_id, customer_name, tracking_id, order_amount, gift_amount, loyalty_points, result, failure_code, failure_message, metadata",
- "request_id": "v-0afdb603910a1a14e0"
+ "created_at": "2023-01-20T08:10:31.821Z",
+ "updated_at": "2023-01-20T08:10:32.564Z",
+ "request_id": "v-0c554a91fb4b0f61a2",
+ "progress": 100,
+ "processing_time": 743,
+ "object": "async_action"
+ }
+ },
+ "CUSTOMERS.METADATA_KEY_PURGE": {
+ "value": {
+ "id": "aa_0c5551f2ab0a0ebf0e",
+ "type": "CUSTOMERS.METADATA_KEY_PURGE",
+ "status": "DONE",
+ "result": {
+ "message": "Updated 0 customers.",
+ "done_count": 0
+ },
+ "created_at": "2023-01-20T08:42:45.804Z",
+ "updated_at": "2023-01-20T08:42:46.079Z",
+ "request_id": "w-0c5551f2a38a0ebf0d",
+ "progress": 100,
+ "processing_time": 275,
+ "object": "async_action"
+ }
+ },
+ "PRODUCTS.BULK_UPDATE": {
+ "value": {
+ "id": "aa_0c5553f0f457b6328e",
+ "type": "PRODUCTS.BULK_UPDATE",
+ "status": "DONE",
+ "result": {
+ "results": [
+ {
+ "source_id": "first_product",
+ "updated": false,
+ "found": true
+ },
+ {
+ "source_id": "second_product",
+ "updated": false,
+ "found": true
}
- },
- "Invalid Payload": {
- "value": {
- "code": 400,
- "key": "invalid_payload",
- "message": "Invalid payload",
- "details": "Property .exported_object should be equal to one of the allowed values [ voucher, redemption, customer, publication, order, points_expiration ]",
- "request_id": "v-0afdb5bd68d20bdb81"
+ ],
+ "done_count": 2
+ },
+ "created_at": "2023-01-20T08:51:28.337Z",
+ "updated_at": "2023-01-20T08:51:28.439Z",
+ "request_id": "v-0c5553f0e94b0f7502",
+ "progress": 100,
+ "processing_time": 102,
+ "object": "async_action"
+ }
+ },
+ "PRODUCTS.METADATA_UPDATE": {
+ "value": {
+ "id": "aa_0c5554869b97b633b4",
+ "type": "PRODUCTS.METADATA_UPDATE",
+ "status": "DONE",
+ "result": {
+ "results": [
+ {
+ "source_id": "123-567-3433",
+ "updated": false,
+ "found": true
+ },
+ {
+ "source_id": "test_volleyball",
+ "updated": false,
+ "found": true
}
- }
- }
+ ],
+ "done_count": 2
+ },
+ "created_at": "2023-01-20T08:54:01.582Z",
+ "updated_at": "2023-01-20T08:54:02.436Z",
+ "request_id": "v-0c55548694c418f9dd",
+ "progress": 100,
+ "processing_time": 854,
+ "object": "async_action"
}
- }
- }
- }
- },
- "get": {
- "operationId": "list-exports",
- "tags": [
- "EXPORTS API"
- ],
- "summary": "List Exports",
- "description": "List all exports. ",
- "parameters": [
- {
- "$ref": "#/components/parameters/limit"
- },
- {
- "$ref": "#/components/parameters/page"
- },
- {
- "schema": {
- "type": "string",
- "enum": [
- "created_at",
- "-created_at",
- "status",
- "-status"
- ]
},
- "in": "query",
- "name": "order",
- "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order."
- }
- ],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
- }
- ],
- "responses": {
- "200": {
- "description": "A dictionary with an exports property that contains an array of exports. Each entry in the array is a separate export object. The list will return the following types of exported objects: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\nThe `channel` parameter in the response body returns the channel that was used to generate the particular export. The `user_id` identifies the specific user who initiated the export through the Voucherify Dashboard; this `user_id` is returned when the channel value is `WEBSITE`.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/16_res_list_exports"
- },
- "examples": {
- "List Exports": {
- "value": {
- "object": "list",
- "data_ref": "exports",
- "exports": [
- {
- "id": "exp_323UOPsH42twhJVaDZXf4UNo",
- "object": "export",
- "created_at": "2022-08-04T09:11:25.208Z",
- "status": "DONE",
- "channel": "API",
- "exported_object": "order",
- "parameters": {
- "order": "-created_at",
- "fields": [
- "id",
- "source_id",
- "status"
- ],
- "filters": {
- "junction": "and"
- }
- },
- "result": {
- "url": "https://download.voucherify.io/v1/exports/exp_323UOPsH42twhJVaDZXf4UNo?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwXzMyM1VPUHNINDJ0d2hKVmFEWlhmNFVObyIsImlhdCI6MTY1OTYwNDI4NiwiZXhwIjoxNjU5NjA1MTg2fQ.IgFnKagyoQ7_O2tGswZxpegUMtllSbzMfPMX-_89W7o"
- },
- "user_id": null
- },
- {
- "id": "exp_sPQR0na2gU0pIVUKIz4wdQI9",
- "object": "export",
- "created_at": "2022-05-02T06:44:03.186Z",
- "status": "DONE",
- "channel": "API",
- "exported_object": "voucher",
- "parameters": {
- "order": "-created_at",
- "fields": [
- "id",
- "code",
- "voucher_type",
- "value"
- ],
- "filters": {
- "junction": "and"
- }
- },
- "result": {
- "url": "https://download.voucherify.io/v1/exports/exp_sPQR0na2gU0pIVUKIz4wdQI9?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwX3NQUVIwbmEyZ1UwcElWVUtJejR3ZFFJOSIsImlhdCI6MTY1MTQ3Mzg0NCwiZXhwIjoxNjUxNDc0NzQ0fQ.yNIQHcHMO-HSKYejtgNjRVh3cRa_JqnmhBXdnAX2vHQ"
- },
- "user_id": null
- },
- {
- "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf",
- "object": "export",
- "created_at": "2022-01-13T09:03:18.293Z",
- "status": "DONE",
- "channel": "API",
- "exported_object": "customer",
- "parameters": {
- "order": "",
- "fields": [
- "name",
- "id",
- "email",
- "source_id",
- "created_at"
- ],
- "filters": {
- "junction": "and"
- },
- "response_format": "CSV"
- },
- "result": {
- "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ"
- },
- "user_id": null
- }
- ],
- "total": 3
+ "PRODUCTS.METADATA_KEY_PURGE": {
+ "value": {
+ "id": "aa_0c5552d997ca0ec03a",
+ "type": "PRODUCTS.METADATA_KEY_PURGE",
+ "status": "DONE",
+ "result": {
+ "message": "Updated 2 products.",
+ "done_count": 2
+ },
+ "created_at": "2023-01-20T08:46:42.271Z",
+ "updated_at": "2023-01-20T08:46:43.240Z",
+ "request_id": "w-0c5552d98e8a0ec039",
+ "progress": 100,
+ "processing_time": 969,
+ "object": "async_action"
+ }
+ },
+ "VOUCHERS.IMPORT": {
+ "value": {
+ "id": "aa_0c5559be44d7b63c06",
+ "type": "VOUCHERS.IMPORT",
+ "status": "DONE",
+ "result": {
+ "message": "0 voucher(s) imported successfully, 3 failed.",
+ "failed": [
+ {
+ "code": "PROMO-CODE31",
+ "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')"
+ },
+ {
+ "code": "PROMO-CODE21",
+ "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')"
+ },
+ {
+ "code": "GIFT-CARD-100-1",
+ "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')"
}
- }
- }
+ ],
+ "done_count": 0,
+ "failed_count": 3
+ },
+ "created_at": "2023-01-20T09:16:49.299Z",
+ "updated_at": "2023-01-20T09:16:50.238Z",
+ "request_id": "v-0c5559be25c418824a",
+ "progress": 100,
+ "processing_time": 939,
+ "object": "async_action"
+ }
+ },
+ "VOUCHERS.IMPORT_CSV": {
+ "value": {
+ "id": "aa_0c555db3d697b643e1",
+ "type": "VOUCHERS.IMPORT_CSV",
+ "status": "DONE",
+ "result": {
+ "message": "0 voucher(s) imported successfully, 2 failed.",
+ "failed": [
+ {
+ "code": "FALL2023",
+ "row": 1,
+ "reason": "Voucher Type is required"
+ },
+ {
+ "code": "FALL2024",
+ "row": 2,
+ "reason": "Voucher Type is required"
+ }
+ ],
+ "done_count": 0,
+ "failed_count": 2
+ },
+ "created_at": "2023-01-20T09:34:07.194Z",
+ "updated_at": "2023-01-20T09:34:07.367Z",
+ "request_id": "v-0c555db3ba8b0f0767",
+ "progress": 100,
+ "processing_time": 173,
+ "object": "async_action"
+ }
+ },
+ "VOUCHERS.BULK_UPDATE": {
+ "value": {
+ "id": "aa_0c555e8115d7b64504",
+ "type": "VOUCHERS.BULK_UPDATE",
+ "status": "DONE",
+ "result": {
+ "results": [
+ {
+ "code": "PROMO-CODE81019",
+ "updated": false,
+ "found": false
+ },
+ {
+ "code": "PROMO-CODE7264786",
+ "updated": false,
+ "found": false
+ }
+ ],
+ "done_count": 2
+ },
+ "created_at": "2023-01-20T09:37:37.367Z",
+ "updated_at": "2023-01-20T09:37:37.520Z",
+ "request_id": "v-0c555e810904188aa4",
+ "progress": 100,
+ "processing_time": 153,
+ "object": "async_action"
+ }
+ },
+ "VOUCHERS.METADATA_UPDATE": {
+ "value": {
+ "id": "aa_0c555ed40857b6463a",
+ "type": "VOUCHERS.METADATA_UPDATE",
+ "status": "DONE",
+ "result": {
+ "results": [
+ {
+ "code": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u",
+ "updated": false,
+ "found": false
+ },
+ {
+ "code": "LOYALTY-CARD-xLPbpbXR",
+ "updated": false,
+ "found": false
+ }
+ ],
+ "done_count": 2
+ },
+ "created_at": "2023-01-20T09:39:02.305Z",
+ "updated_at": "2023-01-20T09:39:02.640Z",
+ "request_id": "v-0c555ed40084188b55",
+ "progress": 100,
+ "processing_time": 335,
+ "object": "async_action"
+ }
+ },
+ "VOUCHERS.METADATA_KEY_PURGE": {
+ "value": {
+ "id": "aa_0c55534bd64a0ec0e0",
+ "type": "VOUCHERS.METADATA_KEY_PURGE",
+ "status": "DONE",
+ "result": {
+ "message": "Updated 9 vouchers.",
+ "done_count": 9
+ },
+ "created_at": "2023-01-20T08:48:39.257Z",
+ "updated_at": "2023-01-20T08:48:40.503Z",
+ "request_id": "w-0c55534bcfca0ec0df",
+ "progress": 100,
+ "processing_time": 1246,
+ "object": "async_action"
+ }
+ },
+ "SKUS.IMPORT_CSV": {
+ "value": {
+ "id": "aa_0c5558728d0e577e67",
+ "type": "SKUS.IMPORT_CSV",
+ "status": "DONE",
+ "result": {
+ "message": "4 sku(s) imported successfully, 0 failed.",
+ "failed": [],
+ "done_count": 4,
+ "failed_count": 0
+ },
+ "created_at": "2023-01-20T09:11:09.620Z",
+ "updated_at": "2023-01-20T09:11:10.270Z",
+ "request_id": "v-0c5558726f0b0f7d82",
+ "progress": 100,
+ "processing_time": 650,
+ "object": "async_action"
+ }
+ },
+ "PRODUCTS.IMPORT_CSV": {
+ "value": {
+ "id": "aa_0c55578e914e577cf1",
+ "type": "PRODUCTS.IMPORT_CSV",
+ "status": "DONE",
+ "result": {
+ "message": "1 product(s) imported successfully, 1 failed.",
+ "failed": [
+ {
+ "row": 1,
+ "reason": "vendor: must be a string, property is required, must be equal to one of Vendor 1,Vendor 2 (actual value is 'Vendor 3')"
+ }
+ ],
+ "done_count": 1,
+ "failed_count": 1
+ },
+ "created_at": "2023-01-20T09:07:16.165Z",
+ "updated_at": "2023-01-20T09:07:17.025Z",
+ "request_id": "v-0c55578e7a0418fef5",
+ "progress": 100,
+ "processing_time": 860,
+ "object": "async_action"
+ }
+ },
+ "ORDERS.METADATA_KEY_PURGE": {
+ "value": {
+ "id": "aa_0c555fda50472c83a8",
+ "type": "ORDERS.METADATA_KEY_PURGE",
+ "status": "DONE",
+ "result": {
+ "message": "Updated 1 orders.",
+ "done_count": 1
+ },
+ "created_at": "2023-01-20T09:43:30.881Z",
+ "updated_at": "2023-01-20T09:43:31.217Z",
+ "request_id": "w-0c555fda45c72c83a7",
+ "progress": 100,
+ "processing_time": 336,
+ "object": "async_action"
+ }
+ },
+ "ORDERS.IMPORT": {
+ "value": {
+ "id": "aa_0c5564b67d0e571534",
+ "type": "ORDERS.IMPORT",
+ "status": "DONE",
+ "result": {
+ "message": "1 order(s) imported successfully, 1 failed.",
+ "failed": [
+ {
+ "source_id": null,
+ "reason": "Internal error"
+ }
+ ],
+ "done_count": 1,
+ "failed_count": 1
+ },
+ "created_at": "2023-01-20T10:04:44.916Z",
+ "updated_at": "2023-01-20T10:04:46.102Z",
+ "request_id": "v-0c5564b6688b0f155d",
+ "progress": 100,
+ "processing_time": 1186,
+ "object": "async_action"
}
}
}
}
}
},
- "/v1/exports/{exportId}": {
- "parameters": [
- {
+ "404": {
+ "description": "Returns an error indicating that the async action with given ID was not found.",
+ "content": {
+ "application/json": {
"schema": {
- "type": "string",
- "example": "exp_2bYLdY2lQ2886wmYIHyeBWUZ"
+ "$ref": "#/components/schemas/e_404_not_found"
},
- "name": "exportId",
- "in": "path",
- "required": true,
- "description": "Unique export object ID of previously created export. This object can be a: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`."
+ "examples": {
+ "Async-Action-Not-Found": {
+ "value": {
+ "code": 404,
+ "key": "not_found",
+ "message": "Resource not found",
+ "details": "Cannot find async_action with id aa_0aeb82bd55d5beffb",
+ "request_id": "v-0aeb88df54c82af560",
+ "resource_id": "aa_0aeb82bd55d5beffb",
+ "resource_type": "async_action"
+ }
+ }
+ }
}
- ],
- "get": {
- "operationId": "get-export",
- "tags": [
- "EXPORTS API"
- ],
- "summary": "Get Export",
- "description": "Retrieves the URL of the downloadable file, which was generated via the [Create Export](ref:create-export) method.",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
+ }
+ }
+ }
+ }
+ },
+ "/v1/export-object": {
+ "get": {
+ "operationId": "export-object",
+ "tags": [
+ "EXPORTS API"
+ ],
+ "summary": "Export Object",
+ "description": "Data model description",
+ "responses": {
+ "200": {
+ "description": "Export Object",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/16_obj_export_object"
}
- ],
- "responses": {
- "200": {
- "description": "Returns the export object if a valid identifier was provided in the path.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/16_obj_export_object"
- },
- "examples": {
- "Get Export": {
- "value": {
- "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf",
- "object": "export",
- "created_at": "2022-01-13T09:03:18.293Z",
- "status": "DONE",
- "channel": "API",
- "exported_object": "customer",
- "parameters": {
- "order": "",
- "fields": [
- "name",
- "id",
- "email",
- "source_id",
- "created_at"
- ],
- "filters": {
- "junction": "and"
- },
- "response_format": "CSV"
- },
- "result": {
- "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ"
- },
- "user_id": null
- }
- }
- }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/exports": {
+ "post": {
+ "operationId": "create-export",
+ "tags": [
+ "EXPORTS API"
+ ],
+ "summary": "Create Export",
+ "description": "Create export object. The export can be any of the following types: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\n## Defaults\n\nIf you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object:\n\n| **Export Object** | **Default fields returned** |\n|:---|:---|\n| order | `id`, `source_id`, `status` |\n| voucher | `code`, `voucher_type`, `value`, `discount_type` |\n| publication | `code`, `customer_id`, `date`, `channel` |\n| redemption | `id`, `object`, `voucher_code`, `customer_id`, `date`, `result` |\n| customer | `name`, `source_id` |\n| points_expiration | `id`, `campaign_id`, `voucher_id`, `status`, `expires_at`, `points` |\n| voucher_transactions | `id`, `type`, `source_id`, `status`, `reason`, `source`, `balance`, `amount`, `created_at` |\n\n\n## Fetching particular data sets\n\nUsing the `parameters` body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n## Orders \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Order metadata; expressed as metadata.X, where X is the name of the custom metadata property. | 1 |\n\n## Vouchers \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
`GIFT_VOUCHER`: amount left to spend
`LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| metadata | Custom voucher metadata. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of `P2D` will be active every other day. | P2D |\n| validity_timeframe_duration | Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of `PT1H` will be valid for a duration of one hour. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n\n\n## Publications\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Custom publication metadata. | |\n\n## Redemptions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Custom redemption metadata. | |\n\n## Customers\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | 2000 |\n| loyalty_referred_customers | How many customers were referred by this customer. | 3 |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| metadata | Customer metadata. | All metadata fields defined in Metadata Schema for the Customer object. |\n| birthdate | Customer's birthdate. | 2022-01-01 |\n\n## Points Expirations\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |\n\n ## Gift Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n\n ## Loyalty Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "requestBody": {
+ "description": "Specify the details of the export that you would like to create.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/16_req_create_export_POST"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Returns export object and URL of CSV file.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/16_obj_export_object"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Returns an error if an invalid payload is provided.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/e_400_invalid_payload"
+ },
+ {
+ "$ref": "#/components/schemas/e_400_invalid_export_fields"
}
- }
+ ]
},
- "404": {
- "description": "Returns an error indicating that the export with given ID was not found if an incorrect ID is provided in the path.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/e_404_not_found"
- },
- "examples": {
- "Not Found": {
- "value": {
- "code": 404,
- "key": "not_found",
- "message": "Resource not found",
- "details": "Cannot find export with id exp_8fNoLwgVPuhoxNzVsr50kq0",
- "request_id": "v-0b029305af4524cf42",
- "resource_id": "exp_8fNoLwgVPuhoxNzVsr50kq0",
- "resource_type": "export"
- }
- }
- }
+ "examples": {
+ "Invalid Export Fields": {
+ "value": {
+ "code": 400,
+ "key": "invalid_export_fields",
+ "message": "Invalid Export",
+ "details": "Unsupported field used. Allowed fields: id, object, date, voucher_code, campaign, promotion_tier_id, customer_id, customer_source_id, customer_name, tracking_id, order_amount, gift_amount, loyalty_points, result, failure_code, failure_message, metadata",
+ "request_id": "v-0afdb603910a1a14e0"
+ }
+ },
+ "Invalid Payload": {
+ "value": {
+ "code": 400,
+ "key": "invalid_payload",
+ "message": "Invalid payload",
+ "details": "Property .exported_object should be equal to one of the allowed values [ voucher, redemption, customer, publication, order, points_expiration ]",
+ "request_id": "v-0afdb5bd68d20bdb81"
}
}
}
}
+ }
+ }
+ }
+ },
+ "get": {
+ "operationId": "list-exports",
+ "tags": [
+ "EXPORTS API"
+ ],
+ "summary": "List Exports",
+ "description": "List all exports. ",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/limit"
+ },
+ {
+ "$ref": "#/components/parameters/page"
+ },
+ {
+ "schema": {
+ "type": "string",
+ "enum": [
+ "created_at",
+ "-created_at",
+ "status",
+ "-status"
+ ]
},
- "delete": {
- "operationId": "delete-export",
- "tags": [
- "EXPORTS API"
- ],
- "summary": "Delete Export",
- "description": "This method deletes a previously created export object.",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
- }
- ],
- "responses": {
- "204": {
- "description": "Returns no content if deletion is successful."
- },
- "404": {
- "description": "Returns an error indicating that the export with given ID was not found.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/e_404_not_found"
- },
- "examples": {
- "Export Not Found": {
- "value": {
- "code": 404,
- "key": "not_found",
- "message": "Resource not found",
- "details": "Cannot find export with id exp_2bYLdY2lQ2886wmYIHyeBWUZ",
- "request_id": "v-0ae2a97a399027d719",
- "resource_id": "exp_2bYLdY2lQ2886wmYIHyeBWUZ",
- "resource_type": "export"
- }
+ "in": "query",
+ "name": "order",
+ "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order."
+ }
+ ],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "A dictionary with an exports property that contains an array of exports. Each entry in the array is a separate export object. The list will return the following types of exported objects: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\nThe `channel` parameter in the response body returns the channel that was used to generate the particular export. The `user_id` identifies the specific user who initiated the export through the Voucherify Dashboard; this `user_id` is returned when the channel value is `WEBSITE`.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/16_res_list_exports"
+ },
+ "examples": {
+ "List Exports": {
+ "value": {
+ "object": "list",
+ "data_ref": "exports",
+ "exports": [
+ {
+ "id": "exp_323UOPsH42twhJVaDZXf4UNo",
+ "object": "export",
+ "created_at": "2022-08-04T09:11:25.208Z",
+ "status": "DONE",
+ "channel": "API",
+ "exported_object": "order",
+ "parameters": {
+ "order": "-created_at",
+ "fields": [
+ "id",
+ "source_id",
+ "status"
+ ],
+ "filters": {
+ "junction": "and"
+ }
+ },
+ "result": {
+ "url": "https://download.voucherify.io/v1/exports/exp_323UOPsH42twhJVaDZXf4UNo?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwXzMyM1VPUHNINDJ0d2hKVmFEWlhmNFVObyIsImlhdCI6MTY1OTYwNDI4NiwiZXhwIjoxNjU5NjA1MTg2fQ.IgFnKagyoQ7_O2tGswZxpegUMtllSbzMfPMX-_89W7o"
+ },
+ "user_id": null
+ },
+ {
+ "id": "exp_sPQR0na2gU0pIVUKIz4wdQI9",
+ "object": "export",
+ "created_at": "2022-05-02T06:44:03.186Z",
+ "status": "DONE",
+ "channel": "API",
+ "exported_object": "voucher",
+ "parameters": {
+ "order": "-created_at",
+ "fields": [
+ "id",
+ "code",
+ "voucher_type",
+ "value"
+ ],
+ "filters": {
+ "junction": "and"
+ }
+ },
+ "result": {
+ "url": "https://download.voucherify.io/v1/exports/exp_sPQR0na2gU0pIVUKIz4wdQI9?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwX3NQUVIwbmEyZ1UwcElWVUtJejR3ZFFJOSIsImlhdCI6MTY1MTQ3Mzg0NCwiZXhwIjoxNjUxNDc0NzQ0fQ.yNIQHcHMO-HSKYejtgNjRVh3cRa_JqnmhBXdnAX2vHQ"
+ },
+ "user_id": null
+ },
+ {
+ "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf",
+ "object": "export",
+ "created_at": "2022-01-13T09:03:18.293Z",
+ "status": "DONE",
+ "channel": "API",
+ "exported_object": "customer",
+ "parameters": {
+ "order": "",
+ "fields": [
+ "name",
+ "id",
+ "email",
+ "source_id",
+ "created_at"
+ ],
+ "filters": {
+ "junction": "and"
+ },
+ "response_format": "CSV"
+ },
+ "result": {
+ "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ"
+ },
+ "user_id": null
}
- }
+ ],
+ "total": 3
}
}
}
}
}
+ }
+ }
+ }
+ },
+ "/v1/exports/{exportId}": {
+ "parameters": [
+ {
+ "schema": {
+ "type": "string",
+ "example": "exp_2bYLdY2lQ2886wmYIHyeBWUZ"
},
- "/v1/exports/{export_Id}": {
- "parameters": [
- {
+ "name": "exportId",
+ "in": "path",
+ "required": true,
+ "description": "Unique export object ID of previously created export. This object can be a: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`."
+ }
+ ],
+ "get": {
+ "operationId": "get-export",
+ "tags": [
+ "EXPORTS API"
+ ],
+ "summary": "Get Export",
+ "description": "Retrieves the URL of the downloadable file, which was generated via the [Create Export](ref:create-export) method.",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns the export object if a valid identifier was provided in the path.",
+ "content": {
+ "application/json": {
"schema": {
- "type": "string",
- "example": "exp_ex6zq0x0EEa9S0N68QcqhxcQ"
- },
- "name": "export_Id",
- "in": "path",
- "required": true,
- "description": "Unique export object ID."
- }
- ],
- "get": {
- "operationId": "download-export",
- "tags": [
- "EXPORTS API"
- ],
- "summary": "Download Export",
- "description": "Download the contents of the exported CSV file. \n\n\n\n> 📘 Important notes\n>\n> **Base URL:** \n> - `https://download.voucherify.io` (Europe) \n> - `https://us1.download.voucherify.io` (US) \n> - `https://as1.download.voucherify.io` (Asia) \n>\n> **Token:** Can be found within the `result` parameter of the [Get Export](ref:get-export) method response.",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": [],
- "Download-Token-1": []
- }
- ],
- "responses": {
- "200": {
- "description": "Returns contents of CSV file.",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
+ "$ref": "#/components/schemas/16_obj_export_object"
+ },
+ "examples": {
+ "Get Export": {
+ "value": {
+ "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf",
+ "object": "export",
+ "created_at": "2022-01-13T09:03:18.293Z",
+ "status": "DONE",
+ "channel": "API",
+ "exported_object": "customer",
+ "parameters": {
+ "order": "",
+ "fields": [
+ "name",
+ "id",
+ "email",
+ "source_id",
+ "created_at"
+ ],
+ "filters": {
+ "junction": "and"
+ },
+ "response_format": "CSV"
},
- "examples": {
- "CSV file contents": {
- "value": "ID,Code,Voucher Type,Value v_mKNYXWf5168jyW3EvwnAf73d7vnTiXaa,iuCvt3BT,GIFT_VOUCHER,2000.00 v_xb5KuIw90ViUY7NrNbDZzf1JwFmyTUi0,M3X8IwW8,GIFT_VOUCHER,2000.00 v_flCSHFGOfjxuM582jhriJTWQuetb2xHX,6vpzmKaC,GIFT_VOUCHER,2050.00 v_YtzZG4UJaWm9DNCY3AvIqVbc7Dt5WToU,lRvBOUPl,LOYALTY_CARD,0"
- }
- }
+ "result": {
+ "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ"
+ },
+ "user_id": null
}
}
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Returns an error indicating that the export with given ID was not found if an incorrect ID is provided in the path.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/e_404_not_found"
},
- "401": {
- "description": "Returns an error if an invalid token was provided.",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string",
- "default": 401,
- "description": "Error's HTTP status code."
- },
- "message": {
- "type": "string",
- "default": "Unauthorized",
- "description": "A human-readable message providing a short description about the error."
- },
- "key": {
- "type": "string",
- "default": "unauthorized",
- "description": "Short string describing the kind of error which occurred."
- }
- }
- },
- "examples": {
- "Unauthorized": {
- "value": {
- "code": 401,
- "message": "Unauthorized",
- "key": "unauthorized"
- }
- }
- }
+ "examples": {
+ "Not Found": {
+ "value": {
+ "code": 404,
+ "key": "not_found",
+ "message": "Resource not found",
+ "details": "Cannot find export with id exp_8fNoLwgVPuhoxNzVsr50kq0",
+ "request_id": "v-0b029305af4524cf42",
+ "resource_id": "exp_8fNoLwgVPuhoxNzVsr50kq0",
+ "resource_type": "export"
}
}
}
}
}
+ }
+ }
+ },
+ "delete": {
+ "operationId": "delete-export",
+ "tags": [
+ "EXPORTS API"
+ ],
+ "summary": "Delete Export",
+ "description": "This method deletes a previously created export object.",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Returns no content if deletion is successful."
},
- "/v1/category-object": {
- "get": {
- "operationId": "category-object",
- "tags": [
- "CATEGORIES API"
- ],
- "summary": "Category Object",
- "description": "Data model description",
- "responses": {
- "200": {
- "description": "Category Object",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/20_obj_category_object"
- }
+ "404": {
+ "description": "Returns an error indicating that the export with given ID was not found.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/e_404_not_found"
+ },
+ "examples": {
+ "Export Not Found": {
+ "value": {
+ "code": 404,
+ "key": "not_found",
+ "message": "Resource not found",
+ "details": "Cannot find export with id exp_2bYLdY2lQ2886wmYIHyeBWUZ",
+ "request_id": "v-0ae2a97a399027d719",
+ "resource_id": "exp_2bYLdY2lQ2886wmYIHyeBWUZ",
+ "resource_type": "export"
}
}
}
}
}
+ }
+ }
+ }
+ },
+ "/v1/exports/{export_Id}": {
+ "parameters": [
+ {
+ "schema": {
+ "type": "string",
+ "example": "exp_ex6zq0x0EEa9S0N68QcqhxcQ"
},
- "/v1/categories": {
- "get": {
- "operationId": "list-categories",
- "tags": [
- "CATEGORIES API"
- ],
- "summary": "List Categories",
- "description": "List all categories.",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
+ "name": "export_Id",
+ "in": "path",
+ "required": true,
+ "description": "Unique export object ID."
+ }
+ ],
+ "get": {
+ "operationId": "download-export",
+ "tags": [
+ "EXPORTS API"
+ ],
+ "summary": "Download Export",
+ "description": "Download the contents of the exported CSV file. \n\n\n\n> 📘 Important notes\n>\n> **Base URL:** \n> - `https://download.voucherify.io` (Europe) \n> - `https://us1.download.voucherify.io` (US) \n> - `https://as1.download.voucherify.io` (Asia) \n>\n> **Token:** Can be found within the `result` parameter of the [Get Export](ref:get-export) method response.",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": [],
+ "Download-Token-1": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns contents of CSV file.",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ },
+ "examples": {
+ "CSV file contents": {
+ "value": "ID,Code,Voucher Type,Value v_mKNYXWf5168jyW3EvwnAf73d7vnTiXaa,iuCvt3BT,GIFT_VOUCHER,2000.00 v_xb5KuIw90ViUY7NrNbDZzf1JwFmyTUi0,M3X8IwW8,GIFT_VOUCHER,2000.00 v_flCSHFGOfjxuM582jhriJTWQuetb2xHX,6vpzmKaC,GIFT_VOUCHER,2050.00 v_YtzZG4UJaWm9DNCY3AvIqVbc7Dt5WToU,lRvBOUPl,LOYALTY_CARD,0"
+ }
}
- ],
- "responses": {
- "200": {
- "description": "Returns a dictionary of category objects.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/20_res_list_categories"
- },
- "examples": {
- "Example": {
- "value": {
- "object": "list",
- "data_ref": "data",
- "data": [
- {
- "id": "cat_0b5f49fb31c3bf6ab0",
- "name": "Sixth",
- "hierarchy": 6,
- "created_at": "2022-07-13T06:21:36.852Z",
- "object": "category"
- },
- {
- "id": "cat_0b5f49e6e1ce5bd2ba",
- "name": "Fifth",
- "hierarchy": 5,
- "created_at": "2022-07-13T06:21:16.039Z",
- "object": "category"
- },
- {
- "id": "cat_0b5f49deafce5bd2b5",
- "name": "Fourth",
- "hierarchy": 4,
- "created_at": "2022-07-13T06:21:07.662Z",
- "object": "category"
- },
- {
- "id": "cat_0b5f49d45c43bf6a99",
- "name": "Third",
- "hierarchy": 3,
- "created_at": "2022-07-13T06:20:57.094Z",
- "object": "category"
- },
- {
- "id": "cat_0b5f3f9881ce5bccb6",
- "name": "Second",
- "hierarchy": 2,
- "created_at": "2022-07-13T05:36:14.355Z",
- "object": "category"
- },
- {
- "id": "cat_0b53bc388dc2f108ba",
- "name": "First",
- "hierarchy": 1,
- "created_at": "2022-07-04T06:58:57.734Z",
- "object": "category"
- }
- ],
- "total": 6
- }
- }
- }
+ }
+ }
+ },
+ "401": {
+ "description": "Returns an error if an invalid token was provided.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string",
+ "default": 401,
+ "description": "Error's HTTP status code."
+ },
+ "message": {
+ "type": "string",
+ "default": "Unauthorized",
+ "description": "A human-readable message providing a short description about the error."
+ },
+ "key": {
+ "type": "string",
+ "default": "unauthorized",
+ "description": "Short string describing the kind of error which occurred."
+ }
+ }
+ },
+ "examples": {
+ "Unauthorized": {
+ "value": {
+ "code": 401,
+ "message": "Unauthorized",
+ "key": "unauthorized"
}
}
}
}
- },
- "post": {
- "operationId": "create-category",
- "tags": [
- "CATEGORIES API"
- ],
- "summary": "Create Category",
- "description": "Create category with a specific name and hierarchy.",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
+ }
+ }
+ }
+ }
+ },
+ "/v1/category-object": {
+ "get": {
+ "operationId": "category-object",
+ "tags": [
+ "CATEGORIES API"
+ ],
+ "summary": "Category Object",
+ "description": "Data model description",
+ "responses": {
+ "200": {
+ "description": "Category Object",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/20_obj_category_object"
}
- ],
- "requestBody": {
- "description": "Specify the details of the category that you would like to create.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/20_req_create_category"
- },
- "examples": {
- "Example": {
- "value": {
- "name": "Eighth",
- "hierarchy": 8
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/categories": {
+ "get": {
+ "operationId": "list-categories",
+ "tags": [
+ "CATEGORIES API"
+ ],
+ "summary": "List Categories",
+ "description": "List all categories.",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns a dictionary of category objects.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/20_res_list_categories"
+ },
+ "examples": {
+ "Example": {
+ "value": {
+ "object": "list",
+ "data_ref": "data",
+ "data": [
+ {
+ "id": "cat_0b5f49fb31c3bf6ab0",
+ "name": "Sixth",
+ "hierarchy": 6,
+ "created_at": "2022-07-13T06:21:36.852Z",
+ "object": "category"
+ },
+ {
+ "id": "cat_0b5f49e6e1ce5bd2ba",
+ "name": "Fifth",
+ "hierarchy": 5,
+ "created_at": "2022-07-13T06:21:16.039Z",
+ "object": "category"
+ },
+ {
+ "id": "cat_0b5f49deafce5bd2b5",
+ "name": "Fourth",
+ "hierarchy": 4,
+ "created_at": "2022-07-13T06:21:07.662Z",
+ "object": "category"
+ },
+ {
+ "id": "cat_0b5f49d45c43bf6a99",
+ "name": "Third",
+ "hierarchy": 3,
+ "created_at": "2022-07-13T06:20:57.094Z",
+ "object": "category"
+ },
+ {
+ "id": "cat_0b5f3f9881ce5bccb6",
+ "name": "Second",
+ "hierarchy": 2,
+ "created_at": "2022-07-13T05:36:14.355Z",
+ "object": "category"
+ },
+ {
+ "id": "cat_0b53bc388dc2f108ba",
+ "name": "First",
+ "hierarchy": 1,
+ "created_at": "2022-07-04T06:58:57.734Z",
+ "object": "category"
}
- }
+ ],
+ "total": 6
}
}
}
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "operationId": "create-category",
+ "tags": [
+ "CATEGORIES API"
+ ],
+ "summary": "Create Category",
+ "description": "Create category with a specific name and hierarchy.",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "requestBody": {
+ "description": "Specify the details of the category that you would like to create.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/20_req_create_category"
},
- "responses": {
- "200": {
- "description": "Returns a newly created category object.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/20_res_create_category"
- },
- "examples": {
- "Example": {
- "value": {
- "id": "cat_0b8b5a427a0283c854",
- "name": "Eighth",
- "hierarchy": 8,
- "created_at": "2022-08-16T11:45:54.171Z",
- "object": "category"
- }
- }
- }
- }
+ "examples": {
+ "Example": {
+ "value": {
+ "name": "Eighth",
+ "hierarchy": 8
}
- },
- "400": {
- "description": "Returns an error if the payload is incomplete.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/e_400_invalid_payload"
- },
- "examples": {
- "Missing name": {
- "value": {
- "code": 400,
- "key": "invalid_payload",
- "message": "Invalid payload",
- "details": "Payload should have required property 'name'",
- "request_id": "v-0b8b5b960990210b25"
- }
- },
- "Missing hierarchy": {
- "value": {
- "code": 400,
- "key": "invalid_payload",
- "message": "Invalid payload",
- "details": "Payload should have required property 'hierarchy'",
- "request_id": "v-0b8b5bf9d9c6824a2f"
- }
- }
- }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Returns a newly created category object.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/20_res_create_category"
+ },
+ "examples": {
+ "Example": {
+ "value": {
+ "id": "cat_0b8b5a427a0283c854",
+ "name": "Eighth",
+ "hierarchy": 8,
+ "created_at": "2022-08-16T11:45:54.171Z",
+ "object": "category"
}
}
}
}
}
},
- "/v1/categories/{categoryId}": {
- "parameters": [
- {
+ "400": {
+ "description": "Returns an error if the payload is incomplete.",
+ "content": {
+ "application/json": {
"schema": {
- "type": "string"
+ "$ref": "#/components/schemas/e_400_invalid_payload"
},
- "name": "categoryId",
- "in": "path",
- "required": true,
- "description": "Unique category ID assigned by Voucherify."
- }
- ],
- "get": {
- "operationId": "get-category",
- "tags": [
- "CATEGORIES API"
- ],
- "summary": "Get Category",
- "description": "Retrieve a category by the category ID.",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
- }
- ],
- "responses": {
- "200": {
- "description": "Returns a category object.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/20_obj_category_object"
- },
- "examples": {
- "Example": {
- "value": {
- "id": "cat_0b5f49fb31c3bf6ab0",
- "name": "Sixth",
- "hierarchy": 6,
- "created_at": "2022-07-13T06:21:36.852Z",
- "object": "category"
- }
- }
- }
+ "examples": {
+ "Missing name": {
+ "value": {
+ "code": 400,
+ "key": "invalid_payload",
+ "message": "Invalid payload",
+ "details": "Payload should have required property 'name'",
+ "request_id": "v-0b8b5b960990210b25"
+ }
+ },
+ "Missing hierarchy": {
+ "value": {
+ "code": 400,
+ "key": "invalid_payload",
+ "message": "Invalid payload",
+ "details": "Payload should have required property 'hierarchy'",
+ "request_id": "v-0b8b5bf9d9c6824a2f"
}
}
}
}
- },
- "delete": {
- "operationId": "delete-category",
- "tags": [
- "CATEGORIES API"
- ],
- "summary": "Delete Category",
- "description": "Delete a category by the category ID.",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
- }
- ],
- "responses": {
- "204": {
- "description": "No content is returned."
- },
- "404": {
- "description": "Returns an error indicating that the category with given ID was not found.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/e_404_not_found"
- },
- "examples": {
- "Not Found": {
- "value": {
- "code": 404,
- "key": "not_found",
- "message": "Resource not found",
- "details": "Cannot find category with id example_category",
- "request_id": "v-0b8b49205f902176c9",
- "resource_id": "example_category",
- "resource_type": "category"
- }
- }
- }
+ }
+ }
+ }
+ }
+ },
+ "/v1/categories/{categoryId}": {
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "name": "categoryId",
+ "in": "path",
+ "required": true,
+ "description": "Unique category ID assigned by Voucherify."
+ }
+ ],
+ "get": {
+ "operationId": "get-category",
+ "tags": [
+ "CATEGORIES API"
+ ],
+ "summary": "Get Category",
+ "description": "Retrieve a category by the category ID.",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns a category object.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/20_obj_category_object"
+ },
+ "examples": {
+ "Example": {
+ "value": {
+ "id": "cat_0b5f49fb31c3bf6ab0",
+ "name": "Sixth",
+ "hierarchy": 6,
+ "created_at": "2022-07-13T06:21:36.852Z",
+ "object": "category"
}
}
}
}
- },
- "put": {
- "operationId": "update-category",
- "tags": [
- "CATEGORIES API"
- ],
- "summary": "Update Category",
- "description": "Update category using the category ID.",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
- }
- ],
- "requestBody": {
- "description": "Specify the details of the category that you would like to update.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/20_req_update_categories_categoryId"
- },
- "examples": {
- "Example": {
- "value": {
- "name": "Summer",
- "hierarchy": 1
- }
- }
+ }
+ }
+ }
+ },
+ "delete": {
+ "operationId": "delete-category",
+ "tags": [
+ "CATEGORIES API"
+ ],
+ "summary": "Delete Category",
+ "description": "Delete a category by the category ID.",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "No content is returned."
+ },
+ "404": {
+ "description": "Returns an error indicating that the category with given ID was not found.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/e_404_not_found"
+ },
+ "examples": {
+ "Not Found": {
+ "value": {
+ "code": 404,
+ "key": "not_found",
+ "message": "Resource not found",
+ "details": "Cannot find category with id example_category",
+ "request_id": "v-0b8b49205f902176c9",
+ "resource_id": "example_category",
+ "resource_type": "category"
}
}
}
+ }
+ }
+ }
+ }
+ },
+ "put": {
+ "operationId": "update-category",
+ "tags": [
+ "CATEGORIES API"
+ ],
+ "summary": "Update Category",
+ "description": "Update category using the category ID.",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "requestBody": {
+ "description": "Specify the details of the category that you would like to update.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/20_req_update_categories_categoryId"
},
- "responses": {
- "200": {
- "description": "Returns a category object with a refreshed `updated_at` property.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/20_obj_category_object"
- },
- "examples": {
- "Example": {
- "value": {
- "id": "cat_0b60cfe7d0d7ddbb55",
- "name": "Update",
- "hierarchy": 1,
- "created_at": "2022-07-14T10:45:13.156Z",
- "updated_at": "2022-08-16T11:03:54.727Z",
- "object": "category"
- }
- }
- }
- }
+ "examples": {
+ "Example": {
+ "value": {
+ "name": "Summer",
+ "hierarchy": 1
}
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Returns a category object with a refreshed `updated_at` property.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/20_obj_category_object"
},
- "400": {
- "description": "Returns an error indicating an invalid payload if the required request body parameters were not included in the request.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/e_400_invalid_payload"
- },
- "examples": {
- "Missing hierarchy": {
- "value": {
- "code": 400,
- "key": "invalid_payload",
- "message": "Invalid payload",
- "details": "Payload should have required property 'hierarchy'",
- "request_id": "v-0b8b4e6b6210217c93"
- }
- },
- "Missing name": {
- "value": {
- "code": 400,
- "key": "invalid_payload",
- "message": "Invalid payload",
- "details": "Payload should have required property 'name'",
- "request_id": "v-0b8b4f418390217d82"
- }
- }
- }
+ "examples": {
+ "Example": {
+ "value": {
+ "id": "cat_0b60cfe7d0d7ddbb55",
+ "name": "Update",
+ "hierarchy": 1,
+ "created_at": "2022-07-14T10:45:13.156Z",
+ "updated_at": "2022-08-16T11:03:54.727Z",
+ "object": "category"
}
}
}
}
}
},
- "/v1/metadata-schema-object": {
- "get": {
- "operationId": "metadata-schema-object",
- "tags": [
- "METADATA SCHEMAS API"
- ],
- "summary": "Metadata Schema Object",
- "description": "Data model description",
- "responses": {
- "200": {
- "description": "Metadata Schema Object",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/21_obj_metadata_schema_object"
- }
+ "400": {
+ "description": "Returns an error indicating an invalid payload if the required request body parameters were not included in the request.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/e_400_invalid_payload"
+ },
+ "examples": {
+ "Missing hierarchy": {
+ "value": {
+ "code": 400,
+ "key": "invalid_payload",
+ "message": "Invalid payload",
+ "details": "Payload should have required property 'hierarchy'",
+ "request_id": "v-0b8b4e6b6210217c93"
+ }
+ },
+ "Missing name": {
+ "value": {
+ "code": 400,
+ "key": "invalid_payload",
+ "message": "Invalid payload",
+ "details": "Payload should have required property 'name'",
+ "request_id": "v-0b8b4f418390217d82"
}
}
}
}
}
- },
- "/v1/metadata-schemas": {
- "get": {
- "operationId": "list-metadata-schemas",
- "tags": [
- "METADATA SCHEMAS API"
- ],
- "summary": "List Metadata Schemas",
- "description": "Retrieve metadata schema definitions.",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
+ }
+ }
+ }
+ },
+ "/v1/metadata-schema-object": {
+ "get": {
+ "operationId": "metadata-schema-object",
+ "tags": [
+ "METADATA SCHEMAS API"
+ ],
+ "summary": "Metadata Schema Object",
+ "description": "Data model description",
+ "responses": {
+ "200": {
+ "description": "Metadata Schema Object",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/21_obj_metadata_schema_object"
}
- ],
- "responses": {
- "200": {
- "description": "Returns an array of metadata schema definitions. The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager while creating a campaign.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/21_res_list_metadata_shemas"
- },
- "examples": {
- "Example": {
- "value": {
- "object": "list",
- "data_ref": "schemas",
- "schemas": [
- {
- "id": "ms_yqMHRHH6S1KYIHPmQHealNf4",
- "related_object": "Payment",
- "properties": {
- "payment_tax": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "payment_method": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": true,
- "created_at": "2022-03-07T11:01:01.747Z",
- "updated_at": "2022-03-07T11:01:44.785Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_DwUjpX32sY3fJEoQELpS7bN3",
- "related_object": "campaign",
- "properties": {
- "Store": {
- "type": "string",
- "array": false,
- "deleted": true,
- "optional": true,
- "objectType": null
- },
- "locale": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "date_tag": {
- "type": "date",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "store_names": {
- "eq": [
- "Store 1 - New York - Broadway",
- "Store 2 - Florida - Miami",
- "Store 3 - London - Heathrow",
- "Store 4 - Berlin - Alexanderplatz"
- ],
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "date_time_tag": {
- "type": "datetime",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "favorite_brands": {
- "type": "string",
- "array": true,
- "deleted": true,
- "optional": true,
- "objectType": null
- },
- "height_customer_number": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "location_country_string": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2021-12-03T13:33:44.556Z",
- "updated_at": "2022-07-26T13:57:42.288Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_f0r4hm3ta6a4a5ch3ma",
- "related_object": "customer",
- "properties": {
- "birth_date": {
- "type": "datetime",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "CRM_created_date": {
- "type": "datetime",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "customer_location": {
- "type": "geopoint",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "acquisition_channel": {
- "eq": [
- "Facebook",
- "Twitter",
- "Website"
- ],
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "customer_life_time_value": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2021-12-03T06:33:45.894Z",
- "updated_at": "2022-07-14T15:15:34.928Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_7X7krsG84H6MeNuIaKkb4LXN",
- "related_object": "earning_rule",
- "properties": {
- "Type": {
- "type": "string",
- "array": false,
- "optional": true,
- "minLength": 6,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-07-27T08:54:07.980Z",
- "updated_at": null,
- "object": "metadata_schema"
- },
- {
- "id": "ms_OF36L2rk4EqhdxvZs56IW9iE",
- "related_object": "loyalty_tier",
- "properties": {
- "has_funds": {
- "type": "boolean",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-03-30T06:22:16.685Z",
- "updated_at": "2022-07-27T08:55:01.628Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_f1r5Tm3ta6a4a5ch3ma",
- "related_object": "order",
- "properties": {
- "Payment": {
- "type": "object",
- "array": false,
- "deleted": true,
- "optional": true,
- "objectType": "Payment"
- },
- "day_of_week": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "location_id": {
- "eq": [
- "L1",
- "L2",
- "L3"
- ],
- "type": "string",
- "array": true,
- "optional": true,
- "objectType": null
- },
- "payment_mean": {
- "eq": [
- "credit-card",
- "wire-transfer",
- "paypal"
- ],
- "type": "string",
- "array": true,
- "optional": true,
- "objectType": null
- },
- "booking_end_date": {
- "type": "datetime",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "booking_start_date": {
- "type": "datetime",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "number_of_store_visits": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2021-12-03T06:33:45.798Z",
- "updated_at": "2022-04-20T06:47:10.350Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN",
- "related_object": "order_item",
- "properties": {
- "Size": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "Color": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "Thickness": {
- "eq": [
- "Thin",
- "Medium",
- "Thick"
- ],
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-03-11T13:32:55.029Z",
- "updated_at": "2022-05-23T13:46:01.463Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_s3c0N6m3ta6a4a5ch3ma",
- "related_object": "product",
- "properties": {
- "color": {
- "type": "string",
- "array": true,
- "optional": true,
- "objectType": null
- },
- "origin": {
- "type": "string",
- "array": false,
- "optional": true,
- "minLength": 1,
- "objectType": null
- },
- "product_location": {
- "type": "geopoint",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "metadata_attribute_name_with_date_property": {
- "type": "date",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "metadata_attribute_name_with_number_property": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "metadata_attribute_name_with_boolean_property": {
- "type": "boolean",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "metadata_attribute_name_with_datetime_property": {
- "type": "datetime",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2021-12-03T06:33:45.880Z",
- "updated_at": "2022-07-14T15:46:47.994Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_th8YHt9yFYY1yAA99XOasT5W",
- "related_object": "promotion_tier",
- "properties": {
- "has_budget": {
- "type": "boolean",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-01-24T07:22:21.523Z",
- "updated_at": "2022-07-27T08:54:42.909Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_Z7niydc0OpGjDRL4yB40niXn",
- "related_object": "publication",
- "properties": {
- "year": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-03-30T06:23:49.715Z",
- "updated_at": "2022-04-19T10:28:24.568Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_t4ir0Dm3ta6a4a5ch3ma",
- "related_object": "redemption",
- "properties": {
- "location_id": {
- "eq": [
- "L1",
- "L2",
- "L3"
- ],
- "type": "string",
- "array": true,
- "optional": true,
- "objectType": null
- },
- "store_names": {
- "eq": [
- "Store 1 - New York - Broadway",
- "Store 2 - Florida - Miami",
- "Store 3 - London - Heathrow",
- "Store 4 - Berlin - Alexanderplatz"
- ],
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2021-12-03T06:33:45.890Z",
- "updated_at": "2022-07-26T14:58:24.546Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg",
- "related_object": "reward",
- "properties": {
- "Type": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null,
- "exactLength": 4
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-07-27T08:53:32.257Z",
- "updated_at": "2022-07-27T08:53:48.542Z",
- "object": "metadata_schema"
- },
- {
- "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4",
- "related_object": "voucher",
- "properties": {
- "unit": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "Region": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "Season": {
- "eq": [
- "Spring",
- "Summer",
- "Fall",
- "Winter"
- ],
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "CATEGORY": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "active_on_calendar_month": {
- "eq": [
- 1,
- 2,
- 3,
- 5,
- 7,
- 9,
- 10,
- 11,
- 12
- ],
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-01-24T07:22:01.281Z",
- "updated_at": "2022-06-22T07:22:09.577Z",
- "object": "metadata_schema"
- }
- ],
- "total": 13
- }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/metadata-schemas": {
+ "get": {
+ "operationId": "list-metadata-schemas",
+ "tags": [
+ "METADATA SCHEMAS API"
+ ],
+ "summary": "List Metadata Schemas",
+ "description": "Retrieve metadata schema definitions.",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns an array of metadata schema definitions. The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager while creating a campaign.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/21_res_list_metadata_shemas"
+ },
+ "examples": {
+ "Example": {
+ "value": {
+ "object": "list",
+ "data_ref": "schemas",
+ "schemas": [
+ {
+ "id": "ms_yqMHRHH6S1KYIHPmQHealNf4",
+ "related_object": "Payment",
+ "properties": {
+ "payment_tax": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "payment_method": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": true,
+ "created_at": "2022-03-07T11:01:01.747Z",
+ "updated_at": "2022-03-07T11:01:44.785Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_DwUjpX32sY3fJEoQELpS7bN3",
+ "related_object": "campaign",
+ "properties": {
+ "Store": {
+ "type": "string",
+ "array": false,
+ "deleted": true,
+ "optional": true,
+ "objectType": null
+ },
+ "locale": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "date_tag": {
+ "type": "date",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "store_names": {
+ "eq": [
+ "Store 1 - New York - Broadway",
+ "Store 2 - Florida - Miami",
+ "Store 3 - London - Heathrow",
+ "Store 4 - Berlin - Alexanderplatz"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "date_time_tag": {
+ "type": "datetime",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "favorite_brands": {
+ "type": "string",
+ "array": true,
+ "deleted": true,
+ "optional": true,
+ "objectType": null
+ },
+ "height_customer_number": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "location_country_string": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2021-12-03T13:33:44.556Z",
+ "updated_at": "2022-07-26T13:57:42.288Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_f0r4hm3ta6a4a5ch3ma",
+ "related_object": "customer",
+ "properties": {
+ "birth_date": {
+ "type": "datetime",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "CRM_created_date": {
+ "type": "datetime",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "customer_location": {
+ "type": "geopoint",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "acquisition_channel": {
+ "eq": [
+ "Facebook",
+ "Twitter",
+ "Website"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "customer_life_time_value": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2021-12-03T06:33:45.894Z",
+ "updated_at": "2022-07-14T15:15:34.928Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_7X7krsG84H6MeNuIaKkb4LXN",
+ "related_object": "earning_rule",
+ "properties": {
+ "Type": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "minLength": 6,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-07-27T08:54:07.980Z",
+ "updated_at": null,
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_OF36L2rk4EqhdxvZs56IW9iE",
+ "related_object": "loyalty_tier",
+ "properties": {
+ "has_funds": {
+ "type": "boolean",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-03-30T06:22:16.685Z",
+ "updated_at": "2022-07-27T08:55:01.628Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_f1r5Tm3ta6a4a5ch3ma",
+ "related_object": "order",
+ "properties": {
+ "Payment": {
+ "type": "object",
+ "array": false,
+ "deleted": true,
+ "optional": true,
+ "objectType": "Payment"
+ },
+ "day_of_week": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "location_id": {
+ "eq": [
+ "L1",
+ "L2",
+ "L3"
+ ],
+ "type": "string",
+ "array": true,
+ "optional": true,
+ "objectType": null
+ },
+ "payment_mean": {
+ "eq": [
+ "credit-card",
+ "wire-transfer",
+ "paypal"
+ ],
+ "type": "string",
+ "array": true,
+ "optional": true,
+ "objectType": null
+ },
+ "booking_end_date": {
+ "type": "datetime",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "booking_start_date": {
+ "type": "datetime",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "number_of_store_visits": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2021-12-03T06:33:45.798Z",
+ "updated_at": "2022-04-20T06:47:10.350Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN",
+ "related_object": "order_item",
+ "properties": {
+ "Size": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "Color": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "Thickness": {
+ "eq": [
+ "Thin",
+ "Medium",
+ "Thick"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-03-11T13:32:55.029Z",
+ "updated_at": "2022-05-23T13:46:01.463Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_s3c0N6m3ta6a4a5ch3ma",
+ "related_object": "product",
+ "properties": {
+ "color": {
+ "type": "string",
+ "array": true,
+ "optional": true,
+ "objectType": null
+ },
+ "origin": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "minLength": 1,
+ "objectType": null
+ },
+ "product_location": {
+ "type": "geopoint",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "metadata_attribute_name_with_date_property": {
+ "type": "date",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "metadata_attribute_name_with_number_property": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "metadata_attribute_name_with_boolean_property": {
+ "type": "boolean",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "metadata_attribute_name_with_datetime_property": {
+ "type": "datetime",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2021-12-03T06:33:45.880Z",
+ "updated_at": "2022-07-14T15:46:47.994Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_th8YHt9yFYY1yAA99XOasT5W",
+ "related_object": "promotion_tier",
+ "properties": {
+ "has_budget": {
+ "type": "boolean",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-01-24T07:22:21.523Z",
+ "updated_at": "2022-07-27T08:54:42.909Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_Z7niydc0OpGjDRL4yB40niXn",
+ "related_object": "publication",
+ "properties": {
+ "year": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-03-30T06:23:49.715Z",
+ "updated_at": "2022-04-19T10:28:24.568Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_t4ir0Dm3ta6a4a5ch3ma",
+ "related_object": "redemption",
+ "properties": {
+ "location_id": {
+ "eq": [
+ "L1",
+ "L2",
+ "L3"
+ ],
+ "type": "string",
+ "array": true,
+ "optional": true,
+ "objectType": null
+ },
+ "store_names": {
+ "eq": [
+ "Store 1 - New York - Broadway",
+ "Store 2 - Florida - Miami",
+ "Store 3 - London - Heathrow",
+ "Store 4 - Berlin - Alexanderplatz"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2021-12-03T06:33:45.890Z",
+ "updated_at": "2022-07-26T14:58:24.546Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg",
+ "related_object": "reward",
+ "properties": {
+ "Type": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null,
+ "exactLength": 4
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-07-27T08:53:32.257Z",
+ "updated_at": "2022-07-27T08:53:48.542Z",
+ "object": "metadata_schema"
+ },
+ {
+ "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4",
+ "related_object": "voucher",
+ "properties": {
+ "unit": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "Region": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "Season": {
+ "eq": [
+ "Spring",
+ "Summer",
+ "Fall",
+ "Winter"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "CATEGORY": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "active_on_calendar_month": {
+ "eq": [
+ 1,
+ 2,
+ 3,
+ 5,
+ 7,
+ 9,
+ 10,
+ 11,
+ 12
+ ],
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-01-24T07:22:01.281Z",
+ "updated_at": "2022-06-22T07:22:09.577Z",
+ "object": "metadata_schema"
}
- }
+ ],
+ "total": 13
}
}
}
}
}
+ }
+ }
+ }
+ },
+ "/v1/metadata-schemas/{resource}": {
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
},
- "/v1/metadata-schemas/{resource}": {
- "parameters": [
- {
+ "name": "resource",
+ "in": "path",
+ "required": true,
+ "description": "There is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas."
+ }
+ ],
+ "get": {
+ "operationId": "get-metadata-schema",
+ "tags": [
+ "METADATA SCHEMAS API"
+ ],
+ "summary": "Get Metadata Schema",
+ "description": "Retrieve metadata schema per resource type.\n\n## Resource types\n\n### Standard\n\nYou can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter.\n\n- `campaign`\n- `customer`\n- `earning_rule`\n- `loyalty_tier`\n- `order`\n- `order_item`\n- `product`\n- `promotion_tier`\n- `publication`\n- `redemption`\n- `reward`\n- `voucher`\n\n### Custom\n\nThere is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas. Provide one of the resource types that you have defined as a resource type. [Read more](https://support.voucherify.io/article/99-schema-validation-metadata#add-metadata).",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager.",
+ "content": {
+ "application/json": {
"schema": {
- "type": "string"
+ "$ref": "#/components/schemas/21_obj_metadata_schema_object"
},
- "name": "resource",
- "in": "path",
- "required": true,
- "description": "There is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas."
- }
- ],
- "get": {
- "operationId": "get-metadata-schema",
- "tags": [
- "METADATA SCHEMAS API"
- ],
- "summary": "Get Metadata Schema",
- "description": "Retrieve metadata schema per resource type.\n\n## Resource types\n\n### Standard\n\nYou can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter.\n\n- `campaign`\n- `customer`\n- `earning_rule`\n- `loyalty_tier`\n- `order`\n- `order_item`\n- `product`\n- `promotion_tier`\n- `publication`\n- `redemption`\n- `reward`\n- `voucher`\n\n### Custom\n\nThere is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas. Provide one of the resource types that you have defined as a resource type. [Read more](https://support.voucherify.io/article/99-schema-validation-metadata#add-metadata).",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
- }
- ],
- "responses": {
- "200": {
- "description": "The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/21_obj_metadata_schema_object"
- },
- "examples": {
- "earning_rule": {
- "value": {
- "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn",
- "related_object": "earning_rule",
- "properties": {
- "channel_id": {
- "type": "string",
- "array": true,
- "optional": true,
- "objectType": null,
- "exactLength": 5
- },
- "channel_name": {
- "eq": [
- "instagram",
- "facebook",
- "google",
- "twitter",
- "linkedin",
- "website"
- ],
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-08-25T13:09:59.970Z",
- "updated_at": "2022-08-25T13:11:15.704Z",
- "object": "metadata_schema"
- }
+ "examples": {
+ "earning_rule": {
+ "value": {
+ "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn",
+ "related_object": "earning_rule",
+ "properties": {
+ "channel_id": {
+ "type": "string",
+ "array": true,
+ "optional": true,
+ "objectType": null,
+ "exactLength": 5
},
- "campaign": {
- "value": {
- "id": "ms_psGSDpVl6JcPilPA7toZ83Kj",
- "related_object": "campaign",
- "properties": {
- "region": {
- "eq": [
- "EMEA",
- "AMER",
- "APAC"
- ],
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-08-25T13:12:58.447Z",
- "updated_at": null,
- "object": "metadata_schema"
- }
+ "channel_name": {
+ "eq": [
+ "instagram",
+ "facebook",
+ "google",
+ "twitter",
+ "linkedin",
+ "website"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-08-25T13:09:59.970Z",
+ "updated_at": "2022-08-25T13:11:15.704Z",
+ "object": "metadata_schema"
+ }
+ },
+ "campaign": {
+ "value": {
+ "id": "ms_psGSDpVl6JcPilPA7toZ83Kj",
+ "related_object": "campaign",
+ "properties": {
+ "region": {
+ "eq": [
+ "EMEA",
+ "AMER",
+ "APAC"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-08-25T13:12:58.447Z",
+ "updated_at": null,
+ "object": "metadata_schema"
+ }
+ },
+ "customer": {
+ "value": {
+ "id": "ms_f0r4hm3ta6a4a5ch3ma",
+ "related_object": "customer",
+ "properties": {
+ "age": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
},
- "customer": {
- "value": {
- "id": "ms_f0r4hm3ta6a4a5ch3ma",
- "related_object": "customer",
- "properties": {
- "age": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "city_id": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "location": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "favorite_brands": {
- "type": "string",
- "array": true,
- "optional": true,
- "objectType": null
- },
- "acquisition_channel": {
- "eq": [
- "Facebook",
- "Twitter",
- "Website"
- ],
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "customer_life_time_value": {
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2021-12-01T08:00:48.889Z",
- "updated_at": "2022-09-12T07:34:49.163Z",
- "object": "metadata_schema"
- }
+ "city_id": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
},
- "loyalty_tier": {
- "value": {
- "id": "ms_jHUoFlgepKVEftxK1pKPGZlO",
- "related_object": "loyalty_tier",
- "properties": {
- "level_name": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "audience_restricted": {
- "type": "boolean",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-08-25T13:14:54.954Z",
- "updated_at": "2022-08-25T13:15:24.436Z",
- "object": "metadata_schema"
- }
+ "location": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
},
- "order": {
- "value": {
- "id": "ms_f1r5Tm3ta6a4a5ch3ma",
- "related_object": "order",
- "properties": {
- "card": {
- "eq": [
- "Visa",
- "MasterCard",
- "Other"
- ],
- "type": "string",
- "array": true,
- "optional": true,
- "objectType": null
- },
- "currency": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "location": {
- "ne": [
- 1,
- 2,
- 18,
- 22
- ],
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "store_city": {
- "eq": [
- "Hampden",
- "San Francisco",
- "Warsaw"
- ],
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "location_id": {
- "eq": [
- "L1",
- "L2",
- "L3"
- ],
- "type": "string",
- "array": true,
- "optional": true,
- "objectType": null
- },
- "payment_mean": {
- "eq": [
- "credit-card",
- "wire-transfer",
- "paypal"
- ],
- "type": "string",
- "array": true,
- "optional": true,
- "objectType": null
- },
- "booking_end_date": {
- "type": "datetime",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "booking_start_date": {
- "type": "datetime",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2021-12-01T08:00:47.575Z",
- "updated_at": "2022-10-25T10:05:18.978Z",
- "object": "metadata_schema"
- }
+ "favorite_brands": {
+ "type": "string",
+ "array": true,
+ "optional": true,
+ "objectType": null
+ },
+ "acquisition_channel": {
+ "eq": [
+ "Facebook",
+ "Twitter",
+ "Website"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "customer_life_time_value": {
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2021-12-01T08:00:48.889Z",
+ "updated_at": "2022-09-12T07:34:49.163Z",
+ "object": "metadata_schema"
+ }
+ },
+ "loyalty_tier": {
+ "value": {
+ "id": "ms_jHUoFlgepKVEftxK1pKPGZlO",
+ "related_object": "loyalty_tier",
+ "properties": {
+ "level_name": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "audience_restricted": {
+ "type": "boolean",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-08-25T13:14:54.954Z",
+ "updated_at": "2022-08-25T13:15:24.436Z",
+ "object": "metadata_schema"
+ }
+ },
+ "order": {
+ "value": {
+ "id": "ms_f1r5Tm3ta6a4a5ch3ma",
+ "related_object": "order",
+ "properties": {
+ "card": {
+ "eq": [
+ "Visa",
+ "MasterCard",
+ "Other"
+ ],
+ "type": "string",
+ "array": true,
+ "optional": true,
+ "objectType": null
+ },
+ "currency": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "location": {
+ "ne": [
+ 1,
+ 2,
+ 18,
+ 22
+ ],
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "store_city": {
+ "eq": [
+ "Hampden",
+ "San Francisco",
+ "Warsaw"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
},
- "order_item": {
- "value": {
- "id": "ms_7ux44AEnt82bqo8ww5V1SXzV",
- "related_object": "order_item",
- "properties": {
- "manufacturer_id": {
- "gte": 15,
- "type": "number",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-08-25T13:16:03.167Z",
- "updated_at": null,
- "object": "metadata_schema"
- }
+ "location_id": {
+ "eq": [
+ "L1",
+ "L2",
+ "L3"
+ ],
+ "type": "string",
+ "array": true,
+ "optional": true,
+ "objectType": null
},
- "product": {
- "value": {
- "id": "ms_s3c0N6m3ta6a4a5ch3ma",
- "related_object": "product",
- "properties": {
- "vendor": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "category": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "location": {
- "type": "geopoint",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2021-12-01T08:00:48.298Z",
- "updated_at": "2022-07-14T15:53:29.226Z",
- "object": "metadata_schema"
- }
+ "payment_mean": {
+ "eq": [
+ "credit-card",
+ "wire-transfer",
+ "paypal"
+ ],
+ "type": "string",
+ "array": true,
+ "optional": true,
+ "objectType": null
},
- "promotion_tier": {
- "value": {
- "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn",
- "related_object": "promotion_tier",
- "properties": {
- "level": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-01-24T10:42:04.937Z",
- "updated_at": "2022-09-23T08:51:46.266Z",
- "object": "metadata_schema"
- }
+ "booking_end_date": {
+ "type": "datetime",
+ "array": false,
+ "optional": true,
+ "objectType": null
},
- "publication": {
- "value": {
- "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG",
- "related_object": "publication",
- "properties": {
- "file_uploaded": {
- "type": "image_url",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "publication_method": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-08-25T13:16:35.534Z",
- "updated_at": "2022-09-12T10:26:31.135Z",
- "object": "metadata_schema"
- }
+ "booking_start_date": {
+ "type": "datetime",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2021-12-01T08:00:47.575Z",
+ "updated_at": "2022-10-25T10:05:18.978Z",
+ "object": "metadata_schema"
+ }
+ },
+ "order_item": {
+ "value": {
+ "id": "ms_7ux44AEnt82bqo8ww5V1SXzV",
+ "related_object": "order_item",
+ "properties": {
+ "manufacturer_id": {
+ "gte": 15,
+ "type": "number",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-08-25T13:16:03.167Z",
+ "updated_at": null,
+ "object": "metadata_schema"
+ }
+ },
+ "product": {
+ "value": {
+ "id": "ms_s3c0N6m3ta6a4a5ch3ma",
+ "related_object": "product",
+ "properties": {
+ "vendor": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
},
- "redemption": {
- "value": {
- "id": "ms_t4ir0Dm3ta6a4a5ch3ma",
- "related_object": "redemption",
- "properties": {
- "location_id": {
- "eq": [
- "L1",
- "L2",
- "L3"
- ],
- "type": "string",
- "array": true,
- "optional": true,
- "objectType": null
- },
- "redemption_location": {
- "type": "object",
- "array": false,
- "optional": true,
- "objectType": "Location"
- }
- },
- "allow_defined_only": false,
- "created_at": "2021-12-01T08:00:48.794Z",
- "updated_at": "2022-08-25T13:19:50.497Z",
- "object": "metadata_schema"
- }
+ "category": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
},
- "reward": {
- "value": {
- "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl",
- "related_object": "reward",
- "properties": {
- "reward_type": {
- "eq": [
- "MATERIAL",
- "PAY-WITH-POINTS",
- "DISCOUNT-COUPON",
- "GIFT-CARD-CREDITS",
- "LOYALTY POINTS"
- ],
- "type": "string",
- "array": false,
- "optional": false,
- "objectType": null
- }
- },
- "allow_defined_only": true,
- "created_at": "2022-08-25T13:07:13.689Z",
- "updated_at": "2022-08-25T13:08:26.696Z",
- "object": "metadata_schema"
- }
+ "location": {
+ "type": "geopoint",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2021-12-01T08:00:48.298Z",
+ "updated_at": "2022-07-14T15:53:29.226Z",
+ "object": "metadata_schema"
+ }
+ },
+ "promotion_tier": {
+ "value": {
+ "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn",
+ "related_object": "promotion_tier",
+ "properties": {
+ "level": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-01-24T10:42:04.937Z",
+ "updated_at": "2022-09-23T08:51:46.266Z",
+ "object": "metadata_schema"
+ }
+ },
+ "publication": {
+ "value": {
+ "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG",
+ "related_object": "publication",
+ "properties": {
+ "file_uploaded": {
+ "type": "image_url",
+ "array": false,
+ "optional": true,
+ "objectType": null
},
- "voucher": {
- "value": {
- "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut",
- "related_object": "voucher",
- "properties": {
- "lang": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "Season": {
- "eq": [
- "Spring",
- "Summer",
- "Fall",
- "Winter"
- ],
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "marketing_text": {
- "type": "string",
- "array": false,
- "optional": true,
- "objectType": null
- },
- "ProductionVoucherCodeMetaData": {
- "type": "string",
- "array": false,
- "deleted": true,
- "optional": true,
- "objectType": null
- }
- },
- "allow_defined_only": false,
- "created_at": "2022-01-24T10:42:23.994Z",
- "updated_at": "2022-09-19T14:13:30.590Z",
- "object": "metadata_schema"
- }
+ "publication_method": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
}
- }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-08-25T13:16:35.534Z",
+ "updated_at": "2022-09-12T10:26:31.135Z",
+ "object": "metadata_schema"
}
- }
- },
- "404": {
- "description": "Returns an error if the resource provided in the path is not found.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/e_404_not_found"
- },
- "examples": {
- "Not Found": {
- "value": {
- "code": 404,
- "key": "not_found",
- "message": "Resource not found",
- "details": "Cannot find metadata schema with id earning_rules",
- "request_id": "v-0c1b9ce0098a391421",
- "resource_id": "earning_rules",
- "resource_type": "metadata schema"
- }
+ },
+ "redemption": {
+ "value": {
+ "id": "ms_t4ir0Dm3ta6a4a5ch3ma",
+ "related_object": "redemption",
+ "properties": {
+ "location_id": {
+ "eq": [
+ "L1",
+ "L2",
+ "L3"
+ ],
+ "type": "string",
+ "array": true,
+ "optional": true,
+ "objectType": null
+ },
+ "redemption_location": {
+ "type": "object",
+ "array": false,
+ "optional": true,
+ "objectType": "Location"
}
- }
+ },
+ "allow_defined_only": false,
+ "created_at": "2021-12-01T08:00:48.794Z",
+ "updated_at": "2022-08-25T13:19:50.497Z",
+ "object": "metadata_schema"
+ }
+ },
+ "reward": {
+ "value": {
+ "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl",
+ "related_object": "reward",
+ "properties": {
+ "reward_type": {
+ "eq": [
+ "MATERIAL",
+ "PAY-WITH-POINTS",
+ "DISCOUNT-COUPON",
+ "GIFT-CARD-CREDITS",
+ "LOYALTY POINTS"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": false,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": true,
+ "created_at": "2022-08-25T13:07:13.689Z",
+ "updated_at": "2022-08-25T13:08:26.696Z",
+ "object": "metadata_schema"
+ }
+ },
+ "voucher": {
+ "value": {
+ "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut",
+ "related_object": "voucher",
+ "properties": {
+ "lang": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "Season": {
+ "eq": [
+ "Spring",
+ "Summer",
+ "Fall",
+ "Winter"
+ ],
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "marketing_text": {
+ "type": "string",
+ "array": false,
+ "optional": true,
+ "objectType": null
+ },
+ "ProductionVoucherCodeMetaData": {
+ "type": "string",
+ "array": false,
+ "deleted": true,
+ "optional": true,
+ "objectType": null
+ }
+ },
+ "allow_defined_only": false,
+ "created_at": "2022-01-24T10:42:23.994Z",
+ "updated_at": "2022-09-19T14:13:30.590Z",
+ "object": "metadata_schema"
}
}
}
}
}
},
- "/v1/location-object": {
- "get": {
- "operationId": "location-object",
- "tags": [
- "LOCATIONS API"
- ],
- "summary": "Location Object",
- "description": "Data model description",
- "responses": {
- "200": {
- "description": "Location Object",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/22_obj_location_object"
- }
+ "404": {
+ "description": "Returns an error if the resource provided in the path is not found.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/e_404_not_found"
+ },
+ "examples": {
+ "Not Found": {
+ "value": {
+ "code": 404,
+ "key": "not_found",
+ "message": "Resource not found",
+ "details": "Cannot find metadata schema with id earning_rules",
+ "request_id": "v-0c1b9ce0098a391421",
+ "resource_id": "earning_rules",
+ "resource_type": "metadata schema"
}
}
}
}
}
+ }
+ }
+ }
+ },
+ "/v1/location-object": {
+ "get": {
+ "operationId": "location-object",
+ "tags": [
+ "LOCATIONS API"
+ ],
+ "summary": "Location Object",
+ "description": "Data model description",
+ "responses": {
+ "200": {
+ "description": "Location Object",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/22_obj_location_object"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/locations": {
+ "get": {
+ "operationId": "list-locations",
+ "tags": [
+ "LOCATIONS API"
+ ],
+ "summary": "List Locations",
+ "description": "Returns a list of your locations.",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/limit"
},
- "/v1/locations": {
- "get": {
- "operationId": "list-locations",
- "tags": [
- "LOCATIONS API"
- ],
- "summary": "List Locations",
- "description": "Returns a list of your locations.",
- "parameters": [
+ {
+ "name": "order",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string",
+ "enum": [
+ "created_at",
+ "-created_at",
+ "updated_at",
+ "-updated_at"
+ ]
+ },
+ "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order."
+ },
+ {
+ "name": "filters",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
{
- "$ref": "#/components/parameters/limit"
+ "$ref": "#/components/schemas/22_filter_updated_at"
},
{
- "name": "order",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string",
- "enum": [
- "created_at",
- "-created_at",
- "updated_at",
- "-updated_at"
- ]
- },
- "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order."
+ "$ref": "#/components/schemas/22_filter_created_at"
},
{
- "name": "filters",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/22_filter_updated_at"
- },
- {
- "$ref": "#/components/schemas/22_filter_created_at"
- },
- {
- "$ref": "#/components/schemas/22_filter_name"
- },
- {
- "$ref": "#/components/schemas/22_filter_id"
- }
- ]
- },
- "description": "Filter the locations using one of the available filters.",
- "style": "deepObject",
- "explode": true
+ "$ref": "#/components/schemas/22_filter_name"
},
{
- "name": "end_date",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string",
- "format": "date-time"
- },
- "description": "A filter on the list based on the end date. This will filter out all locations who's end date falls before the specified date and time. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`)."
- }
- ],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
- }
- ],
- "responses": {
- "200": {
- "description": "Returns a dictionary that contains an array of locations. Each entry in the array is a separate location object. If no more locations are available, the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/22_res_list_locations"
- },
- "examples": {
- "Example": {
- "value": {
- "object": "list",
- "data_ref": "data",
- "data": [
- {
- "id": "loc_NoMGXmHO9OUs7iz9mGWpamma",
- "object": "location",
- "name": "Belleville",
- "shape": {
- "type": "circle",
- "format": "distance",
- "distance": {
- "center": "geo:40.79372699823857,-74.15092132694554",
- "radius": "1.54 km"
- }
- },
- "created_at": "2022-07-15T06:04:36.924Z",
- "updated_at": null
- },
- {
- "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF",
- "object": "location",
- "name": "New York",
- "shape": {
- "type": "polygon",
- "format": "geojson",
- "geojson": {
- "type": "Polygon",
- "coordinates": [
- [
- [
- -74.016167,
- 40.703186
- ],
- [
- -74.008687,
- 40.750656
- ],
- [
- -73.943597,
- 40.851838
- ],
- [
- -73.928559,
- 40.845285
- ],
- [
- -73.936152,
- 40.8356
- ],
- [
- -73.934298,
- 40.810015
- ],
- [
- -73.92711,
- 40.795145
- ],
- [
- -73.978623,
- 40.710432
- ],
- [
- -74.013201,
- 40.701619
- ],
- [
- -74.016167,
- 40.703186
- ]
- ]
- ]
- }
- },
- "created_at": "2022-07-15T05:37:45.299Z",
- "updated_at": null
- },
- {
- "id": "loc_f5HqjVaiq7g9ISlmivpytxSf",
- "object": "location",
- "name": "Germany",
- "shape": {
- "type": "circle",
- "format": "distance",
- "distance": {
- "center": "geo:51.303908897065064,10.222253628401518",
- "radius": "192.37 km"
- }
- },
- "created_at": "2022-07-14T15:51:39.265Z",
- "updated_at": null
- },
- {
- "id": "loc_RcYz537sV07e1t5aG5tIH9FD",
- "object": "location",
- "name": "Poland",
- "shape": {
- "type": "polygon",
- "format": "geojson",
- "geojson": {
- "type": "Polygon",
- "coordinates": [
- [
- [
- 18.553923,
- 50.559107
- ],
- [
- 18.528805,
- 51.087437
- ],
- [
- 19.591667,
- 50.832424
- ],
- [
- 19.425109,
- 50.497984
- ],
- [
- 19.375814,
- 50.330652
- ],
- [
- 19.398107,
- 50.111652
- ],
- [
- 18.73906,
- 49.981498
- ],
- [
- 18.272477,
- 50.088707
- ],
- [
- 18.553923,
- 50.559107
- ]
- ]
- ]
- }
- },
- "created_at": "2022-07-14T15:21:55.085Z",
- "updated_at": null
- }
- ],
- "total": 4,
- "has_more": false
- }
- }
- }
- }
- }
+ "$ref": "#/components/schemas/22_filter_id"
}
- }
- }
+ ]
+ },
+ "description": "Filter the locations using one of the available filters.",
+ "style": "deepObject",
+ "explode": true
},
- "/v1/locations/{locationId}": {
- "get": {
- "operationId": "get-location",
- "tags": [
- "LOCATIONS API"
- ],
- "summary": "Get Location",
- "description": "Returns a location object.",
- "parameters": [
- {
- "schema": {
- "type": "string"
- },
- "name": "locationId",
- "in": "path",
- "required": true,
- "description": "The unique location ID."
- }
- ],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
- }
- ],
- "responses": {
- "200": {
- "description": "Returns a location object.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/22_obj_location_object"
- },
- "examples": {
- "Circle Example": {
- "value": {
- "id": "loc_NoMGXmHO9OUs7iz9mGWpamma",
- "object": "location",
- "name": "Belleville",
- "shape": {
- "type": "circle",
- "format": "distance",
- "distance": {
- "center": "geo:40.79372699823857,-74.15092132694554",
- "radius": "1.54 km"
- }
- },
- "created_at": "2022-07-15T06:04:36.924Z",
- "updated_at": null
- }
+ {
+ "name": "end_date",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "description": "A filter on the list based on the end date. This will filter out all locations who's end date falls before the specified date and time. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`)."
+ }
+ ],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns a dictionary that contains an array of locations. Each entry in the array is a separate location object. If no more locations are available, the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/22_res_list_locations"
+ },
+ "examples": {
+ "Example": {
+ "value": {
+ "object": "list",
+ "data_ref": "data",
+ "data": [
+ {
+ "id": "loc_NoMGXmHO9OUs7iz9mGWpamma",
+ "object": "location",
+ "name": "Belleville",
+ "shape": {
+ "type": "circle",
+ "format": "distance",
+ "distance": {
+ "center": "geo:40.79372699823857,-74.15092132694554",
+ "radius": "1.54 km"
+ }
+ },
+ "created_at": "2022-07-15T06:04:36.924Z",
+ "updated_at": null
+ },
+ {
+ "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF",
+ "object": "location",
+ "name": "New York",
+ "shape": {
+ "type": "polygon",
+ "format": "geojson",
+ "geojson": {
+ "type": "Polygon",
+ "coordinates": [
+ [
+ [
+ -74.016167,
+ 40.703186
+ ],
+ [
+ -74.008687,
+ 40.750656
+ ],
+ [
+ -73.943597,
+ 40.851838
+ ],
+ [
+ -73.928559,
+ 40.845285
+ ],
+ [
+ -73.936152,
+ 40.8356
+ ],
+ [
+ -73.934298,
+ 40.810015
+ ],
+ [
+ -73.92711,
+ 40.795145
+ ],
+ [
+ -73.978623,
+ 40.710432
+ ],
+ [
+ -74.013201,
+ 40.701619
+ ],
+ [
+ -74.016167,
+ 40.703186
+ ]
+ ]
+ ]
+ }
+ },
+ "created_at": "2022-07-15T05:37:45.299Z",
+ "updated_at": null
+ },
+ {
+ "id": "loc_f5HqjVaiq7g9ISlmivpytxSf",
+ "object": "location",
+ "name": "Germany",
+ "shape": {
+ "type": "circle",
+ "format": "distance",
+ "distance": {
+ "center": "geo:51.303908897065064,10.222253628401518",
+ "radius": "192.37 km"
+ }
+ },
+ "created_at": "2022-07-14T15:51:39.265Z",
+ "updated_at": null
},
- "Polygon Example": {
- "value": {
- "id": "loc_RcYz537sV07e1t5aG5tIH9FD",
- "object": "location",
- "name": "Poland",
- "shape": {
- "type": "polygon",
- "format": "geojson",
- "geojson": {
- "type": "Polygon",
- "coordinates": [
+ {
+ "id": "loc_RcYz537sV07e1t5aG5tIH9FD",
+ "object": "location",
+ "name": "Poland",
+ "shape": {
+ "type": "polygon",
+ "format": "geojson",
+ "geojson": {
+ "type": "Polygon",
+ "coordinates": [
+ [
+ [
+ 18.553923,
+ 50.559107
+ ],
+ [
+ 18.528805,
+ 51.087437
+ ],
+ [
+ 19.591667,
+ 50.832424
+ ],
[
- [
- 18.553923,
- 50.559107
- ],
- [
- 18.528805,
- 51.087437
- ],
- [
- 19.591667,
- 50.832424
- ],
- [
- 19.425109,
- 50.497984
- ],
- [
- 19.375814,
- 50.330652
- ],
- [
- 19.398107,
- 50.111652
- ],
- [
- 18.73906,
- 49.981498
- ],
- [
- 18.272477,
- 50.088707
- ],
- [
- 18.553923,
- 50.559107
- ]
+ 19.425109,
+ 50.497984
+ ],
+ [
+ 19.375814,
+ 50.330652
+ ],
+ [
+ 19.398107,
+ 50.111652
+ ],
+ [
+ 18.73906,
+ 49.981498
+ ],
+ [
+ 18.272477,
+ 50.088707
+ ],
+ [
+ 18.553923,
+ 50.559107
]
]
- }
- },
- "created_at": "2022-07-14T15:21:55.085Z",
- "updated_at": null
- }
+ ]
+ }
+ },
+ "created_at": "2022-07-14T15:21:55.085Z",
+ "updated_at": null
}
- }
+ ],
+ "total": 4,
+ "has_more": false
}
}
}
}
}
- },
- "/v1/qualification-object": {
- "get": {
- "operationId": "qualification-object",
- "tags": [
- "QUALIFICATIONS API"
- ],
- "summary": "Qualification Object",
- "description": "Data model description",
- "responses": {
- "200": {
- "description": "Qualification Object",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/23_obj_qualification_object"
- }
+ }
+ }
+ }
+ },
+ "/v1/locations/{locationId}": {
+ "get": {
+ "operationId": "get-location",
+ "tags": [
+ "LOCATIONS API"
+ ],
+ "summary": "Get Location",
+ "description": "Returns a location object.",
+ "parameters": [
+ {
+ "schema": {
+ "type": "string"
+ },
+ "name": "locationId",
+ "in": "path",
+ "required": true,
+ "description": "The unique location ID."
+ }
+ ],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns a location object.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/22_obj_location_object"
+ },
+ "examples": {
+ "Circle Example": {
+ "value": {
+ "id": "loc_NoMGXmHO9OUs7iz9mGWpamma",
+ "object": "location",
+ "name": "Belleville",
+ "shape": {
+ "type": "circle",
+ "format": "distance",
+ "distance": {
+ "center": "geo:40.79372699823857,-74.15092132694554",
+ "radius": "1.54 km"
+ }
+ },
+ "created_at": "2022-07-15T06:04:36.924Z",
+ "updated_at": null
+ }
+ },
+ "Polygon Example": {
+ "value": {
+ "id": "loc_RcYz537sV07e1t5aG5tIH9FD",
+ "object": "location",
+ "name": "Poland",
+ "shape": {
+ "type": "polygon",
+ "format": "geojson",
+ "geojson": {
+ "type": "Polygon",
+ "coordinates": [
+ [
+ [
+ 18.553923,
+ 50.559107
+ ],
+ [
+ 18.528805,
+ 51.087437
+ ],
+ [
+ 19.591667,
+ 50.832424
+ ],
+ [
+ 19.425109,
+ 50.497984
+ ],
+ [
+ 19.375814,
+ 50.330652
+ ],
+ [
+ 19.398107,
+ 50.111652
+ ],
+ [
+ 18.73906,
+ 49.981498
+ ],
+ [
+ 18.272477,
+ 50.088707
+ ],
+ [
+ 18.553923,
+ 50.559107
+ ]
+ ]
+ ]
+ }
+ },
+ "created_at": "2022-07-14T15:21:55.085Z",
+ "updated_at": null
}
}
}
}
}
- },
- "/v1/qualifications": {
- "post": {
- "operationId": "check-eligibility",
- "tags": [
- "QUALIFICATIONS API"
- ],
- "summary": "Check Eligibility",
- "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.",
- "parameters": [],
- "security": [
- {
- "X-App-Id-1": [],
- "X-App-Token-1": []
- }
- ],
- "requestBody": {
- "description": "Define order and customer context.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/23_req_create_qualification"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Returns a qualifications object.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/23_obj_qualification_object"
- }
- }
- }
+ }
+ }
+ }
+ },
+ "/v1/qualification-object": {
+ "get": {
+ "operationId": "qualification-object",
+ "tags": [
+ "QUALIFICATIONS API"
+ ],
+ "summary": "Qualification Object",
+ "description": "Data model description",
+ "responses": {
+ "200": {
+ "description": "Qualification Object",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/23_obj_qualification_object"
}
}
}
- },
- "/client/v1/qualifications": {
- "post": {
- "operationId": "check-eligibility-client-side",
- "tags": [
- "QUALIFICATIONS API"
- ],
- "summary": "Check Eligibility (client-side)",
- "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.",
- "parameters": [],
- "security": [
- {
- "X-Client-Application-Id-1": [],
- "X-Client-Token-1": []
- }
- ],
- "requestBody": {
- "description": "Define order and customer context.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/23_req_create_qualification"
- }
- }
+ }
+ }
+ }
+ },
+ "/v1/qualifications": {
+ "post": {
+ "operationId": "check-eligibility",
+ "tags": [
+ "QUALIFICATIONS API"
+ ],
+ "summary": "Check Eligibility",
+ "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.",
+ "parameters": [],
+ "security": [
+ {
+ "X-App-Id-1": [],
+ "X-App-Token-1": []
+ }
+ ],
+ "requestBody": {
+ "description": "Define order and customer context.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/23_req_create_qualification"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Returns a qualifications object.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/23_obj_qualification_object"
}
- },
- "responses": {
- "200": {
- "description": "Returns a qualifications object.",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/23_obj_qualification_object"
- }
- }
- }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/client/v1/qualifications": {
+ "post": {
+ "operationId": "check-eligibility-client-side",
+ "tags": [
+ "QUALIFICATIONS API"
+ ],
+ "summary": "Check Eligibility (client-side)",
+ "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.",
+ "parameters": [],
+ "security": [
+ {
+ "X-Client-Application-Id-1": [],
+ "X-Client-Token-1": []
+ }
+ ],
+ "requestBody": {
+ "description": "Define order and customer context.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/23_req_create_qualification"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Returns a qualifications object.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/23_obj_qualification_object"
}
}
}
From 1b142142905c8daebec4b234c64daba422284f74 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Tue, 17 Oct 2023 13:28:58 +0200
Subject: [PATCH 03/21] list voucher transactions
---
Changelog.md | 3 +
...VOUCHERS-API-List-Voucher-Transactions.md} | 4 +-
reference/OpenAPI.json | 117 +++++-------------
3 files changed, 37 insertions(+), 87 deletions(-)
rename docs/reference-docs/{VOUCHERS-API-List-Gift-Card-Transactions.md => VOUCHERS-API-List-Voucher-Transactions.md} (85%)
diff --git a/Changelog.md b/Changelog.md
index da4deaaf3..0bb8efb1f 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,5 +1,8 @@
# Changelog
+# 20231017
+
+- Vouchers - List Gift Card Transactions (**GET** `/vouchers/{code}/transactions`) renamed to List Voucher Transactions
## 20231012 - Product Collections
diff --git a/docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md b/docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md
similarity index 85%
rename from docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md
rename to docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md
index 0c0946408..d9c3268fd 100644
--- a/docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md
+++ b/docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md
@@ -1,8 +1,8 @@
---
-title: List Gift Card Transactions
+title: List Voucher Transactions
type: endpoint
categorySlug: voucherify-api
-slug: list-gift-card-transactions
+slug: list-voucher-transactions
parentDocSlug: vouchers-api
hidden: false
order: 11
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index dae42e817..68439c889 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -3890,8 +3890,8 @@
}
}
},
- "1_res_vouchers_code_transactions": {
- "title": "Get Gift Card Transactions Response Body",
+ "vouchers_list_vouchers_transactions_response_body": {
+ "title": "List Voucher Transactions Response Body",
"type": "object",
"description": "List of voucher transactions",
"properties": {
@@ -3909,7 +3909,7 @@
"type": "array",
"description": "A dictionary that contains an array of transactions. Each entry in the array is a separate transaction object.",
"items": {
- "$ref": "#/components/schemas/1_obj_gift_card_transaction_object"
+ "$ref": "#/components/schemas/gift_card_transaction"
}
},
"has_more": {
@@ -3918,25 +3918,37 @@
}
}
},
- "1_obj_gift_card_transaction_object": {
+ "voucher_transaction": {
+ "title": "Voucher Transaction Object",
+ "description": "List of voucher transactions",
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/gift_card_transaction"
+ },
+ {
+ "$ref": "#/components/schemas/LoyaltyCardTransaction"
+ }
+ ]
+ },
+ "gift_card_transaction": {
"title": "Gift Card Transaction Object",
- "description": "Gift card transaction object",
+ "description": "List of gift card transactions",
"anyOf": [
{
- "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_redemption"
+ "$ref": "#/components/schemas/gift_card_transaction_redemption_details"
},
{
- "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_refund"
+ "$ref": "#/components/schemas/gift_card_transaction_refund_details"
},
{
- "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_addition"
+ "$ref": "#/components/schemas/gift_card_transaction_addition_details"
},
{
- "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_removal"
+ "$ref": "#/components/schemas/gift_card_transaction_removal_details"
}
]
},
- "1_obj_gift_card_transaction_object_redemption": {
+ "gift_card_transaction_redemption_details": {
"title": "Redemption",
"description": "When credits are used to pay for an order.",
"type": "object",
@@ -4068,7 +4080,7 @@
}
}
},
- "1_obj_gift_card_transaction_object_refund": {
+ "gift_card_transaction_refund_details": {
"title": "Refund",
"description": "When funds are credited back to a card through a redemption rollback.",
"type": "object",
@@ -4211,7 +4223,7 @@
}
}
},
- "1_obj_gift_card_transaction_object_addition": {
+ "gift_card_transaction_addition_details": {
"title": "Addition",
"description": "When funds are deposited to a gift card.",
"type": "object",
@@ -4317,7 +4329,7 @@
}
}
},
- "1_obj_gift_card_transaction_object_removal": {
+ "gift_card_transaction_removal_details": {
"title": "Removal",
"description": "When funds are removed from a gift card.",
"type": "object",
@@ -39540,9 +39552,6 @@
},
"EarningRuleBase": {
"title": "EarningRuleBase",
- "x-stoplight": {
- "id": "w4ci1ljqva0r1"
- },
"type": "object",
"properties": {
"id": {
@@ -39680,9 +39689,6 @@
},
"EarningRuleEvent": {
"title": "EarningRuleEvent",
- "x-stoplight": {
- "id": "6vxql7fnzg2zp"
- },
"type": "string",
"enum": [
"order.paid",
@@ -39697,9 +39703,6 @@
},
"EarningRuleFixed": {
"title": "Define fixed amount of points",
- "x-stoplight": {
- "id": "r5o8m0sdli7fq"
- },
"type": "object",
"properties": {
"type": {
@@ -39731,9 +39734,6 @@
},
"EarningRuleProportionalOrderAmount": {
"title": "Order Amount",
- "x-stoplight": {
- "id": "1z7lk7z1lp5af"
- },
"type": "object",
"properties": {
"type": {
@@ -39785,9 +39785,6 @@
},
"EarningRuleProportionalOrderTotalAmount": {
"title": "Order Total Amount",
- "x-stoplight": {
- "id": "ekudxr430edgk"
- },
"type": "object",
"properties": {
"type": {
@@ -39839,9 +39836,6 @@
},
"EarningRuleProportionalOrderMetadata": {
"title": "Order Metadata",
- "x-stoplight": {
- "id": "4ccw4gz8b47u5"
- },
"type": "object",
"properties": {
"type": {
@@ -39899,9 +39893,6 @@
},
"EarningRuleProportionalOrderItemsQuantity": {
"title": "Order Items Quantity",
- "x-stoplight": {
- "id": "pqsn9otpzyot9"
- },
"type": "object",
"properties": {
"type": {
@@ -39968,9 +39959,6 @@
},
"EarningRuleProportionalOrderItemsAmount": {
"title": "Order Items Amount",
- "x-stoplight": {
- "id": "8pg4o23daepkb"
- },
"type": "object",
"properties": {
"type": {
@@ -40037,9 +40025,6 @@
},
"EarningRuleProportionalOrderItemsSubtotalAmount": {
"title": "Order Items Subtotal Amount",
- "x-stoplight": {
- "id": "duxy5qw36h5ph"
- },
"type": "object",
"properties": {
"type": {
@@ -43373,9 +43358,6 @@
},
"LoyaltiesCreateTiersRequestBody": {
"title": "Loyalties Create Tiers Request Body",
- "x-stoplight": {
- "id": "i1emmwlaqp7lt"
- },
"type": "array",
"items": {
"allOf": [
@@ -43396,31 +43378,19 @@
},
"LoyaltiesCreateTiersResponseBody": {
"title": "Loyalties Create Tiers Response Body",
- "x-stoplight": {
- "id": "ix7g5mnuwqsp6"
- },
"type": "array",
"items": {
"$ref": "#/components/schemas/LoyaltyTier"
}
},
"LoyaltiesGetRewardAssignmentResponseBody": {
- "$ref": "#/components/schemas/RewardAssignment",
- "x-stoplight": {
- "id": "fnbbaq9l1l9it"
- }
+ "$ref": "#/components/schemas/RewardAssignment"
},
"LoyaltiesGetRewardDetailsResponseBody": {
- "$ref": "#/components/schemas/Reward",
- "x-stoplight": {
- "id": "44hds9u0hhukf"
- }
+ "$ref": "#/components/schemas/Reward"
},
"LoyaltiesListTiersRequestQuery": {
"title": "Loyalties List Tiers Request Query",
- "x-stoplight": {
- "id": "d5sluzqkxu8km"
- },
"type": "object",
"properties": {
"limit": {
@@ -43447,9 +43417,6 @@
},
"LoyaltiesListLoyaltyTierEarningRulesRequestQuery": {
"title": "LoyaltiesListLoyaltyTierEarningRulesRequestQuery",
- "x-stoplight": {
- "id": "zs0z1cyyzac9u"
- },
"type": "object",
"properties": {
"limit": {
@@ -43465,16 +43432,10 @@
}
},
"LoyaltiesGetTierResponseBody": {
- "$ref": "#/components/schemas/LoyaltyTier",
- "x-stoplight": {
- "id": "hzcsijl2b4d5o"
- }
+ "$ref": "#/components/schemas/LoyaltyTier"
},
"LoyaltiesListTiersResponseBody": {
"title": "Loyalties List Tiers Response Body",
- "x-stoplight": {
- "id": "kw06g2szvv479"
- },
"type": "object",
"properties": {
"object": {
@@ -43512,9 +43473,6 @@
},
"LoyaltiesListMemberLoyaltyTiersResponseBody": {
"title": "Loyalties List Member Loyalty Tiers Response Body",
- "x-stoplight": {
- "id": "s3zpgud510xl6"
- },
"type": "object",
"properties": {
"object": {
@@ -43587,9 +43545,6 @@
},
"LoyaltiesListLoyaltyTierEarningRulesResponseBody": {
"title": "Loyalties List Loyalty Tier Earning Rules ResponseBody",
- "x-stoplight": {
- "id": "i180zbh3ffwaa"
- },
"type": "object",
"properties": {
"object": {
@@ -43627,9 +43582,6 @@
},
"LoyaltyTierBase": {
"title": "Loyalty Tier Base",
- "x-stoplight": {
- "id": "3af9422223696"
- },
"type": "object",
"properties": {
"name": {
@@ -43787,9 +43739,6 @@
},
"MappingMultiply": {
"title": "MappingMultiply",
- "x-stoplight": {
- "id": "7zrwgr2oqh4tj"
- },
"type": "object",
"properties": {
"type": {
@@ -43807,9 +43756,6 @@
},
"MappingFixed": {
"title": "MappingFixed",
- "x-stoplight": {
- "id": "86eksegayxcxa"
- },
"type": "object",
"properties": {
"type": {
@@ -44846,7 +44792,8 @@
"name",
"filter"
]
- }
+ },
+ "v": {}
},
"examples": {
"req_vouchers_metadata_1": {
@@ -47716,8 +47663,8 @@
"X-App-Token-1": []
}
],
- "summary": "List Gift Card Transactions",
- "description": "List transactions that are associated with credit movements on a gift card.",
+ "summary": "List Voucher Transactions",
+ "description": "List transactions that are associated with credit movements on a gift card or loyalty card.",
"responses": {
"200": {
"description": "Returns a dictionary of transaction objects",
From 17d84433fba73c77595b0ced58ca28bd57e0c92e Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Tue, 17 Oct 2023 13:38:52 +0200
Subject: [PATCH 04/21] list gift card transactions
---
reference/OpenAPI.json | 196 ++++++++++++++---------------------------
1 file changed, 66 insertions(+), 130 deletions(-)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index 68439c889..d5385b05e 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -3906,17 +3906,20 @@
"description": "Identifies the name of the attribute that contains the array of transaction objects."
},
"data": {
- "type": "array",
- "description": "A dictionary that contains an array of transactions. Each entry in the array is a separate transaction object.",
- "items": {
- "$ref": "#/components/schemas/gift_card_transaction"
- }
+ "$ref": "#/components/schemas/voucher_transaction",
+ "description": "A dictionary that contains an array of transactions. Each entry in the array is a separate transaction object."
},
"has_more": {
"type": "boolean",
"description": "As query results are always limited (by the limit parameter), the `has_more` flag indicates whether there are more records for given filter parameters. This let's you know if you are able to run another request (with a different page or a different start date filter) to get more records returned in the results."
}
- }
+ },
+ "required": [
+ "object",
+ "data_ref",
+ "data",
+ "has_more"
+ ]
},
"voucher_transaction": {
"title": "Voucher Transaction Object",
@@ -3931,26 +3934,24 @@
]
},
"gift_card_transaction": {
- "title": "Gift Card Transaction Object",
+ "title": "Gift Card Transaction",
"description": "List of gift card transactions",
- "anyOf": [
+ "allOf": [
{
- "$ref": "#/components/schemas/gift_card_transaction_redemption_details"
+ "$ref": "#/components/schemas/gift_card_transaction_identity"
},
{
- "$ref": "#/components/schemas/gift_card_transaction_refund_details"
+ "$ref": "#/components/schemas/gift_card_transaction_base"
},
{
- "$ref": "#/components/schemas/gift_card_transaction_addition_details"
+ "$ref": "#/components/schemas/gift_card_transaction_response_data"
},
{
- "$ref": "#/components/schemas/gift_card_transaction_removal_details"
+ "$ref": "#/components/schemas/gift_card_transaction_details"
}
]
},
- "gift_card_transaction_redemption_details": {
- "title": "Redemption",
- "description": "When credits are used to pay for an order.",
+ "gift_card_transaction_identity": {
"type": "object",
"properties": {
"id": {
@@ -3961,7 +3962,12 @@
"source_id": {
"type": "string",
"description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service. In case of a redemption, this value is `null`."
- },
+ }
+ }
+ },
+ "gift_card_transaction_base": {
+ "type": "object",
+ "properties": {
"voucher_id": {
"type": "string",
"description": "Unique voucher ID.",
@@ -3972,6 +3978,49 @@
"description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.",
"example": "camp_FNYR4jhqZBM9xTptxDGgeNBV"
},
+ "reason": {
+ "type": "string",
+ "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`."
+ },
+ "related_transaction_id": {
+ "type": "string",
+ "description": "This field is `null` in the case of gift voucher transactions."
+ }
+ }
+ },
+ "gift_card_transaction_response_data": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "example": "2022-02-25T13:32:08.734Z",
+ "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format."
+ }
+ }
+ },
+ "gift_card_transaction_details": {
+ "type": "object",
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_redemption_details"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_refund_details"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_addition_details"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_removal_details"
+ }
+ ]
+ },
+ "gift_card_transaction_redemption_details": {
+ "title": "Redemption",
+ "description": "When credits are used to pay for an order.",
+ "type": "object",
+ "properties": {
"source": {
"type": "string",
"description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption, this value is `null`.",
@@ -3980,10 +4029,6 @@
"API"
]
},
- "reason": {
- "type": "string",
- "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`."
- },
"type": {
"type": "string",
"description": "Type of transaction.",
@@ -4067,16 +4112,6 @@
}
}
}
- },
- "related_transaction_id": {
- "type": "string",
- "description": "This field is `null` in the case of gift voucher transactions."
- },
- "created_at": {
- "type": "string",
- "format": "date-time",
- "example": "2022-02-25T13:32:08.734Z",
- "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format."
}
}
},
@@ -4085,25 +4120,6 @@
"description": "When funds are credited back to a card through a redemption rollback.",
"type": "object",
"properties": {
- "id": {
- "type": "string",
- "description": "Unique transaction ID.",
- "example": "vtx_0c9dccc4d5813e71bd"
- },
- "source_id": {
- "type": "string",
- "description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service. In case of a redemption rollback, this value is `null`."
- },
- "voucher_id": {
- "type": "string",
- "description": "Unique voucher ID.",
- "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp"
- },
- "campaign_id": {
- "type": "string",
- "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.",
- "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV"
- },
"source": {
"type": "string",
"description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption rollback, this value is `null`.",
@@ -4112,10 +4128,6 @@
"API"
]
},
- "reason": {
- "type": "string",
- "description": "Reason why the transaction occurred. In case of a redemption rollback, this value is `null`."
- },
"type": {
"type": "string",
"description": "Type of transaction.",
@@ -4210,16 +4222,6 @@
}
}
}
- },
- "related_transaction_id": {
- "type": "string",
- "description": "This field is `null` in the case of gift voucher transactions."
- },
- "created_at": {
- "type": "string",
- "format": "date-time",
- "example": "2022-02-25T13:32:08.734Z",
- "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format."
}
}
},
@@ -4228,25 +4230,6 @@
"description": "When funds are deposited to a gift card.",
"type": "object",
"properties": {
- "id": {
- "type": "string",
- "description": "Unique transaction ID.",
- "example": "vtx_0c9dccc4d5813e71bd"
- },
- "source_id": {
- "type": "string",
- "description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service."
- },
- "voucher_id": {
- "type": "string",
- "description": "Unique voucher ID.",
- "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp"
- },
- "campaign_id": {
- "type": "string",
- "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.",
- "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV"
- },
"source": {
"type": "string",
"description": "The channel through which the transaction took place, whether through the API or the the Dashboard.",
@@ -4255,10 +4238,6 @@
"API"
]
},
- "reason": {
- "type": "string",
- "description": "Reason why the transaction occurred."
- },
"type": {
"type": "string",
"description": "Type of transaction.",
@@ -4316,16 +4295,6 @@
}
}
}
- },
- "related_transaction_id": {
- "type": "string",
- "description": "This field is `null` in the case of gift voucher transactions."
- },
- "created_at": {
- "type": "string",
- "format": "date-time",
- "example": "2022-02-25T13:32:08.734Z",
- "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format."
}
}
},
@@ -4334,25 +4303,6 @@
"description": "When funds are removed from a gift card.",
"type": "object",
"properties": {
- "id": {
- "type": "string",
- "description": "Unique transaction ID.",
- "example": "vtx_0c9dccc4d5813e71bd"
- },
- "source_id": {
- "type": "string",
- "description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service."
- },
- "voucher_id": {
- "type": "string",
- "description": "Unique voucher ID.",
- "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp"
- },
- "campaign_id": {
- "type": "string",
- "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.",
- "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV"
- },
"source": {
"type": "string",
"description": "The channel through which the transaction took place, whether through the API or the the Dashboard.",
@@ -4361,10 +4311,6 @@
"API"
]
},
- "reason": {
- "type": "string",
- "description": "Reason why the transaction occurred."
- },
"type": {
"type": "string",
"description": "Type of transaction.",
@@ -4422,16 +4368,6 @@
}
}
}
- },
- "related_transaction_id": {
- "type": "string",
- "description": "This field is `null` in the case of gift voucher transactions."
- },
- "created_at": {
- "type": "string",
- "format": "date-time",
- "example": "2022-02-25T13:32:08.734Z",
- "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format."
}
}
},
@@ -47671,7 +47607,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/1_res_vouchers_code_transactions"
+ "$ref": "#/components/schemas/vouchers_list_vouchers_transactions_response_body"
},
"examples": {
"Example": {
From 3aaa83e4f9df83649419d2c54b6da65d2329bd7f Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Tue, 17 Oct 2023 13:55:03 +0200
Subject: [PATCH 05/21] update gift card
---
reference/OpenAPI.json | 269 +++++++++++++++++++++++++++++++++--------
1 file changed, 221 insertions(+), 48 deletions(-)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index d5385b05e..79939955c 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -3960,13 +3960,22 @@
"example": "vtx_0c9dccc4d5813e71bd"
},
"source_id": {
- "type": "string",
+ "type": [
+ "string",
+ "null"
+ ],
"description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service. In case of a redemption, this value is `null`."
}
- }
+ },
+ "required": [
+ "id",
+ "source_id"
+ ],
+ "title": "Gift Card Transaction Identity"
},
"gift_card_transaction_base": {
"type": "object",
+ "title": "Gift Card Transaction Base",
"properties": {
"voucher_id": {
"type": "string",
@@ -3974,22 +3983,38 @@
"example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp"
},
"campaign_id": {
- "type": "string",
+ "type": [
+ "string",
+ "null"
+ ],
"description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.",
"example": "camp_FNYR4jhqZBM9xTptxDGgeNBV"
},
"reason": {
- "type": "string",
+ "type": [
+ "string",
+ "null"
+ ],
"description": "Reason why the transaction occurred. In case of a redemption, this value is `null`."
},
"related_transaction_id": {
- "type": "string",
+ "type": [
+ "string",
+ "null"
+ ],
"description": "This field is `null` in the case of gift voucher transactions."
}
- }
+ },
+ "required": [
+ "voucher_id",
+ "campaign_id",
+ "reason",
+ "related_transaction_id"
+ ]
},
"gift_card_transaction_response_data": {
"type": "object",
+ "title": "Gift Card Transaction Response Data",
"properties": {
"created_at": {
"type": "string",
@@ -3997,7 +4022,10 @@
"example": "2022-02-25T13:32:08.734Z",
"description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format."
}
- }
+ },
+ "required": [
+ "created_at"
+ ]
},
"gift_card_transaction_details": {
"type": "object",
@@ -4014,7 +4042,8 @@
{
"$ref": "#/components/schemas/gift_card_transaction_removal_details"
}
- ]
+ ],
+ "title": "Gift Card Transaction Details"
},
"gift_card_transaction_redemption_details": {
"title": "Redemption",
@@ -4022,11 +4051,10 @@
"type": "object",
"properties": {
"source": {
- "type": "string",
"description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption, this value is `null`.",
- "enum": [
- "voucherify-web-ui",
- "API"
+ "type": [
+ "string",
+ "null"
]
},
"type": {
@@ -4040,15 +4068,30 @@
"details": {
"type": "object",
"description": "Contains the detailed information about the transaction.",
+ "required": [
+ "balance",
+ "order",
+ "redemption"
+ ],
"properties": {
"balance": {
"type": "object",
"description": "Contains information on how the balance was affected by the transaction.",
+ "required": [
+ "type",
+ "total",
+ "amount",
+ "object",
+ "balance",
+ "related_object"
+ ],
"properties": {
"type": {
- "type": "string",
"description": "The type of voucher whose balance is being adjusted due to the transaction.",
- "default": "gift_voucher"
+ "default": "gift_voucher",
+ "enum": [
+ "gift_voucher"
+ ]
},
"total": {
"type": "integer",
@@ -4059,9 +4102,11 @@
"description": "The amount being used up by the redemption. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000."
},
"object": {
- "type": "string",
"description": "The type of object represented by the JSON.",
- "default": "balance"
+ "default": "balance",
+ "enum": [
+ "balance"
+ ]
},
"balance": {
"type": "integer",
@@ -4070,6 +4115,10 @@
"related_object": {
"type": "object",
"description": "Defines the resource that is being modified with the values that are returned in the balance object.",
+ "required": [
+ "id",
+ "type"
+ ],
"properties": {
"id": {
"type": "string",
@@ -4077,9 +4126,11 @@
"example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq"
},
"type": {
- "type": "string",
"description": "The object being modified, i.e. `voucher`.",
- "default": "voucher"
+ "default": "voucher",
+ "enum": [
+ "voucher"
+ ]
}
}
}
@@ -4088,6 +4139,10 @@
"order": {
"type": "object",
"description": "Contains information about the original order.",
+ "required": [
+ "id",
+ "source_id"
+ ],
"properties": {
"id": {
"type": "string",
@@ -4095,7 +4150,10 @@
"example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK"
},
"source_id": {
- "type": "string",
+ "type": [
+ "string",
+ "null"
+ ],
"description": "The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service."
}
}
@@ -4103,6 +4161,9 @@
"redemption": {
"type": "object",
"description": "Contains information about the original redemption.",
+ "required": [
+ "id"
+ ],
"properties": {
"id": {
"type": "string",
@@ -4113,7 +4174,12 @@
}
}
}
- }
+ },
+ "required": [
+ "source",
+ "type",
+ "details"
+ ]
},
"gift_card_transaction_refund_details": {
"title": "Refund",
@@ -4121,12 +4187,11 @@
"type": "object",
"properties": {
"source": {
- "type": "string",
- "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption rollback, this value is `null`.",
- "enum": [
- "voucherify-web-ui",
- "API"
- ]
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption rollback, this value is `null`."
},
"type": {
"type": "string",
@@ -4139,15 +4204,31 @@
"details": {
"type": "object",
"description": "Contains the detailed information about the transaction.",
+ "required": [
+ "balance",
+ "order",
+ "redemption",
+ "rollback"
+ ],
"properties": {
"balance": {
"type": "object",
"description": "Contains information on how the balance was affected by the transaction.",
+ "required": [
+ "type",
+ "total",
+ "amount",
+ "object",
+ "balance",
+ "related_object"
+ ],
"properties": {
"type": {
- "type": "string",
"description": "The type of voucher whose balance is being adjusted due to the transaction.",
- "default": "gift_voucher"
+ "default": "gift_voucher",
+ "enum": [
+ "gift_voucher"
+ ]
},
"total": {
"type": "integer",
@@ -4158,9 +4239,11 @@
"description": "The amount being returned. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000."
},
"object": {
- "type": "string",
"description": "The type of object represented by the JSON.",
- "default": "balance"
+ "default": "balance",
+ "enum": [
+ "balance"
+ ]
},
"balance": {
"type": "integer",
@@ -4169,6 +4252,10 @@
"related_object": {
"type": "object",
"description": "Defines the resource that is being modified with the values that are returned in the balance object.",
+ "required": [
+ "id",
+ "type"
+ ],
"properties": {
"id": {
"type": "string",
@@ -4176,9 +4263,11 @@
"example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq"
},
"type": {
- "type": "string",
"description": "The object being modified, i.e. `voucher`.",
- "default": "voucher"
+ "default": "voucher",
+ "enum": [
+ "voucher"
+ ]
}
}
}
@@ -4187,6 +4276,10 @@
"order": {
"type": "object",
"description": "Contains information about the original order.",
+ "required": [
+ "id",
+ "source_id"
+ ],
"properties": {
"id": {
"type": "string",
@@ -4194,7 +4287,10 @@
"example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK"
},
"source_id": {
- "type": "string",
+ "type": [
+ "string",
+ "null"
+ ],
"description": "The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service."
}
}
@@ -4202,6 +4298,9 @@
"redemption": {
"type": "object",
"description": "Contains information about the original redemption.",
+ "required": [
+ "id"
+ ],
"properties": {
"id": {
"type": "string",
@@ -4213,6 +4312,9 @@
"rollback": {
"type": "object",
"description": "Contains information about the redemption rollback.",
+ "required": [
+ "id"
+ ],
"properties": {
"id": {
"type": "string",
@@ -4223,7 +4325,12 @@
}
}
}
- }
+ },
+ "required": [
+ "source",
+ "type",
+ "details"
+ ]
},
"gift_card_transaction_addition_details": {
"title": "Addition",
@@ -4249,15 +4356,29 @@
"details": {
"type": "object",
"description": "Contains the detailed information about the transaction.",
+ "required": [
+ "balance"
+ ],
"properties": {
"balance": {
"type": "object",
"description": "Contains information on how the balance was affected by the transaction.",
+ "required": [
+ "type",
+ "total",
+ "amount",
+ "object",
+ "balance",
+ "related_object",
+ "operation_type"
+ ],
"properties": {
"type": {
- "type": "string",
"description": "The type of voucher whose balance is being adjusted due to the transaction.",
- "default": "gift_voucher"
+ "default": "gift_voucher",
+ "enum": [
+ "gift_voucher"
+ ]
},
"total": {
"type": "integer",
@@ -4268,9 +4389,11 @@
"description": "The amount being added. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000."
},
"object": {
- "type": "string",
"description": "The type of object represented by the JSON.",
- "default": "balance"
+ "default": "balance",
+ "enum": [
+ "balance"
+ ]
},
"balance": {
"type": "integer",
@@ -4279,6 +4402,10 @@
"related_object": {
"type": "object",
"description": "Defines the resource that is being modified with the values that are returned in the balance object.",
+ "required": [
+ "id",
+ "type"
+ ],
"properties": {
"id": {
"type": "string",
@@ -4286,17 +4413,30 @@
"example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq"
},
"type": {
- "type": "string",
"description": "The object being modified, i.e. `voucher`.",
- "default": "voucher"
+ "default": "voucher",
+ "enum": [
+ "voucher"
+ ]
}
}
+ },
+ "operation_type": {
+ "enum": [
+ "MANUAL",
+ "AUTOMATIC"
+ ]
}
}
}
}
}
- }
+ },
+ "required": [
+ "source",
+ "type",
+ "details"
+ ]
},
"gift_card_transaction_removal_details": {
"title": "Removal",
@@ -4322,15 +4462,29 @@
"details": {
"type": "object",
"description": "Contains the detailed information about the transaction.",
+ "required": [
+ "balance"
+ ],
"properties": {
"balance": {
"type": "object",
"description": "Contains information on how the balance was affected by the transaction.",
+ "required": [
+ "type",
+ "total",
+ "amount",
+ "object",
+ "balance",
+ "related_object",
+ "operation_type"
+ ],
"properties": {
"type": {
- "type": "string",
"description": "The type of voucher whose balance is being adjusted due to the transaction.",
- "default": "gift_voucher"
+ "default": "gift_voucher",
+ "enum": [
+ "gift_voucher"
+ ]
},
"total": {
"type": "integer",
@@ -4341,9 +4495,11 @@
"description": "The amount being subtracted. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000."
},
"object": {
- "type": "string",
"description": "The type of object represented by the JSON.",
- "default": "balance"
+ "default": "balance",
+ "enum": [
+ "balance"
+ ]
},
"balance": {
"type": "integer",
@@ -4352,6 +4508,10 @@
"related_object": {
"type": "object",
"description": "Defines the resource that is being modified with the values that are returned in the balance object.",
+ "required": [
+ "id",
+ "type"
+ ],
"properties": {
"id": {
"type": "string",
@@ -4359,17 +4519,30 @@
"example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq"
},
"type": {
- "type": "string",
"description": "The object being modified, i.e. `voucher`.",
- "default": "voucher"
+ "default": "voucher",
+ "enum": [
+ "voucher"
+ ]
}
}
+ },
+ "operation_type": {
+ "enum": [
+ "MANUAL",
+ "AUTOMATIC"
+ ]
}
}
}
}
}
- }
+ },
+ "required": [
+ "source",
+ "type",
+ "details"
+ ]
},
"1_req_create_gift_card_transactions_export": {
"type": "object",
From df3c7fde7a5dc6ebf7d104d7876629c2b5cc6e98 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Wed, 18 Oct 2023 08:45:17 +0200
Subject: [PATCH 06/21] export voucher transactions
---
Changelog.md | 1 +
...UCHERS-API-Export-Voucher-Transactions.md} | 4 +-
reference/OpenAPI.json | 107 +++++++++---------
3 files changed, 58 insertions(+), 54 deletions(-)
rename docs/reference-docs/{VOUCHERS-API-Export-Gift-Card-Transactions.md => VOUCHERS-API-Export-Voucher-Transactions.md} (84%)
diff --git a/Changelog.md b/Changelog.md
index 0bb8efb1f..198087fb4 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -3,6 +3,7 @@
# 20231017
- Vouchers - List Gift Card Transactions (**GET** `/vouchers/{code}/transactions`) renamed to List Voucher Transactions
+- Vouchers - Export Gift Card Transactions (**GET** `/vouchers/{code}/transactions/export`) renamed to Export Voucher Transactions
## 20231012 - Product Collections
diff --git a/docs/reference-docs/VOUCHERS-API-Export-Gift-Card-Transactions.md b/docs/reference-docs/VOUCHERS-API-Export-Voucher-Transactions.md
similarity index 84%
rename from docs/reference-docs/VOUCHERS-API-Export-Gift-Card-Transactions.md
rename to docs/reference-docs/VOUCHERS-API-Export-Voucher-Transactions.md
index a8ae97057..d5c9a8d9e 100644
--- a/docs/reference-docs/VOUCHERS-API-Export-Gift-Card-Transactions.md
+++ b/docs/reference-docs/VOUCHERS-API-Export-Voucher-Transactions.md
@@ -1,8 +1,8 @@
---
-title: Export Gift Card Transactions
+title: Export Voucher Transactions
type: endpoint
categorySlug: voucherify-api
-slug: export-gift-card-transactions
+slug: export-voucher-transactions
parentDocSlug: vouchers-api
hidden: false
order: 12
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index 79939955c..cad605e16 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -4544,18 +4544,18 @@
"details"
]
},
- "1_req_create_gift_card_transactions_export": {
+ "vouchers_export_transactions_request_body": {
"type": "object",
"title": "Create Gift Card Transactions Export Request Body",
"description": "Request body schema for **POST** `/vouchers/transactions/export`.",
"properties": {
"parameters": {
- "$ref": "#/components/schemas/1_obj_export_gift_card_transactions",
+ "$ref": "#/components/schemas/voucher_transactions_export",
"description": "Contains the parameters that define the data to be exported."
}
}
},
- "1_obj_export_gift_card_transactions": {
+ "voucher_transactions_export_parameters": {
"description": "List of available fields and filters that can be exported with a gift card transactions export along with the sorting order of the returned data.",
"title": "Export Transactions",
"type": "object",
@@ -4571,19 +4571,7 @@
"fields": {
"type": "array",
"enum": [
- [
- "id",
- "type",
- "source_id",
- "reason",
- "balance",
- "amount",
- "created_at",
- "voucher_id",
- "campaign_id",
- "source",
- "details"
- ]
+ "id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,source,details,related_transaction_id"
],
"description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |",
"items": {
@@ -4592,7 +4580,7 @@
}
}
},
- "1_obj_export_transactions_object": {
+ "voucher_transactions_export": {
"title": "Export Object",
"type": "object",
"description": "This is an object representing an export. \n\n Using this endpoint, you can export [gift card transactions](ref:list-gift-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.",
@@ -4603,9 +4591,11 @@
"example": "exp_FFfp9o7daWuJqJCKp5xqqli4"
},
"object": {
- "type": "string",
"default": "export",
- "description": "The type of object being represented. This object stores information about the `export`."
+ "description": "The type of object being represented. This object stores information about the `export`.",
+ "enum": [
+ "export"
+ ]
},
"created_at": {
"type": "string",
@@ -4617,10 +4607,7 @@
"type": "string",
"description": "Status of the export. Informs you whether the export has already been completed, i.e. indicates whether the file containing the exported data has been generated.",
"enum": [
- "SCHEDULED",
- "IN_PROGRESS",
- "DONE",
- "ERROR"
+ "SCHEDULED"
]
},
"channel": {
@@ -4629,16 +4616,24 @@
"default": "API"
},
"exported_object": {
- "type": "string",
"description": "The type of exported object.",
- "default": "voucher_transactions"
+ "default": "voucher_transactions",
+ "enum": [
+ "voucher_transactions"
+ ]
},
"parameters": {
"$ref": "#/components/schemas/16_obj_export_gift_card_transactions"
},
"result": {
- "type": "object",
+ "type": [
+ "object",
+ "null"
+ ],
"description": "Contains the URL of the CSV file.",
+ "required": [
+ "url"
+ ],
"properties": {
"url": {
"type": "string",
@@ -4647,11 +4642,25 @@
}
},
"user_id": {
- "type": "string",
+ "type": [
+ "string",
+ "null"
+ ],
"description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.",
"example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH"
}
- }
+ },
+ "required": [
+ "id",
+ "object",
+ "created_at",
+ "status",
+ "channel",
+ "exported_object",
+ "parameters",
+ "result",
+ "user_id"
+ ]
},
"1_req_vouchers_import": {
"title": "Import Vouchers Request Body",
@@ -35763,8 +35772,8 @@
}
},
"16_obj_export_gift_card_transactions": {
- "description": "List of available fields and filters that can be exported with gift card transactions along with the sorting order of the returned data.",
- "title": "gift card transactions",
+ "description": "List of available fields and filters that can be exported with gift card or loyalty card transactions along with the sorting order of the returned data.",
+ "title": "Voucher Transactions",
"type": "object",
"properties": {
"order": {
@@ -35778,19 +35787,7 @@
"fields": {
"type": "array",
"enum": [
- [
- "id",
- "type",
- "source_id",
- "reason",
- "balance",
- "amount",
- "created_at",
- "voucher_id",
- "campaign_id",
- "source",
- "details"
- ]
+ "id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,source,details,related_transaction_id"
],
"description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |",
"items": {
@@ -35798,9 +35795,12 @@
}
},
"filters": {
- "$ref": "#/components/schemas/16_obj_filter_gift_card_transactions_voucher_id"
+ "$ref": "#/components/schemas/voucher_transactions_export_filter_conditions"
}
- }
+ },
+ "required": [
+ "filters"
+ ]
},
"16_obj_export_loyalty_card_transactions": {
"description": "List of available fields and filters that can be exported with loyalty card transactions along with the sorting order of the returned data.",
@@ -36076,7 +36076,7 @@
}
}
},
- "16_obj_filter_gift_card_transactions_voucher_id": {
+ "voucher_transactions_export_filter_conditions": {
"description": "Filter conditions set on`the `voucher_id`.",
"title": "Filter by voucher ID",
"type": "object",
@@ -36087,7 +36087,10 @@
"junction": {
"$ref": "#/components/schemas/16_filter_junction"
}
- }
+ },
+ "required": [
+ "voucher_id"
+ ]
},
"16_obj_filter_loyalty_card_transactions_voucher_id": {
"description": "Filter conditions set on`the `voucher_id`.",
@@ -48052,7 +48055,7 @@
}
],
"post": {
- "operationId": "export-gift-card-transactions",
+ "operationId": "export-voucher-transactions",
"tags": [
"VOUCHERS API"
],
@@ -48063,14 +48066,14 @@
"X-App-Token-1": []
}
],
- "summary": "Export Gift Card Transactions",
- "description": "Export transactions that are associated with credit movements on a gift card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |",
+ "summary": "Export Voucher Transactions",
+ "description": "Export transactions that are associated with credit movements on a gift card or loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |",
"requestBody": {
"description": "Specify the parameters for the transaction export.",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/1_req_create_gift_card_transactions_export"
+ "$ref": "#/components/schemas/vouchers_export_transactions_request_body"
},
"examples": {
"Example": {
@@ -48103,7 +48106,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/1_obj_export_transactions_object"
+ "$ref": "#/components/schemas/voucher_transactions_export"
},
"examples": {
"Example": {
From cbea76c1b3efe8ac7ed7b3709389d5f029fcd951 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Wed, 18 Oct 2023 08:56:49 +0200
Subject: [PATCH 07/21] Update OpenAPI.json
---
reference/OpenAPI.json | 50 +++++-------------------------------------
1 file changed, 6 insertions(+), 44 deletions(-)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index cad605e16..9a80e9f5d 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -4556,7 +4556,7 @@
}
},
"voucher_transactions_export_parameters": {
- "description": "List of available fields and filters that can be exported with a gift card transactions export along with the sorting order of the returned data.",
+ "description": "List of available fields and filters that can be exported with a gift card or loyalty card transactions export along with the sorting order of the returned data.",
"title": "Export Transactions",
"type": "object",
"properties": {
@@ -4623,7 +4623,7 @@
]
},
"parameters": {
- "$ref": "#/components/schemas/16_obj_export_gift_card_transactions"
+ "$ref": "#/components/schemas/voucher_transactions_filters"
},
"result": {
"type": [
@@ -24603,49 +24603,11 @@
"description": "Request body schema for **POST** `/loyalties/members/{memberId}/transactions/export`.",
"properties": {
"parameters": {
- "$ref": "#/components/schemas/8_obj_export_loyalty_card_transactions",
+ "$ref": "#/components/schemas/voucher_transactions_export_parameters",
"description": "Contains the parameters that define the data to be exported."
}
}
},
- "8_obj_export_loyalty_card_transactions": {
- "description": "List of available fields and filters that can be exported with a loyalty card transactions export along with the sorting order of the returned data.",
- "title": "Export Transactions",
- "type": "object",
- "properties": {
- "order": {
- "type": "string",
- "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.",
- "enum": [
- "-created_at",
- "created_at"
- ]
- },
- "fields": {
- "type": "array",
- "enum": [
- [
- "id",
- "type",
- "source_id",
- "reason",
- "balance",
- "amount",
- "created_at",
- "voucher_id",
- "campaign_id",
- "source",
- "details",
- "related_transaction_id"
- ]
- ],
- "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |",
- "items": {
- "type": "string"
- }
- }
- }
- },
"8_obj_export_transactions_object": {
"title": "Export Object",
"type": "object",
@@ -35294,7 +35256,7 @@
"$ref": "#/components/schemas/16_obj_export_points_expiration"
},
{
- "$ref": "#/components/schemas/16_obj_export_gift_card_transactions"
+ "$ref": "#/components/schemas/voucher_transactions_filters"
},
{
"$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions"
@@ -35386,7 +35348,7 @@
"$ref": "#/components/schemas/16_obj_export_points_expiration"
},
{
- "$ref": "#/components/schemas/16_obj_export_gift_card_transactions"
+ "$ref": "#/components/schemas/voucher_transactions_filters"
},
{
"$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions"
@@ -35771,7 +35733,7 @@
}
}
},
- "16_obj_export_gift_card_transactions": {
+ "voucher_transactions_filters": {
"description": "List of available fields and filters that can be exported with gift card or loyalty card transactions along with the sorting order of the returned data.",
"title": "Voucher Transactions",
"type": "object",
From 11030962aa842237e9b04afe45f6909eb8752dd5 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Wed, 18 Oct 2023 09:34:11 +0200
Subject: [PATCH 08/21] validation rules assignments
---
reference/OpenAPI.json | 42 +++++++++++++++++++++++++++++-------------
1 file changed, 29 insertions(+), 13 deletions(-)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index 9a80e9f5d..da6f58dc7 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -9198,7 +9198,7 @@
"description": "The type of object represented by JSON. This object stores information about the promotion tier."
},
"validation_rule_assignments": {
- "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments"
+ "$ref": "#/components/schemas/validation_rules_list_rules_assignments_response_body"
},
"category_id": {
"type": "string",
@@ -34760,8 +34760,8 @@
}
}
},
- "13_obj_validation_rule_assignment_object": {
- "title": "Validation Rule Assignment Object",
+ "validation_rule_assignment": {
+ "title": "Validation Rule Assignment",
"type": "object",
"description": "This is an object representing a validation rule assignment. \n\nThis object stores an assignment of a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)",
"x-tags": [
@@ -34802,13 +34802,23 @@
"format": "date-time"
},
"object": {
- "type": "string",
"default": "validation_rules_assignment",
- "description": "The type of object represented by the ID."
+ "description": "The type of object represented by the ID.",
+ "enum": [
+ "validation_rules_assignment"
+ ]
}
- }
+ },
+ "required": [
+ "id",
+ "rule_id",
+ "related_object_id",
+ "related_object_type",
+ "created_at",
+ "object"
+ ]
},
- "13_res_validation-rules_validationRuleId_assignments": {
+ "validation_rules_list_rules_assignments_response_body": {
"type": "object",
"description": "Validation Rule Assignments",
"title": "Validation Rule Assignments",
@@ -34827,14 +34837,20 @@
"type": "array",
"description": "A dictionary that contains an array of validation rule assignments.",
"items": {
- "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object"
+ "$ref": "#/components/schemas/validation_rule_assignment"
}
},
"total": {
"type": "integer",
"description": "Total number of validation rule assignments."
}
- }
+ },
+ "required": [
+ "object",
+ "data_ref",
+ "data",
+ "total"
+ ]
},
"13_req_create_validation_rule_assignments": {
"description": "Respone body schema for **POST** `/validation-rules/{validationRuleId}/assignments`.",
@@ -81031,7 +81047,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object"
+ "$ref": "#/components/schemas/validation_rule_assignment"
}
}
}
@@ -81858,7 +81874,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments"
+ "$ref": "#/components/schemas/validation_rules_list_rules_assignments_response_body"
},
"examples": {
"Example": {
@@ -81984,7 +82000,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments"
+ "$ref": "#/components/schemas/validation_rules_list_rules_assignments_response_body"
},
"examples": {
"Example": {
@@ -82081,7 +82097,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object"
+ "$ref": "#/components/schemas/validation_rule_assignment"
},
"examples": {
"Example": {
From c18db1129209d64f6f1569c03cc4c22e6cfecb2d Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Wed, 18 Oct 2023 09:50:47 +0200
Subject: [PATCH 09/21] update md-tables
---
docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md | 6 +++---
docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md | 6 +++---
.../STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md | 6 +++---
...ALIDATION-RULES-API-Validation-Rule-Assignment-Object.md | 4 ++--
reference/OpenAPI.json | 2 +-
scripts/md-tables.ts | 2 +-
6 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md
index aad809190..d909455cb 100644
--- a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md
+++ b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md
@@ -194,7 +194,7 @@ order: 1
|:-----|:--------|
| object`string` | The type of object represented by JSON. This object stores information about validation rule assignments.
|
| data_ref`string` | Identifies the name of the JSON property that contains the array of validation rule assignments.
|
-| data`array` | A dictionary that contains an array of validation rule assignments.
Array of [Validation Rule Assignment Object](#validation-rule-assignment-object) |
+| data`array` | A dictionary that contains an array of validation rule assignments.
Array of [Validation Rule Assignment](#validation-rule-assignment) |
| total`integer` | Total number of validation rule assignments.
|
## Calendar Periods
@@ -211,7 +211,7 @@ order: 1
| unit`string` | Defines the type of unit of time in which the rounding period is counted.
Available values: `MONTH` |
| value`integer` | Value for the unit of time that the rounding applies to. Units for this parameter are defined by the rounding.unit
parameter.
0
: January1
: February2
: March3
: April4
: May5
: June6
: July7
: August8
: September9
: October10
: November11
: December
|
-## Validation Rule Assignment Object
+## Validation Rule Assignment
| Attributes | Description |
|:-----|:--------|
| id`string` | Validation rule assignment ID.
**Example:** asgm_74F7QZoYbUoljwQO
|
@@ -219,7 +219,7 @@ order: 1
| related_object_id`string` | The resource ID to which the validation rule was assigned.
**Example:** v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
| related_object_type`string` | The type of resource to which the validation rule was assigned.
Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` |
| created_at`string` | Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.
**Example:** 2022-02-17T08:18:15.085Z
|
-| object`string` | The type of object represented by the ID.
|
+| object | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
[block:html]
{
diff --git a/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md b/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md
index 747fe1737..c60c6e87e 100644
--- a/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md
+++ b/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md
@@ -88,7 +88,7 @@ order: 1
|:-----|:--------|
| object`string` | The type of object represented by JSON. This object stores information about validation rule assignments.
|
| data_ref`string` | Identifies the name of the JSON property that contains the array of validation rule assignments.
|
-| data`array` | A dictionary that contains an array of validation rule assignments.
Array of [Validation Rule Assignment Object](#validation-rule-assignment-object) |
+| data`array` | A dictionary that contains an array of validation rule assignments.
Array of [Validation Rule Assignment](#validation-rule-assignment) |
| total`integer` | Total number of validation rule assignments.
|
## Category Object
@@ -101,7 +101,7 @@ order: 1
| updated_at`string` | Timestamp representing the date and time when the category was updated in ISO 8601 format.
**Example:** 2022-08-16T10:52:08.094Z
|
| object`string` | The type of object represented by the JSON. This object stores information about the category.
|
-## Validation Rule Assignment Object
+## Validation Rule Assignment
| Attributes | Description |
|:-----|:--------|
| id`string` | Validation rule assignment ID.
**Example:** asgm_74F7QZoYbUoljwQO
|
@@ -109,7 +109,7 @@ order: 1
| related_object_id`string` | The resource ID to which the validation rule was assigned.
**Example:** v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
| related_object_type`string` | The type of resource to which the validation rule was assigned.
Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` |
| created_at`string` | Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.
**Example:** 2022-02-17T08:18:15.085Z
|
-| object`string` | The type of object represented by the ID.
|
+| object | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
[block:html]
{
diff --git a/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md b/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md
index 30b3ff6b7..99e03545e 100644
--- a/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md
+++ b/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md
@@ -403,7 +403,7 @@ One of:
|:-----|:--------|
| object`string` | The type of object represented by JSON. This object stores information about validation rule assignments.
|
| data_ref`string` | Identifies the name of the JSON property that contains the array of validation rule assignments.
|
-| data`array` | A dictionary that contains an array of validation rule assignments.
Array of [Validation Rule Assignment Object](#validation-rule-assignment-object) |
+| data`array` | A dictionary that contains an array of validation rule assignments.
Array of [Validation Rule Assignment](#validation-rule-assignment) |
| total`integer` | Total number of validation rule assignments.
|
## Unstacked Redemption
@@ -411,7 +411,7 @@ One of:
|:-----|:--------|
| redemption_ID`object` | The property name is the unique redemption ID; i.e. r_0ba186c4824e4881e1
. This object contains information about the redemption of an incentive.
Attributes | Description |
---|
datestring | Timestamp representing the date and time when the redemption was created in ISO 8601 format. Example: 2022-09-02T17:06:56.649Z |
related_object_typestring | The source of the incentive. Available values: voucher , promotion_tier |
related_object_idstring | Unique ID of the related object that defines the incentive. |
related_object_parent_idstring | Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign. In case of a promotion tier, this represents the campaign ID of the promotion tier's parent campaign. |
|
-## Validation Rule Assignment Object
+## Validation Rule Assignment
| Attributes | Description |
|:-----|:--------|
| id`string` | Validation rule assignment ID.
**Example:** asgm_74F7QZoYbUoljwQO
|
@@ -419,7 +419,7 @@ One of:
| related_object_id`string` | The resource ID to which the validation rule was assigned.
**Example:** v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
| related_object_type`string` | The type of resource to which the validation rule was assigned.
Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` |
| created_at`string` | Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.
**Example:** 2022-02-17T08:18:15.085Z
|
-| object`string` | The type of object represented by the ID.
|
+| object | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
[block:html]
{
diff --git a/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md b/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md
index 64c763d7b..239083436 100644
--- a/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md
+++ b/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md
@@ -8,7 +8,7 @@ hidden: false
order: 2
---
-## Validation Rule Assignment Object
+## Validation Rule Assignment
| Attributes | Description |
|:-----|:--------|
| id`string` | Validation rule assignment ID.
**Example:** asgm_74F7QZoYbUoljwQO
|
@@ -16,7 +16,7 @@ order: 2
| related_object_id`string` | The resource ID to which the validation rule was assigned.
**Example:** v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
| related_object_type`string` | The type of resource to which the validation rule was assigned.
Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` |
| created_at`string` | Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.
**Example:** 2022-02-17T08:18:15.085Z
|
-| object`string` | The type of object represented by the ID.
|
+| object | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
[block:html]
{
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index da6f58dc7..e626c3ae6 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -4581,7 +4581,7 @@
}
},
"voucher_transactions_export": {
- "title": "Export Object",
+ "title": "Export",
"type": "object",
"description": "This is an object representing an export. \n\n Using this endpoint, you can export [gift card transactions](ref:list-gift-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.",
"properties": {
diff --git a/scripts/md-tables.ts b/scripts/md-tables.ts
index 48f4506f1..ae788b855 100644
--- a/scripts/md-tables.ts
+++ b/scripts/md-tables.ts
@@ -20,7 +20,7 @@ export const mdTables: [string, string?][] = [
['11_obj_sku_object', 'PRODUCTS-API-SKU-Object.md'],
['product_collections_collection_item', 'PRODUCT-COLLECTIONS-API-Product-Collection-Object.md'],
['13_obj_validation_rule_object', 'VALIDATION-RULES-API-Validation-Rule-Object.md'],
- ['13_obj_validation_rule_assignment_object', 'VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md'],
+ ['validation_rule_assignment', 'VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md'],
['14_obj_segment_object', 'SEGMENTS-API-Customer-Segment-Object.md'],
['15_req_track_custom_event', 'EVENTS-API-Custom-Event-Object.md'],
['18_res_list_consents_GET', 'CONSENTS-API-Consents-Object.md'],
From 9b85e6866fb42206f6e475b0d699c46558d8d3e9 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Thu, 19 Oct 2023 12:29:55 +0200
Subject: [PATCH 10/21] update changelog
---
Changelog.md | 42 +++++++++++++++++++++++++++++++++++++++++-
reference/OpenAPI.json | 4 ++--
2 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/Changelog.md b/Changelog.md
index 198087fb4..cbfd27d67 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,10 +1,50 @@
# Changelog
-# 20231017
+# 20231019
- Vouchers - List Gift Card Transactions (**GET** `/vouchers/{code}/transactions`) renamed to List Voucher Transactions
- Vouchers - Export Gift Card Transactions (**GET** `/vouchers/{code}/transactions/export`) renamed to Export Voucher Transactions
+**New models**
+- vouchers_list_vouchers_transactions_response_body (old `1_res_vouchers_code_transactions`)
+- voucher_transaction (old `1_obj_gift_card_transaction_object`)
+- gift_card_transaction
+- gift_card_transaction_identity
+- gift_card_transaction_base
+- gift_card_transaction_created
+- gift_card_transaction_details
+- gift_card_transaction_redemption_details (old `1_obj_gift_card_transaction_object_redemption`)
+- gift_card_transaction_refund_details (old `1_obj_gift_card_transaction_object_refund`)
+- gift_card_transaction_addition_details (old `1_obj_gift_card_transaction_object_addition`)
+- gift_card_transaction_removal_details (old `1_obj_gift_card_transaction_object_removal`)
+
+- vouchers_export_transactions_request_body (old `1_req_create_gift_card_transactions_export`
+- voucher_transactions_export (old `1_obj_export_transactions_object`)
+- voucher_transactions_export_parameters (old `1_obj_export_gift_card_transactions`)
+- voucher_transactions_filters (old `16_obj_export_gift_card_transactions`)
+- voucher_transactions_export_filter_conditions (old `16_obj_filter_gift_card_transactions_voucher_id`)
+
+- validation_rules_list_rules_assignments_response_body (old `13_res_validation-rules_validationRuleId_assignments`)
+- validation_rule_assignment (old `13_obj_validation_rule_assignment_object`)
+
+**Removed models**
+- `8_obj_export_loyalty_card_transactions` - used only in one place, replaced with: `voucher_transactions_export_parameters` in `8_req_create_loyalty_card_transactions_export` schema
+
+**Endpoint changes**
+
+GET /vouchers/{code}/transactions (client.vouchers.listTransactions(code, query))
+POST /vouchers/{code}/transactions/export (client.vouchers.exportTransactions(code, body))
+GET /validation-rules-assignments (client.client.validationRules.listRulesAssignments(validationRuleId))
+
+- Added missing method for endpoint: GET `/vouchers/{code}/transactions (client.vouchers.listTransactions(code, query))`
+ - Response body schema: `vouchers_list_vouchers_transactions_response_body`
+
+- Added missing method for endpoint: POST `/vouchers/{code}/transactions/export (client.vouchers.exportTransactions(code, body))`
+ - Request body schema: `vouchers_export_transactions_request_body`
+
+- Added missing method for endpoint: GET `/validation-rules-assignments (client.client.validationRules.listRulesAssignments(validationRuleId))`
+ - Request body schema: `validation_rules_list_rules_assignments_response_body`
+
## 20231012 - Product Collections
**New models**
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index e626c3ae6..1a2a5921d 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -3944,7 +3944,7 @@
"$ref": "#/components/schemas/gift_card_transaction_base"
},
{
- "$ref": "#/components/schemas/gift_card_transaction_response_data"
+ "$ref": "#/components/schemas/gift_card_transaction_created"
},
{
"$ref": "#/components/schemas/gift_card_transaction_details"
@@ -4012,7 +4012,7 @@
"related_transaction_id"
]
},
- "gift_card_transaction_response_data": {
+ "gift_card_transaction_created": {
"type": "object",
"title": "Gift Card Transaction Response Data",
"properties": {
From f5e044572366f22edb2ce5e1f925a81ebcfb4cea Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Thu, 19 Oct 2023 12:31:00 +0200
Subject: [PATCH 11/21] Update Changelog.md
---
Changelog.md | 4 ----
1 file changed, 4 deletions(-)
diff --git a/Changelog.md b/Changelog.md
index cbfd27d67..66fe5d037 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -32,10 +32,6 @@
**Endpoint changes**
-GET /vouchers/{code}/transactions (client.vouchers.listTransactions(code, query))
-POST /vouchers/{code}/transactions/export (client.vouchers.exportTransactions(code, body))
-GET /validation-rules-assignments (client.client.validationRules.listRulesAssignments(validationRuleId))
-
- Added missing method for endpoint: GET `/vouchers/{code}/transactions (client.vouchers.listTransactions(code, query))`
- Response body schema: `vouchers_list_vouchers_transactions_response_body`
From ad6f4cfcbe3024d5b6db96a1919e9c5ea0c5b343 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Thu, 19 Oct 2023 14:02:17 +0200
Subject: [PATCH 12/21] fix typo
---
reference/OpenAPI.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index 1a2a5921d..517a367a7 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -81828,7 +81828,7 @@
"VALIDATION RULES API"
],
"summary": "List Validation Rules' Assignment(s)",
- "description": "List all validation rules' assignments or filter the results using the related object ID or the validation rule ID query parameters. \n\n## How to retrieve specific validaiton rule assignments(s)\n\n### Related object ID\n\nTo find an assignment for a particular resource, you can use the ID of the object to which the validation rule was assigned. This could be, for example, an ID of a: voucher, campaign, distribution, reward assignment, earning rule, promotion tier. \n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?related_object_id=promo_kJliy076IuJYtuYWSHE9fSuT\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_tZaqxeO8gP4q91jG\",\n \"rule_id\": \"val_WB6ETAiFztw5\",\n \"related_object_id\": \"promo_kJliy076IuJYtuYWSHE9fSuT\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-08-10T10:30:39.986Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 1\n}\n```\n\n### Validation rule ID\n\nYou can use the validation rule ID to find assignment(s) for a specific validation rule.\n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?rule=val_ZEZmA9oit8aU\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_vef0G6d9Al0rABxq\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"camp_rRsfatlwN7unSeUIJDCYedal\",\n \"related_object_type\": \"campaign\",\n \"created_at\": \"2022-06-29T11:43:52.953Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_sFV4wEFvldwIvgfb\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"distr_9QKI02wqgjWyvZXeQkFEPmkkYe\",\n \"related_object_type\": \"distribution\",\n \"created_at\": \"2022-06-29T11:41:07.680Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_69Qifyv6UZynFIIQ\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"promo_g83qUzYZpfX0OMAFOVoQuOYG\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-06-29T11:29:41.906Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 3\n}\n```\n",
+ "description": "List all validation rules' assignments or filter the results using the related object ID or the validation rule ID query parameters. \n\n## How to retrieve specific validation rule assignments(s)\n\n### Related object ID\n\nTo find an assignment for a particular resource, you can use the ID of the object to which the validation rule was assigned. This could be, for example, an ID of a: voucher, campaign, distribution, reward assignment, earning rule, promotion tier. \n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?related_object_id=promo_kJliy076IuJYtuYWSHE9fSuT\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_tZaqxeO8gP4q91jG\",\n \"rule_id\": \"val_WB6ETAiFztw5\",\n \"related_object_id\": \"promo_kJliy076IuJYtuYWSHE9fSuT\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-08-10T10:30:39.986Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 1\n}\n```\n\n### Validation rule ID\n\nYou can use the validation rule ID to find assignment(s) for a specific validation rule.\n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?rule=val_ZEZmA9oit8aU\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_vef0G6d9Al0rABxq\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"camp_rRsfatlwN7unSeUIJDCYedal\",\n \"related_object_type\": \"campaign\",\n \"created_at\": \"2022-06-29T11:43:52.953Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_sFV4wEFvldwIvgfb\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"distr_9QKI02wqgjWyvZXeQkFEPmkkYe\",\n \"related_object_type\": \"distribution\",\n \"created_at\": \"2022-06-29T11:41:07.680Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_69Qifyv6UZynFIIQ\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"promo_g83qUzYZpfX0OMAFOVoQuOYG\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-06-29T11:29:41.906Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 3\n}\n```\n",
"parameters": [
{
"schema": {
From 7f3112caff20bfc3eca0b2ca3694af43e9878ada Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Thu, 19 Oct 2023 14:34:29 +0200
Subject: [PATCH 13/21] update scripts
---
scripts/manage-project.ts | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts
index 4002e5099..50c6493b1 100644
--- a/scripts/manage-project.ts
+++ b/scripts/manage-project.ts
@@ -80,11 +80,11 @@ const isVersionExists = async (version: string) => {
const uploadReferenceDocsWithMaxNumberOfAttempts = async (
version,
- maxNumberOfUploadingAttempts = 6
+ maxNumberOfUploadingAttempts = 3
) => {
console.log(colors.green("UPLOADING REFERENCE DOC FILES..."));
for (let i = 1; i <= maxNumberOfUploadingAttempts; i++) {
- await new Promise((r) => setTimeout(r, 5000));
+ await new Promise((r) => setTimeout(r, 10000));
const success = await runCliProcess({
command: `rdme docs ./docs/reference-docs --version=${version}`,
stdoutIncludes: "successfully created",
@@ -122,12 +122,12 @@ const runCliProcess = async ({
) {
return resolve(true);
}
+ if (stderr) {
+ console.log("Error: \n", stderr)
+ }
if (resolveErrorAsFalse) {
return resolve(false);
}
- if (stderr) {
- console.log(stderr);
- }
throw error;
});
});
@@ -230,7 +230,7 @@ const cleanProject = async (version) => {
);
console.log(colors.green(`REFERENCE CATEGORIES UPDATED!`));
const allApiSpecifications = await getAllApiSpecifications(version);
- await asyncMap(allApiSpecifications, deleteSpecification);
+ await asyncMap(allApiSpecifications, (apiSpecification) => deleteSpecification(apiSpecification.id));
console.log(colors.green(`API SPECIFICATIONS DELETED!`));
console.log(colors.green(`VERSION "${version}" IS CLEANED UP!`));
return;
From 97c6ce8c8c7f7110d319e93e550d6a0866599ab0 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Thu, 19 Oct 2023 14:34:42 +0200
Subject: [PATCH 14/21] fix operationId
---
reference/OpenAPI.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index 517a367a7..e5be0bdc3 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -47735,7 +47735,7 @@
}
],
"get": {
- "operationId": "list-gift-card-transactions",
+ "operationId": "list-voucher-transactions",
"tags": [
"VOUCHERS API"
],
From dc3f2106a1969df858b896a817ad609d66b77a34 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Thu, 19 Oct 2023 17:13:59 +0200
Subject: [PATCH 15/21] update descriptions
---
reference/OpenAPI.json | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index e5be0bdc3..fd25b7729 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -4573,7 +4573,7 @@
"enum": [
"id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,source,details,related_transaction_id"
],
- "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |",
+ "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION`
- `POINTS_ACCRUAL`
- `POINTS_CANCELLATION`
- `POINTS_REDEMPTION`
- `POINTS_REFUND`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_EXPIRATION`
- `POINTS_TRANSFER_IN`
- `POINTS_TRANSFER_OUT` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card or loyalty card balance after the transaction. | |\n| amount | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |",
"items": {
"type": "string"
}
@@ -4583,7 +4583,7 @@
"voucher_transactions_export": {
"title": "Export",
"type": "object",
- "description": "This is an object representing an export. \n\n Using this endpoint, you can export [gift card transactions](ref:list-gift-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.",
+ "description": "This is an object representing an export. \n\n Using this endpoint, you can export voucher transactions as a CSV file. This functionality works asynchronously and comes down to the following steps: create an export object and return its id so you can track its status, trigger a CSV file generation, change the status to SCHEDULED when the generation is over, store the file in S3 and change the status to DONE. Now you can download it.\n\nWith parameters you can select which fields will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.",
"properties": {
"id": {
"type": "string",
@@ -34763,7 +34763,7 @@
"validation_rule_assignment": {
"title": "Validation Rule Assignment",
"type": "object",
- "description": "This is an object representing a validation rule assignment. \n\nThis object stores an assignment of a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)",
+ "description": "This is an object representing a validation rule assignment.",
"x-tags": [
"VALIDATION RULES API"
],
@@ -35767,7 +35767,7 @@
"enum": [
"id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,source,details,related_transaction_id"
],
- "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |",
+ "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION`
- `POINTS_ACCRUAL`
- `POINTS_CANCELLATION`
- `POINTS_REDEMPTION`
- `POINTS_REFUND`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_EXPIRATION`
- `POINTS_TRANSFER_IN`
- `POINTS_TRANSFER_OUT` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card or loyalty card balance after the transaction. | |\n| amount | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |",
"items": {
"type": "string"
}
@@ -48045,7 +48045,7 @@
}
],
"summary": "Export Voucher Transactions",
- "description": "Export transactions that are associated with credit movements on a gift card or loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |",
+ "description": "Export transactions that are associated with credit movements on a gift card or loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION`
- `POINTS_ACCRUAL`
- `POINTS_CANCELLATION`
- `POINTS_REDEMPTION`
- `POINTS_REFUND`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_EXPIRATION`
- `POINTS_TRANSFER_IN`
- `POINTS_TRANSFER_OUT` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card or loyalty card balance after the transaction. | |\n| amount | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |",
"requestBody": {
"description": "Specify the parameters for the transaction export.",
"content": {
@@ -83675,7 +83675,7 @@
"EXPORTS API"
],
"summary": "Create Export",
- "description": "Create export object. The export can be any of the following types: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\n## Defaults\n\nIf you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object:\n\n| **Export Object** | **Default fields returned** |\n|:---|:---|\n| order | `id`, `source_id`, `status` |\n| voucher | `code`, `voucher_type`, `value`, `discount_type` |\n| publication | `code`, `customer_id`, `date`, `channel` |\n| redemption | `id`, `object`, `voucher_code`, `customer_id`, `date`, `result` |\n| customer | `name`, `source_id` |\n| points_expiration | `id`, `campaign_id`, `voucher_id`, `status`, `expires_at`, `points` |\n| voucher_transactions | `id`, `type`, `source_id`, `status`, `reason`, `source`, `balance`, `amount`, `created_at` |\n\n\n## Fetching particular data sets\n\nUsing the `parameters` body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n## Orders \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Order metadata; expressed as metadata.X, where X is the name of the custom metadata property. | 1 |\n\n## Vouchers \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
`GIFT_VOUCHER`: amount left to spend
`LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| metadata | Custom voucher metadata. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of `P2D` will be active every other day. | P2D |\n| validity_timeframe_duration | Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of `PT1H` will be valid for a duration of one hour. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n\n\n## Publications\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Custom publication metadata. | |\n\n## Redemptions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Custom redemption metadata. | |\n\n## Customers\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | 2000 |\n| loyalty_referred_customers | How many customers were referred by this customer. | 3 |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| metadata | Customer metadata. | All metadata fields defined in Metadata Schema for the Customer object. |\n| birthdate | Customer's birthdate. | 2022-01-01 |\n\n## Points Expirations\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |\n\n ## Gift Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n\n ## Loyalty Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |",
+ "description": "Create export object. The export can be any of the following types: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\n## Defaults\n\nIf you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object:\n\n| **Export Object** | **Default fields returned** |\n|:---|:---|\n| order | `id`, `source_id`, `status` |\n| voucher | `code`, `voucher_type`, `value`, `discount_type` |\n| publication | `code`, `customer_id`, `date`, `channel` |\n| redemption | `id`, `object`, `voucher_code`, `customer_id`, `date`, `result` |\n| customer | `name`, `source_id` |\n| points_expiration | `id`, `campaign_id`, `voucher_id`, `status`, `expires_at`, `points` |\n| voucher_transactions | `id`, `type`, `source_id`, `status`, `reason`, `source`, `balance`, `amount`, `created_at` |\n\n\n## Fetching particular data sets\n\nUsing the `parameters` body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n## Orders \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Order metadata; expressed as metadata.X, where X is the name of the custom metadata property. | 1 |\n\n## Vouchers \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
`GIFT_VOUCHER`: amount left to spend
`LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| metadata | Custom voucher metadata. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of `P2D` will be active every other day. | P2D |\n| validity_timeframe_duration | Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of `PT1H` will be valid for a duration of one hour. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n\n\n## Publications\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Custom publication metadata. | |\n\n## Redemptions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Custom redemption metadata. | |\n\n## Customers\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | 2000 |\n| loyalty_referred_customers | How many customers were referred by this customer. | 3 |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| metadata | Customer metadata. | All metadata fields defined in Metadata Schema for the Customer object. |\n| birthdate | Customer's birthdate. | 2022-01-01 |\n\n## Points Expirations\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |\n\n ## Gift Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card or loyalty card balance after the transaction. | |\n| amount | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n\n ## Loyalty Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |",
"parameters": [],
"security": [
{
From c916ae2c2a92603dcd8b8379be0fac1e30aa545f Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Fri, 20 Oct 2023 09:12:56 +0200
Subject: [PATCH 16/21] fix wrong request body for export
---
reference/OpenAPI.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index fd25b7729..8fda84970 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -4550,7 +4550,7 @@
"description": "Request body schema for **POST** `/vouchers/transactions/export`.",
"properties": {
"parameters": {
- "$ref": "#/components/schemas/voucher_transactions_export",
+ "$ref": "#/components/schemas/voucher_transactions_export_parameters",
"description": "Contains the parameters that define the data to be exported."
}
}
From c9334d65c2cc1ae257d524873a13c5964afced42 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Fri, 20 Oct 2023 09:16:31 +0200
Subject: [PATCH 17/21] fix typos
---
reference/OpenAPI.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index 8fda84970..5b48d9776 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -36042,7 +36042,7 @@
}
},
"16_obj_filter_points_expiration_voucher_id": {
- "description": "Filter conditions set on`the `voucher_id`.",
+ "description": "Filter conditions set on the `voucher_id`.",
"title": "Filter by voucher ID",
"type": "object",
"properties": {
@@ -36055,7 +36055,7 @@
}
},
"voucher_transactions_export_filter_conditions": {
- "description": "Filter conditions set on`the `voucher_id`.",
+ "description": "Filter conditions set on the `voucher_id`.",
"title": "Filter by voucher ID",
"type": "object",
"properties": {
@@ -36071,7 +36071,7 @@
]
},
"16_obj_filter_loyalty_card_transactions_voucher_id": {
- "description": "Filter conditions set on`the `voucher_id`.",
+ "description": "Filter conditions set on the `voucher_id`.",
"title": "Filter by voucher ID",
"type": "object",
"properties": {
From 996f9b640f4351daf95ed433d7f56238f1c77081 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Fri, 20 Oct 2023 09:34:15 +0200
Subject: [PATCH 18/21] add type array to data
---
reference/OpenAPI.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index 5b48d9776..0259e825d 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -3906,6 +3906,7 @@
"description": "Identifies the name of the attribute that contains the array of transaction objects."
},
"data": {
+ "type": "array",
"$ref": "#/components/schemas/voucher_transaction",
"description": "A dictionary that contains an array of transactions. Each entry in the array is a separate transaction object."
},
From 4c6a443a857653a0707f960a1b8c5c275cdc1b5f Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Fri, 20 Oct 2023 10:22:01 +0200
Subject: [PATCH 19/21] update gift card transactions
---
reference/OpenAPI.json | 102 ++++++++++++++++++++++++++++-------------
1 file changed, 70 insertions(+), 32 deletions(-)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index 0259e825d..3f9d64e16 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -3937,20 +3937,76 @@
"gift_card_transaction": {
"title": "Gift Card Transaction",
"description": "List of gift card transactions",
- "allOf": [
- {
- "$ref": "#/components/schemas/gift_card_transaction_identity"
- },
- {
- "$ref": "#/components/schemas/gift_card_transaction_base"
- },
- {
- "$ref": "#/components/schemas/gift_card_transaction_created"
- },
- {
- "$ref": "#/components/schemas/gift_card_transaction_details"
- }
- ]
+ "anyOf": [
+ {
+ "title": "Redemption",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_identity"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_base"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_created"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_redemption_details"
+ }
+ ]
+ },
+ {
+ "title": "Refund",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_identity"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_base"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_created"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_refund_details"
+ }
+ ]
+ },
+ {
+ "title": "Addition",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_identity"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_base"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_created"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_addition_details"
+ }
+ ]
+ },
+ {
+ "title": "Removal",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_identity"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_base"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_created"
+ },
+ {
+ "$ref": "#/components/schemas/gift_card_transaction_removal_details"
+ }
+ ]
+ }
+ ]
},
"gift_card_transaction_identity": {
"type": "object",
@@ -4028,24 +4084,6 @@
"created_at"
]
},
- "gift_card_transaction_details": {
- "type": "object",
- "anyOf": [
- {
- "$ref": "#/components/schemas/gift_card_transaction_redemption_details"
- },
- {
- "$ref": "#/components/schemas/gift_card_transaction_refund_details"
- },
- {
- "$ref": "#/components/schemas/gift_card_transaction_addition_details"
- },
- {
- "$ref": "#/components/schemas/gift_card_transaction_removal_details"
- }
- ],
- "title": "Gift Card Transaction Details"
- },
"gift_card_transaction_redemption_details": {
"title": "Redemption",
"description": "When credits are used to pay for an order.",
From c9e95c563502137b5fe6186b1314b640ebc334b8 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Fri, 20 Oct 2023 11:45:14 +0200
Subject: [PATCH 20/21] update type of object
---
reference/OpenAPI.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json
index 1fb53e633..55e56823e 100644
--- a/reference/OpenAPI.json
+++ b/reference/OpenAPI.json
@@ -35043,6 +35043,7 @@
"format": "date-time"
},
"object": {
+ "type": "string",
"default": "validation_rules_assignment",
"description": "The type of object represented by the ID.",
"enum": [
From 683f3f16a487030c61bbe40a61489a38246072a8 Mon Sep 17 00:00:00 2001
From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com>
Date: Fri, 20 Oct 2023 11:46:25 +0200
Subject: [PATCH 21/21] object: type - string update reference-docs
---
docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md | 2 +-
docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md | 2 +-
.../STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md | 2 +-
.../VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md
index d909455cb..76c0acee2 100644
--- a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md
+++ b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md
@@ -219,7 +219,7 @@ order: 1
| related_object_id`string` | The resource ID to which the validation rule was assigned.
**Example:** v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
| related_object_type`string` | The type of resource to which the validation rule was assigned.
Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` |
| created_at`string` | Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.
**Example:** 2022-02-17T08:18:15.085Z
|
-| object | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
+| object`string` | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
[block:html]
{
diff --git a/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md b/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md
index c60c6e87e..70f2bd04c 100644
--- a/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md
+++ b/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md
@@ -109,7 +109,7 @@ order: 1
| related_object_id`string` | The resource ID to which the validation rule was assigned.
**Example:** v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
| related_object_type`string` | The type of resource to which the validation rule was assigned.
Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` |
| created_at`string` | Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.
**Example:** 2022-02-17T08:18:15.085Z
|
-| object | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
+| object`string` | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
[block:html]
{
diff --git a/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md b/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md
index 99e03545e..16286956c 100644
--- a/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md
+++ b/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md
@@ -419,7 +419,7 @@ One of:
| related_object_id`string` | The resource ID to which the validation rule was assigned.
**Example:** v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
| related_object_type`string` | The type of resource to which the validation rule was assigned.
Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` |
| created_at`string` | Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.
**Example:** 2022-02-17T08:18:15.085Z
|
-| object | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
+| object`string` | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
[block:html]
{
diff --git a/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md b/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md
index 239083436..e1f42bf89 100644
--- a/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md
+++ b/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md
@@ -16,7 +16,7 @@ order: 2
| related_object_id`string` | The resource ID to which the validation rule was assigned.
**Example:** v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
| related_object_type`string` | The type of resource to which the validation rule was assigned.
Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` |
| created_at`string` | Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.
**Example:** 2022-02-17T08:18:15.085Z
|
-| object | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
+| object`string` | The type of object represented by the ID.
Available values: `validation_rules_assignment` |
[block:html]
{