<commit_before>---
title: Messages
---

## Overview

The Spree Commerce hub API also allows messages to be pushed to it.

This guide covers how to see which message types can be pushed to the hub and instructions for pushing a message via the API.

## Available Messages


To see a list of message types you can push to the hub, make the following request:

```text
GET http://hub.spreecommerce.com/api/stores/YOUR_STORE_ID/available_messages```

The response will be a list of possible message types you can push. The following is an abbreviated list:

<%= headers 200 %>
<%= json \
    [
      "endpoint:poll",
      "notification:error",
      "notification:info",
      "notification:warn",
      "order:canceled",
      "order:import",
      "order:new",
      "order:persist",
      "order:updated",
      "payment:capture",
      "payment:ready",
      "product:update"
    ]
%>

## Pushing a Message to the Hub

***
For more information on the structure of messages and to view some sample messages, please view the [Sample Messages guide](/integration/sample_messages).
***

Let's go over pushing a couple different messages to the Spree Commerce hub. First, we'll push a more basic message, `stock:change`, and then we'll push a more complicated messages, `order:persist`.

### stock:change example

#### Request<commit_msg>Correct API available_messages blurb<commit_after>---
title: Messages
---

## Overview

The Spree Commerce hub API also allows messages to be pushed to it.

This guide covers how to see which message types can be pushed to the hub and instructions for pushing a message via the API.

## Available Messages


To see a list of message types that have been previously processed on hub for a given store, you can run the following request:

```text
GET http://hub.spreecommerce.com/api/stores/YOUR_STORE_ID/available_messages```

The following response is an abbreviated example:

<%= headers 200 %>
<%= json \
    [
      "endpoint:poll",
      "notification:error",
      "notification:info",
      "notification:warn",
      "order:canceled",
      "order:import",
      "order:new",
      "order:persist",
      "order:updated",
      "payment:capture",
      "payment:ready",
      "product:update"
    ]
%>

## Pushing a Message to the Hub

***
For more information on the structure of messages and to view some sample messages, please view the [Sample Messages guide](/integration/sample_messages).
***

Let's go over pushing a couple different messages to the Spree Commerce hub. First, we'll push a more basic message, `stock:change`, and then we'll push a more complicated messages, `order:persist`.

### stock:change example

#### Request
{'fraction_non_alphanumeric': 0.09966405375139978, 'fraction_numerical': 0.0022396416573348264, 'mean_word_length': 3.6853146853146854, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4657979', 'n_tokens_mistral': 760, 'n_tokens_neox': 724, 'n_words': 309}