diff --git a/descriptions/0/api.intercom.io.yaml b/descriptions/0/api.intercom.io.yaml index a1b96b6e..1029bbfb 100644 --- a/descriptions/0/api.intercom.io.yaml +++ b/descriptions/0/api.intercom.io.yaml @@ -26985,7 +26985,7 @@ paths: "$ref": "#/components/schemas/error" "/ecommerce/connectors/{import_source_id}/events": post: - summary: Submit a product event + summary: Submit an ecommerce event parameters: - name: Intercom-Version in: header @@ -27002,13 +27002,17 @@ paths: - Ecommerce Connectors operationId: submitEcommerceProductEvent description: | - Send a single product change to an ecommerce connector. Use product events to keep - Fin's product knowledge current between full catalog uploads. Each request carries - one event. + Send a single product or order change to an ecommerce connector. Use product events to + keep Fin's product knowledge current between full catalog uploads, and order events to + tell Fin about the orders your store receives. Each request carries one event. + + Requires the `write_content` OAuth scope. Each connector accepts up to 600 requests per + minute. A full catalog must be uploaded with [Upload a product catalog](/docs/references/preview/rest-api/api.intercom.io/ecommerce-connectors/uploadecommercecatalog) - before you send events. Until then, this endpoint returns `409 Conflict`. + before you send product events. Until then, product events return `409 Conflict`. Order + events do not need a catalog. ## Event types @@ -27017,6 +27021,9 @@ paths: | `product.created` | `product` | Adds the product, or updates it if a product with the same `id` already exists. | | `product.updated` | `product` | Updates the product with the same `id`, or adds it if it does not exist yet. | | `product.deleted` | `product_id` | Removes the product from Fin's knowledge. | + | `order.created` | `order` | A customer placed an order. | + | `order.updated` | `order` | An order changed, including when it is cancelled or refunded. | + | `order.deleted` | `order_id`, `updated_at` | An order was deleted. | For `product.created` and `product.updated`, send the full product object, not only the fields that changed. It uses the same fields as a catalog product @@ -27028,10 +27035,31 @@ paths: `occurred_at` is required on every event and must be an ISO 8601 timestamp. + ## Order events + + For `order.created` and `order.updated`, send the full order object in `data.order`. These fields are + required: `id`, `currency_code`, `total_price` (zero or more), `ordered_at`, `updated_at` + (both ISO 8601 timestamps) and `line_items`. Each line item needs a `product_id`, and an + order can have up to 500 line items. The serialized order must be 60 KB or smaller. + + To connect an order to a Fin conversation, send the conversation's ID as + `fin_conversation_id`. `customer.email` and `status` are optional. `status` must be one of + `pending`, `authorized`, `partially_paid`, `paid`, `partially_refunded`, `refunded` or + `voided`. Any other value returns `400`. + + For `order.deleted`, send only `data.order_id` and `data.updated_at` (an ISO 8601 + timestamp). Send the time the order was deleted. + + To report a refund, send an `order.updated` event with `status` set to `refunded` or + `partially_refunded`. To report a cancellation, send an `order.updated` event with `status` + set to `voided`, or `refunded` if the payment was returned. + ## Processing - The endpoint returns `202 Accepted` with an `event_id` once the event is queued. + Product events return `202 Accepted` with an `event_id` once the event is queued. Processing is asynchronous, so the change may take a short time to reach Fin. + + Order events return `202 Accepted` with the `order_id` once the order is accepted. requestBody: content: application/json: @@ -27139,15 +27167,66 @@ paths: occurred_at: '2026-10-20T08:00:00Z' data: product_id: 'tent-2p-ultralight' + order_created: + summary: Order created + value: + type: order.created + occurred_at: '2026-10-21T10:15:00Z' + data: + order: + id: 'ORD-10492' + status: 'paid' + currency_code: 'USD' + total_price: 349.0 + ordered_at: '2026-10-21T10:14:52Z' + updated_at: '2026-10-21T10:14:52Z' + customer: + email: 'alex@example.com' + fin_conversation_id: '215470000012345' + line_items: + - product_id: 'tent-2p-ultralight' + variant_id: 'tent-2p-ultralight-green' + quantity: 1 + price: 349.0 + order_updated: + summary: Order updated + value: + type: order.updated + occurred_at: '2026-10-24T16:40:00Z' + data: + order: + id: 'ORD-10492' + status: 'refunded' + currency_code: 'USD' + total_price: 349.0 + ordered_at: '2026-10-21T10:14:52Z' + updated_at: '2026-10-24T16:39:30Z' + fin_conversation_id: '215470000012345' + line_items: + - product_id: 'tent-2p-ultralight' + variant_id: 'tent-2p-ultralight-green' + quantity: 1 + price: 349.0 + order_deleted: + summary: Order deleted + value: + type: order.deleted + occurred_at: '2026-10-25T09:00:05Z' + data: + order_id: 'ORD-10492' + updated_at: '2026-10-25T09:00:00Z' responses: '202': description: Event accepted and queued for processing. content: application/json: examples: - Event accepted: + Product event accepted: value: event_id: 81273 + Order event accepted: + value: + order_id: 'ORD-10492' schema: "$ref": "#/components/schemas/ecommerce_product_event_response" '400': @@ -27161,7 +27240,7 @@ paths: request_id: test-uuid-replacement errors: - code: invalid_event - message: type must be one of product.created, product.updated, product.deleted + message: type must be one of product.created, product.updated, product.deleted, order.created, order.updated, order.deleted Invalid product: value: type: error.list @@ -27183,10 +27262,45 @@ paths: errors: - code: invalid_event message: data.product exceeds 60KB + Invalid order: + value: + type: error.list + request_id: test-uuid-replacement + errors: + - code: invalid_event + message: data.order.currency_code is required; data.order.total_price must be a non-negative number + Invalid order line items: + value: + type: error.list + request_id: test-uuid-replacement + errors: + - code: invalid_event + message: data.order.line_items must be a list of up to 500 items, each with a product_id + Order too large: + value: + type: error.list + request_id: test-uuid-replacement + errors: + - code: invalid_event + message: data.order exceeds 60KB schema: "$ref": "#/components/schemas/error" '401': "$ref": "#/components/responses/Unauthorized" + '403': + description: Forbidden. + content: + application/json: + examples: + Order events disabled: + value: + type: error.list + request_id: test-uuid-replacement + errors: + - code: order_events_disabled + message: Order events are not enabled for this workspace. + schema: + "$ref": "#/components/schemas/error" '404': description: Not found. content: @@ -51768,10 +51882,101 @@ components: format: date-time description: When the product was last changed in your store, as an ISO 8601 timestamp. example: '2026-10-15T14:05:00Z' + ecommerce_order_event_line_item: + title: Ecommerce Order Event Line Item + type: object + description: A product in an order. + required: + - product_id + properties: + product_id: + type: string + description: The `id` of the product, as sent in your catalog. + example: 'tent-2p-ultralight' + variant_id: + type: string + description: The `id` of the product variant that was ordered. + example: 'tent-2p-ultralight-green' + nullable: true + quantity: + type: integer + description: How many units were ordered. + example: 1 + price: + type: number + description: The price of one unit, in the order's currency. + example: 349.0 + ecommerce_order_event_order: + title: Ecommerce Order Event Order + type: object + description: | + The full order sent in an `order.*` event. The serialized order must be 60 KB or smaller. + required: + - id + - currency_code + - total_price + - ordered_at + - updated_at + - line_items + properties: + id: + type: string + description: The unique identifier of the order in your store. + example: 'ORD-10492' + status: + type: string + enum: + - pending + - authorized + - partially_paid + - paid + - partially_refunded + - refunded + - voided + description: The order's payment status in your store. + example: 'paid' + currency_code: + type: string + description: The three-letter ISO 4217 currency code of the order. + example: 'USD' + total_price: + type: number + description: The total of the order. Must be zero or more. + example: 349.0 + ordered_at: + type: string + format: date-time + description: When the customer placed the order, as an ISO 8601 timestamp. + example: '2026-10-21T10:14:52Z' + updated_at: + type: string + format: date-time + description: When the order was last changed in your store, as an ISO 8601 timestamp. + example: '2026-10-21T10:14:52Z' + customer: + type: object + description: The customer who placed the order. + properties: + email: + type: string + description: The customer's email address. + example: 'alex@example.com' + nullable: true + fin_conversation_id: + type: string + description: The ID of the Fin conversation that led to this order, if there was one. + example: '215470000012345' + nullable: true + line_items: + type: array + description: The products in the order. Up to 500 items. + maxItems: 500 + items: + "$ref": "#/components/schemas/ecommerce_order_event_line_item" ecommerce_product_event_request: title: Ecommerce Product Event Request type: object - description: A single product event. + description: A single product or order event. required: - type - occurred_at @@ -51779,11 +51984,14 @@ components: properties: type: type: string - description: The kind of product change. + description: The kind of change. enum: - product.created - product.updated - product.deleted + - order.created + - order.updated + - order.deleted example: product.updated occurred_at: type: string @@ -51792,7 +52000,7 @@ components: example: '2026-10-15T14:05:00Z' data: type: object - description: The event payload. Send `product` for `product.created` and `product.updated`, and `product_id` for `product.deleted`. + description: The event payload. Send `product` for `product.created` and `product.updated`, `product_id` for `product.deleted`, `order` for `order.created` and `order.updated`, and `order_id` and `updated_at` for `order.deleted`. properties: product: "$ref": "#/components/schemas/ecommerce_product_event_product" @@ -51800,14 +52008,29 @@ components: type: string description: The `id` of the product to delete. Required for `product.deleted`. example: 'tent-2p-ultralight' + order: + "$ref": "#/components/schemas/ecommerce_order_event_order" + order_id: + type: string + description: The `id` of the order to delete. Required for `order.deleted`. + example: 'ORD-10492' + updated_at: + type: string + format: date-time + description: When the order was deleted, as an ISO 8601 timestamp. Required for `order.deleted`. + example: '2026-10-25T09:00:00Z' ecommerce_product_event_response: title: Ecommerce Product Event Response type: object - description: Returned when a product event is accepted and queued. + description: Returned when an event is accepted. Product events return `event_id`. Order events return `order_id`. properties: + order_id: + type: string + description: The `id` of the accepted order. Returned for order events. + example: 'ORD-10492' event_id: type: integer - description: The unique identifier for the queued event. + description: The unique identifier for the queued event. Returned for product events. example: 1000000471233 email_address_header: title: Email Address Header diff --git a/descriptions/2.18/api.intercom.io.yaml b/descriptions/2.18/api.intercom.io.yaml index cd4fede9..d725ea12 100644 --- a/descriptions/2.18/api.intercom.io.yaml +++ b/descriptions/2.18/api.intercom.io.yaml @@ -21797,7 +21797,7 @@ paths: start_reason: end_reason: close '400': - description: Intercom-Version is not Preview + description: Requested resource is not available in current API version content: application/json: schema: @@ -22031,6 +22031,178 @@ paths: application/json: schema: "$ref": "#/components/schemas/error" + "/conversations/{conversation_id}/rating": + post: + summary: Rate a conversation + parameters: + - name: Intercom-Version + in: header + schema: + "$ref": "#/components/schemas/intercom_version" + - name: conversation_id + in: path + required: true + description: The unique identifier for the conversation. + example: '215471234567890' + schema: + type: string + tags: + - Conversations + operationId: rateConversation + description: | + Record a contact's CSAT rating, and an optional remark, on the latest rating request Intercom sent for a conversation. The rating counts in your CSAT reports for the teammate, Fin or workflow that was rated. + + Only the contact the request was sent to can answer. Pass their Intercom ID as `intercom_user_id`. + + Sending the same rating and remark again returns the current rating without changing it, so it is safe to retry. A different `rating` replaces the earlier one while the rating request still accepts answers. A `remark` can be added to a rating that has none. Once a remark is set, the rating and the remark can no longer be changed. + + Requires the `write_conversations` permission. + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/rate_conversation_request" + examples: + successful: + summary: successful + value: + intercom_user_id: 6541f0a2c3d4e5f607182930 + rating: 4 + remark: Fast and friendly + responses: + '200': + description: Rating recorded + content: + application/json: + examples: + successful: + value: + type: conversation_rating + conversation_id: '215471234567890' + rating: 4 + remark: Fast and friendly + created_at: 1793664000 + updated_at: 1793664120 + customer: + type: user + id: 6541f0a2c3d4e5f607182930 + teammate: + type: admin + id: '12345' + schema: + "$ref": "#/components/schemas/rated_conversation" + '400': + description: Bad request + content: + application/json: + examples: + Resource not available: + value: + type: error.list + request_id: 7a80b950-b392-499f-85db-ea7c6c424d37 + errors: + - code: intercom_version_invalid + message: Requested resource is not available in current API version + Missing parameter: + value: + type: error.list + request_id: 5f0c2a8e-3d71-4b96-a1e4-9c6b7d2f8e13 + errors: + - code: parameter_not_found + message: rating parameter is required + Invalid parameter type: + value: + type: error.list + request_id: 0e4b9d1c-6a85-4f32-b7d0-2c8e5a1f9b64 + errors: + - code: parameter_invalid + message: rating must be a integer + Rating out of range: + value: + type: error.list + request_id: c3a1e7f5-82d4-4b09-9e6a-1d5b0f7c2a48 + errors: + - code: parameter_invalid + message: rating must be an integer from 1 to 5 + schema: + "$ref": "#/components/schemas/error" + '401': + description: Unauthorized + content: + application/json: + examples: + Unauthorized: + value: + type: error.list + request_id: 7d3e1f0a-5b2c-4a96-8c41-0e9f6b2d7a35 + errors: + - code: unauthorized + message: Access Token Invalid + schema: + "$ref": "#/components/schemas/error" + '403': + description: Forbidden + content: + application/json: + examples: + Different contact: + value: + type: error.list + request_id: 9b1c2d3e-4f50-4a61-8b72-c3d4e5f60718 + errors: + - code: forbidden + message: The rating request for this conversation was sent to a different contact + Conversation access restricted: + value: + type: error.list + request_id: 2c8a4e6b-9f1d-4b73-a5e0-6d1c3f8b9a47 + errors: + - code: token_unauthorized + message: Not authorized to access this conversation + schema: + "$ref": "#/components/schemas/error" + '404': + description: The conversation was not found, or the endpoint is not enabled for the workspace + content: + application/json: + examples: + Conversation not found: + value: + type: error.list + request_id: 4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d + errors: + - code: conversation_not_found + message: Conversation not found + schema: + "$ref": "#/components/schemas/error" + '422': + description: Rating not accepted + content: + application/json: + examples: + No rating request: + value: + type: error.list + request_id: 6e2f8a1b-0c47-4d93-8b5a-7f1e3c9d0a26 + errors: + - code: rating_request_not_found + message: No rating request has been sent for this conversation + Rating window closed: + value: + type: error.list + request_id: 1d7c4b9a-5e30-4f68-a2b1-8c0e6d3f7a95 + errors: + - code: rating_window_closed + message: The rating window for this conversation has closed + Rating locked: + value: + type: error.list + request_id: 8f3a6c2d-1b94-4e07-9d5c-0a7b2e4f1c63 + errors: + - code: rating_locked + message: This rating can no longer be changed because a remark has already been submitted + schema: + "$ref": "#/components/schemas/error" "/conversations/redact": post: summary: Redact a conversation part @@ -42387,7 +42559,7 @@ components: example: '3' part_type: type: string - description: The type of conversation part. On the Preview version a part type the API does not recognise is returned as `unknown`; on earlier versions those parts are returned as `comment`. Every value other than `unknown` is also accepted by the `include_part_types` and `exclude_part_types` query parameters when retrieving a conversation. + description: The type of conversation part. A part type this version does not recognise is returned as `unknown`; versions before 2.18 return `comment` for those parts. Every value other than `unknown` is also accepted by the `include_part_types` and `exclude_part_types` query parameters when retrieving a conversation. example: comment body: type: string @@ -42743,6 +42915,95 @@ components: type: integer description: First response time of assigned team in seconds. example: 2310 + rate_conversation_request: + title: Rate conversation request + type: object + required: + - intercom_user_id + - rating + properties: + intercom_user_id: + type: string + description: The unique identifier for the contact the rating request was sent to. + example: 6541f0a2c3d4e5f607182930 + rating: + type: integer + minimum: 1 + maximum: 5 + description: The rating, from 1 to 5. + example: 4 + remark: + type: string + description: Free text from the contact to go with the rating. + example: Fast and friendly + rated_conversation: + title: Rated conversation + type: object + x-tags: + - Conversations + description: The CSAT rating recorded on a conversation. + properties: + type: + type: string + description: String representing the object's type. Always has the value `conversation_rating`. + enum: + - conversation_rating + example: conversation_rating + conversation_id: + type: string + description: The unique identifier for the conversation. + example: '215471234567890' + rating: + type: integer + description: The rating, from 1 to 5. + example: 4 + remark: + type: string + nullable: true + description: The free text left with the rating. + example: Fast and friendly + created_at: + type: integer + format: date-time + description: The time the rating request was created, as a UNIX timestamp. + example: 1793664000 + updated_at: + type: integer + format: date-time + description: The time the rating or remark last changed, as a UNIX timestamp. + example: 1793664120 + customer: + type: object + description: The contact who answered. + properties: + type: + type: string + description: The type of contact. + enum: + - user + - lead + - visitor + example: user + id: + type: string + description: The unique identifier for the contact. + example: 6541f0a2c3d4e5f607182930 + teammate: + type: object + description: Who was rated. + properties: + type: + type: string + description: "`admin` for a teammate, `bot` for Fin, or `workflow` for a workflow." + enum: + - admin + - bot + - workflow + example: admin + id: + type: string + description: The unique identifier for the teammate, Fin or workflow. For a deleted workflow, this is the identifier recorded with the rating. + example: '12345' conversation_source: title: Conversation source type: object