Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wk/types 004 - new methods in Customer #480

Merged
merged 10 commits into from
Oct 9, 2023
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] 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`

Expand Down
26 changes: 25 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
# Changelog

## 20230829

**Added schemas**
- customers_permanent_deletion_response_body
- customers_update_metadata_in_bulk_request_body
- customers_update_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_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_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
Expand Down
70 changes: 51 additions & 19 deletions reference/OpenAPI.json
Original file line number Diff line number Diff line change
Expand Up @@ -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`.",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -31761,7 +31771,8 @@
},
"customer": {
"type": "integer",
"description": "Number of customers deleted."
"description": "Number of customers deleted.",
"default": 1
}
}
},
Expand All @@ -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_metadata_in_bulk_request_body": {
"type": "object",
"title": "Update Customers' Metadata in bulk Request Body",
"description": "Request body schema for `/customers/metadata/async`.",
Expand All @@ -31794,80 +31814,89 @@
"metadata"
]
},
"9_req_update_customers_bulk": {
"customers_update_in_bulk_request_body": {
"type": "array",
"title": "Update Customers in bulk Request Body",
"description": "Request body schema for `/customers/bulk/async`.",
"items": {
marcin-slezak marked this conversation as resolved.
Show resolved Hide resolved
"$ref": "#/components/schemas/9_req_update_customers_bulk_customer_object"
"$ref": "#/components/schemas/customers_update_in_bulk_item_request_body"
}
},
"9_req_update_customers_bulk_customer_object": {
"customers_update_in_bulk_item_request_body": {
"type": "object",
"title": "Customer object",
"description": "This is an object containing information about the customer.",
"title": "Update Customers in bulk Request Body",
"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": {
"type": "string",
"description": "Customer's birthdate; format `YYYY-MM-DD`.",
"format": "date"
},
"birthday": {
"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. "
}
Expand Down Expand Up @@ -39223,7 +39252,10 @@
"example": "aa_0a875d56c805df6601",
"description": "The ID of the scheduled asynchronous action."
}
}
},
"required": [
"async_action_id"
]
},
"error": {
"title": "error",
Expand Down Expand Up @@ -71826,7 +71858,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/9_res_customers_customerId_permanent-deletion"
"$ref": "#/components/schemas/customers_permanent_deletion_response_body"
},
"examples": {
"Example": {
Expand Down Expand Up @@ -71945,7 +71977,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/9_req_update_customers_bulk"
"$ref": "#/components/schemas/customers_update_in_bulk_request_body"
},
"examples": {
"Example": {
Expand Down Expand Up @@ -72100,7 +72132,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/9_req_customers_metadata_async"
"$ref": "#/components/schemas/customers_update_metadata_in_bulk_request_body"
},
"examples": {
"Example": {
Expand Down