From 5662902ae7dafbc2fea34073530a45a7e962c06a Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:46:00 +0200 Subject: [PATCH 01/10] Update Changelog.md --- Changelog.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 6ea39e7c8..84db8daf4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,31 @@ # Changelog +## 20230829 + +**Added schemas** +- customers_permanent_deletion_response_body +- customers_update_customers_metadata_in_bulk_request_body +- customers_update_customers_in_bulk_request_body + + +**Endpoints changes** +- `/v1/customers/{customerId}/permanent-deletion` + - POST + - Response schema was replaced with `customers_permanent_deletion_response_body` (old `9_res_customers_customerId_permanent-deletion`) + - `status` default value was set to `DONE` + - `data_json.customer` default value was set to 1 + - Added `required` to response properties +- `v1/customers/bulk/async` + - POST + - Request schema was replaced with `customers_update_customers_in_bulk_request_body` (old `9_req_update_customers_bulk-deletion`) + - Set as `required`: `async_action_id` property in `a_res_async_actions` model +- `v1/customers/metadata/async` + - POST + - Request schema was replaced with `customers_update_customers_metadata_in_bulk_request_body` (old `9_req_customers_metadata_async`) + - Set as `required`: `async_action_id` property in `a_res_async_actions` model + ## 20230929 - Order references/guides script -- Changes on Performance and Qualification guidlines pages +- Changes on Performance and Qualification guidelines pages - Added links to qualification guide in endpoints and qualification object schema. ## 20230928 - Order references/guides script From 5d9329afa17b7428a23d958492be719acbc7bca7 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:46:08 +0200 Subject: [PATCH 02/10] Update OpenAPI.json --- reference/OpenAPI.json | 53 +++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 0d7133b29..172408546 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -31701,7 +31701,7 @@ } } }, - "9_res_customers_customerId_permanent-deletion": { + "customers_permanent_deletion_response_body": { "type": "object", "title": "Customer Permanent Deletion Response Body", "description": "Response body schema for `/customers/{customerId}/permanent-deletion`.", @@ -31729,11 +31729,21 @@ }, "status": { "type": "string", - "description": "Deletion status." + "description": "Deletion status.", + "default": "DONE" }, "data_json": { "type": "object", "description": "Statistics summarizing the number of related information that was deleted.", + "required": [ + "events", + "customer_events", + "daily_events", + "segments", + "orders", + "order_events", + "customer" + ], "properties": { "events": { "type": "integer", @@ -31761,7 +31771,8 @@ }, "customer": { "type": "integer", - "description": "Number of customers deleted." + "description": "Number of customers deleted.", + "default": 1 } } }, @@ -31770,9 +31781,18 @@ "description": "The type of object represented by JSON.", "default": "pernament_deletion" } - } + }, + "required": [ + "id", + "created_at", + "related_object_id", + "related_object", + "status", + "data_json", + "object" + ] }, - "9_req_customers_metadata_async": { + "customers_update_customers_metadata_in_bulk_request_body": { "type": "object", "title": "Update Customers' Metadata in bulk Request Body", "description": "Request body schema for `/customers/metadata/async`.", @@ -31794,18 +31814,10 @@ "metadata" ] }, - "9_req_update_customers_bulk": { - "type": "array", + "customers_update_customers_in_bulk_request_body": { + "type": "object", "title": "Update Customers in bulk Request Body", "description": "Request body schema for `/customers/bulk/async`.", - "items": { - "$ref": "#/components/schemas/9_req_update_customers_bulk_customer_object" - } - }, - "9_req_update_customers_bulk_customer_object": { - "type": "object", - "title": "Customer object", - "description": "This is an object containing information about the customer.", "properties": { "source_id": { "type": "string", @@ -39223,7 +39235,10 @@ "example": "aa_0a875d56c805df6601", "description": "The ID of the scheduled asynchronous action." } - } + }, + "required": [ + "async_action_id" + ] }, "error": { "title": "error", @@ -71826,7 +71841,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/9_res_customers_customerId_permanent-deletion" + "$ref": "#/components/schemas/customers_permanent_deletion_response_body" }, "examples": { "Example": { @@ -71945,7 +71960,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/9_req_update_customers_bulk" + "$ref": "#/components/schemas/customers_update_customers_in_bulk_request_body" }, "examples": { "Example": { @@ -72100,7 +72115,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/9_req_customers_metadata_async" + "$ref": "#/components/schemas/customers_update_customers_metadata_in_bulk_request_body" }, "examples": { "Example": { From f05001b40f1322bc0fe2c633d67938f897cb9b71 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Mon, 2 Oct 2023 14:52:29 +0200 Subject: [PATCH 03/10] delete `customers` from name --- Changelog.md | 8 ++++---- reference/OpenAPI.json | 13 ++++--------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Changelog.md b/Changelog.md index 84db8daf4..6988c1b04 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,8 +4,8 @@ **Added schemas** - customers_permanent_deletion_response_body -- customers_update_customers_metadata_in_bulk_request_body -- customers_update_customers_in_bulk_request_body +- customers_update_metadata_in_bulk_request_body +- customers_update_in_bulk_request_body **Endpoints changes** @@ -17,11 +17,11 @@ - Added `required` to response properties - `v1/customers/bulk/async` - POST - - Request schema was replaced with `customers_update_customers_in_bulk_request_body` (old `9_req_update_customers_bulk-deletion`) + - Request schema was replaced with `customers_update_in_bulk_request_body` (old `9_req_update_customers_bulk-deletion`) - Set as `required`: `async_action_id` property in `a_res_async_actions` model - `v1/customers/metadata/async` - POST - - Request schema was replaced with `customers_update_customers_metadata_in_bulk_request_body` (old `9_req_customers_metadata_async`) + - Request schema was replaced with `customers_update_metadata_in_bulk_request_body` (old `9_req_customers_metadata_async`) - Set as `required`: `async_action_id` property in `a_res_async_actions` model ## 20230929 - Order references/guides script diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 172408546..b3ebc39a4 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -31792,7 +31792,7 @@ "object" ] }, - "customers_update_customers_metadata_in_bulk_request_body": { + "customers_update_metadata_in_bulk_request_body": { "type": "object", "title": "Update Customers' Metadata in bulk Request Body", "description": "Request body schema for `/customers/metadata/async`.", @@ -31814,7 +31814,7 @@ "metadata" ] }, - "customers_update_customers_in_bulk_request_body": { + "customers_update_in_bulk_request_body": { "type": "object", "title": "Update Customers in bulk Request Body", "description": "Request body schema for `/customers/bulk/async`.", @@ -31874,11 +31874,6 @@ "description": "Customer's birthdate; format `YYYY-MM-DD`.", "format": "date" }, - "birthday": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, "metadata": { "type": "object", "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " @@ -71960,7 +71955,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/customers_update_customers_in_bulk_request_body" + "$ref": "#/components/schemas/customers_update_in_bulk_request_body" }, "examples": { "Example": { @@ -72115,7 +72110,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/customers_update_customers_metadata_in_bulk_request_body" + "$ref": "#/components/schemas/customers_update_metadata_in_bulk_request_body" }, "examples": { "Example": { From 3f534dc756fd963fa9765d2a55ac5b42ae0b8f07 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:36:18 +0200 Subject: [PATCH 04/10] fix typo --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5b6d24d56..1d9a3d129 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,10 +98,10 @@ Good practices: ### Prerequisites -- Instal `git`, `nodejs`, and `npm`. +- Install `git`, `nodejs`, and `npm`. - Clone repository locally: `git clone https://github.com/voucherifyio/voucherify-openapi`. - Ensure you have the readme.io account with access to the `Voucherify` project (ask your line manager for help). -- Instal `rdme` tool (readme.io CLI): follow the installation instructions from https://github.com/readmeio/rdme#readme website. +- Install `rdme` tool (readme.io CLI): follow the installation instructions from https://github.com/readmeio/rdme#readme website. - Authenticate `rdme` tool by running: `rdme login` command; you can check if it works using the command `rdme whoami`; what should result: `You are currently logged in as xxx@voucherify.io to the voucherify project.` - Copy `.env.example` to `.env` and add to this file your personal API Key created in readme.io: `dashboard` > `configuration` > `API Keys` From 62c7bf90bdf2c8a1925745f0db03b63011143c72 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:35:06 +0200 Subject: [PATCH 05/10] update customers_update_in_bulk_request_body --- reference/OpenAPI.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index b3ebc39a4..d6037eca5 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -31815,6 +31815,14 @@ ] }, "customers_update_in_bulk_request_body": { + "type": "array", + "title": "Update Customers in bulk Request Body", + "description": "Request body schema for `/customers/bulk/async`.", + "items": { + "$ref": "#/components/schemas/customers_update_in_bulk_item_request_body" + } + }, + "customers_update_in_bulk_item_request_body": { "type": "object", "title": "Update Customers in bulk Request Body", "description": "Request body schema for `/customers/bulk/async`.", From d168ce775e75f6ef22ddab60275097e7575e2fea Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:52:32 +0200 Subject: [PATCH 06/10] add nullable to all props in customer --- reference/OpenAPI.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index d6037eca5..982f700cb 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -31828,61 +31828,75 @@ "description": "Request body schema for `/customers/bulk/async`.", "properties": { "source_id": { + "nullable": true, "type": "string", "description": "Unique customer source ID." }, "name": { + "nullable": true, "type": "string", "description": "Customer's first and last name." }, "description": { + "nullable": true, "type": "string", "description": "An arbitrary string that you can attach to a customer object." }, "email": { + "nullable": true, "type": "string", "description": "Customer's email address." }, "phone": { + "nullable": true, "type": "string", "description": "Customer's phone number." }, "address": { "type": "object", "description": "Customer's address.", + "nullable": true, "properties": { "city": { + "nullable": true, "type": "string", "description": "City" }, "state": { + "nullable": true, "type": "string", "description": "State" }, "line_1": { + "nullable": true, "type": "string", "description": "First line of address." }, "line_2": { + "nullable": true, "type": "string", "description": "Second line of address." }, "country": { + "nullable": true, "type": "string", "description": "Country." }, "postal_code": { + "nullable": true, "type": "string", "description": "Postal code." } } }, "birthdate": { + "nullable": true, "type": "string", "description": "Customer's birthdate; format `YYYY-MM-DD`.", "format": "date" }, "metadata": { + "nullable": true, "type": "object", "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " } From 40931394d7834ae3d219b417ac0aff9f85f1c51b Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:28:15 +0200 Subject: [PATCH 07/10] Revert "add nullable to all props in customer" This reverts commit d168ce775e75f6ef22ddab60275097e7575e2fea. --- reference/OpenAPI.json | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 982f700cb..d6037eca5 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -31828,75 +31828,61 @@ "description": "Request body schema for `/customers/bulk/async`.", "properties": { "source_id": { - "nullable": true, "type": "string", "description": "Unique customer source ID." }, "name": { - "nullable": true, "type": "string", "description": "Customer's first and last name." }, "description": { - "nullable": true, "type": "string", "description": "An arbitrary string that you can attach to a customer object." }, "email": { - "nullable": true, "type": "string", "description": "Customer's email address." }, "phone": { - "nullable": true, "type": "string", "description": "Customer's phone number." }, "address": { "type": "object", "description": "Customer's address.", - "nullable": true, "properties": { "city": { - "nullable": true, "type": "string", "description": "City" }, "state": { - "nullable": true, "type": "string", "description": "State" }, "line_1": { - "nullable": true, "type": "string", "description": "First line of address." }, "line_2": { - "nullable": true, "type": "string", "description": "Second line of address." }, "country": { - "nullable": true, "type": "string", "description": "Country." }, "postal_code": { - "nullable": true, "type": "string", "description": "Postal code." } } }, "birthdate": { - "nullable": true, "type": "string", "description": "Customer's birthdate; format `YYYY-MM-DD`.", "format": "date" }, "metadata": { - "nullable": true, "type": "object", "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " } From 3cf164c2b2f41764d99e499c119bc8b9fcc26a1f Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:54:31 +0200 Subject: [PATCH 08/10] Update OpenAPI.json --- reference/OpenAPI.json | 78 +++++++++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 17 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index d6037eca5..679c0f2aa 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -31823,67 +31823,111 @@ } }, "customers_update_in_bulk_item_request_body": { - "type": "object", + "type": [ + "object", + "null" + ], "title": "Update Customers in bulk Request Body", "description": "Request body schema for `/customers/bulk/async`.", "properties": { "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Unique customer source ID." }, "name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Customer's first and last name." }, "description": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "An arbitrary string that you can attach to a customer object." }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Customer's email address." }, "phone": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Customer's phone number." }, "address": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "Customer's address.", "properties": { "city": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "City" }, "state": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "State" }, "line_1": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "First line of address." }, "line_2": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Second line of address." }, "country": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country." }, "postal_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Postal code." } } }, "birthdate": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" + "type": [ + "string", + "null" + ], + "description": "Customer's birthdate; format `YYYY-MM-DD`." }, "metadata": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " } }, From 41c1e9a9f7d385061ca0b2d2ed65a9922533e526 Mon Sep 17 00:00:00 2001 From: Marcin Slezak Date: Thu, 5 Oct 2023 10:36:15 +0200 Subject: [PATCH 09/10] update CONTRIBUTING description --- CONTRIBUTING.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d9a3d129..bc5258e7a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -119,7 +119,10 @@ Good practices: - Update tables in markdown tables: - `npm run build-md-tables-from-openapi` - `npm run update-md-tables-in-doc` - - If before created, remove from API Reference the existing OpenAPI file and all specification files. + - from API Reference page in readme dashboard: + - remove Voucherify OpenAPI Definition + - refresh the page and remove `VOUCHERIFY API` category from left sidebar, DO NOT REMOVE `INTRODUCTION` catregory from left sidebar + the existing OpenAPI file and all specification files. - Deploy OpenAPI file by command `rdme openapi ./reference/OpenAPI.json --version=2018-08-01-{your name}-{pull request number}`, choose `Create a new spec` option. Command most likely will fail with the message: `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks`, but so far, we see that this operation still works correctly. - Deploy guides pages: `rdme docs ./docs/guides --version=2018-08-01-{your name}-{pull request number}` - Deploy api reference pages: `rdme docs ./docs/reference-docs --version=2018-08-01-{your name}-{pull request number}` From 5086310d69a15168a494934ac45d31ecf1a28b6a Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 5 Oct 2023 11:01:14 +0200 Subject: [PATCH 10/10] update nullables --- reference/OpenAPI.json | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 679c0f2aa..515007b09 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -31823,18 +31823,11 @@ } }, "customers_update_in_bulk_item_request_body": { - "type": [ - "object", - "null" - ], "title": "Update Customers in bulk Request Body", "description": "Request body schema for `/customers/bulk/async`.", "properties": { "source_id": { - "type": [ - "string", - "null" - ], + "type": "string", "description": "Unique customer source ID." }, "name": { @@ -31866,10 +31859,7 @@ "description": "Customer's phone number." }, "address": { - "type": [ - "object", - "null" - ], + "type": "object", "description": "Customer's address.", "properties": { "city": {