Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

3. Subscribe your webhook to a topic

In order to subscribe To listen to OneStock events you will subcribe your webhook to a topic, add the topic to the code, as shown in the example below on lines 5 and 6.

...

languagejson

...

. We distinguish to types of topics, standard and custom. Standard topics work out of the box, you just need to sucribe your webhook to one of them and you will start receving all events that go through the topic event stream. Custom topics need slightly more configuration and allow you to listen to specific events that you will trigger trough your workflow.

Standard topics

1. Subcribe a webhook to a standard topic

To listent to topics, you simply need to subscribe a webhook to one or multiple topics, through a

POST /webhooks call.

POST /webhooks

Code Block
{
  "site_id": "MySiteID",
  "token":"token",
  "webhook": {
    "hash_key": "personnal_hash_key",
    "http_method": "POST",
    "http_methodstatus": "POSTenabled",
    "topics": [
      "order_state_changed",
      "parcel_state_changed",
      "stockline_item_importgroup_errorstate_occurredchanged"
    ],
    "url": "https://myWebhookURL" //you can generate a disposbel one at https://webhook.site/
  }
}

Information about the expected responses can be found in our documentation here.

Standard topics

...

Following a list of all the events topics we currently sendsupport. We may add more at any time, so in developing and maintaining your code, you should not assume that only these topics exist.

...

Expand
titleFull list of standard topics
Code Block
{ "site_id": "MySiteID", "token":"token", "webhook": { "hash_key": "personnal_hash_key", "http_method": "POST", "status": "enabled", "topics": [ "order_state_changed", "parcel_state_changed", "line_item_group_state_changed" ], "url": "https://myWebhookURL" //you can generate a disposbel one at https://webhook.site/ } }

Topic

Displayed Name

Description

Message structure

buffer_import_completed

Buffer Import Completed

Notifies when an async buffer import using API or file is completed

buffer_import_completed

Code Block
import_id: string
status: string

Status
colourYellow
title12.4

buffer_import_error_occurred

Buffer Import Error Occurred

Notifies when a synchronous buffer import using API POST method fails

buffer_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

Status
colourYellow
title12.4

async_buffer_import_error_occurred

Asynchronous Buffer Import Error Occurred

Notifies when an asynchronous buffer import fails

async_buffer_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

customer_import_completed

Customer Import Completed

Notifies when an async customer import using API or file is completed

customer_import_completed

Code Block
import_id: string
status: string

Status
colourYellow
title12.4

customer_import_error_occurred

Customer Import Error Occurred

Notifies when a synchronous customer import using API POST method fails

customer_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

Status
colourYellow
title12.4

async_customer_import_error_occurred

Asynchronous Customer Import Error Occurred

Notifies when a asynchronous customer import fails

async_customer_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

transfer_import_completed

Transfer Import Completed

Notifies when an async transfer import using API or file is completed

transfer_import_completed

Code Block
import_id: string
status: string

transfer_import_error_occurred

Transfer Import Error Occurred

Notifies when a synchronous transfer import using API POST method fails

transfer_import_error_occurred

Code Block
error: string
invalid_transfers: string
request_body: string
date: int64

Status
colourYellow
title12.4

async_customer_import_error_occurred

Asynchronous Transfer Import Error Occurred

Notifies when an asynchronous transfer import fails

async_transfer_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

stock_import_completed

Stock Import Completed

Notifies when an async stock import using API or file is completed

stock_import_completed

Code Block
import_id: string
status: string

stock_import_error_occurred

Stock Import Error Occurred

Notifies when a synchronous stock import using API POST method fails

stock_import_error_occurred

Code Block
error: string
error_content: string
import_id: string
request_body: string
date: int64

Status
colourYellow
title12.4

async_stock_import_error_occurred

Asynchronous Stock Import Error Occurred

Notifies when an asynchronous stock import fails

async_stock_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

line_item_group_state_changed

Line Item Group State Change

Notifies of a state change for line item groups

line_item_group_state_changed

Code Block
order_id: string
date: int64
old_state: string
new_state: string
order_item_id: string
index_ranges: indexRanges
quantity: int64

 

order_state_changed

Order State Change

Notifies of a state change for orders

order_state_changed

Code Block
order_id: string
date: int64
old_state: string
new_state: string

 

parcel_state_changed

Parcel State Change

Notifies of a state change for parcels

parcel_state_changed

Code Block
order_id: string
date: int64
old_state: string
new_state: string
parcel_id: string

 

entity_updated

Entity Update

Notifies of OMS entities information changes (parcels, line item groups and orders) POP (endpoint_orders, containers, piece_groups) and RM (return_parcels, and return_line_item_groups)

line_item_group_entity_updated, order_entity_updated, parcel_entity_updated

Code Block
site_id: string
entity_id: string
entity_type: string
date: int64
diff: map[string]any

orchestration_rules_changed

Orchestration Rules Changed

Allows triggering of preparation order on time.

When there is an orchestration rule change with a warehouse custom claim action triggered, line item groups are retrieved and a preparation order is sent to the warehouse.

orchestration_rules_changed

Code Block
site_id: string
order_id: string
ruleset_id: string
from: string
to: string
custom_actions: []
    action: string
    rule_index: string
    line_item_index_ranges: indexRange
rules_over: string

 

candidates_added

Candidates Added

Notifies that an endpoint is candidate for an order.

candidates_added

Code Block
site_id: string
order_id: string
endpoint_ids: []string

 

candidates_removed

Candidates Removed

Notifies when an endpoint is no longer candidate for an order.

candidates_removed

Code Block
site_id: string
order_id: string
endpoint_ids: []string

 

rules_over

Status
colourRed
titleBefore 12.4

orchestration_rules_over

Status
colourYellow
title12.4

Rules Over (custom notification)

Notifies of a rules over transition for an order.

orchestration_rules_over

Status
colourYellow
title12.4
(new version more accurate than rules_over)

Code Block
site_id: string
order_id: string
ruleset_id: string 
line_item_index_ranges: IndexRanges

rules_over

Code Block
site_id: string
order_id: string
ruleset_id: string 

back_from_rules_over

Code Block
site_id: string
order_id: string
ruleset_id: string 

 

item_import_completed

Item Import Completed

Notifies of a completed item import

item_import_completed

Code Block
import_id: string
status: string

Status
colourYellow
title12.4

item_import_error_occurred

Item Import Error Occurred

Notifies when a synchronous item import using API POST method fails

item_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

Status
colourYellow
title12.4

async_item_import_error_occurred

Asynchronous Item Import Error Occurred

Notifies when an asynchronous item import fails

async_item_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

psp_error_occurred

Payment Error

Notifies of errors during payment treatment

psp_error_occurred

Code Block
psp: string
request_route: string
request_body: string
response_body: string

container_state_changed

operator_state_changed

endpoint_order_state_changed

piece_group_state_changed

Order Preparation Entity Change

Notifies of order preparation entity state changes (creation, update, removal)

  • container_state_changed, operator_state_changed, endpoint_order_state_changedand piece_group_state_changed

Code Block
entity_id string
entity_type string
site_id string
date string
old_state string
new_state string

return_parcel_created

Return Parcel Creation

Notifies of the creation of a return parcel

return_parcel_created :

Code Block
languageyaml
order_id: string
id: string
user_id: string
creation_date: int64
return_note_id: string
document_id: string
last_update: int64
returned_line_items: []
  creation_date: string
  id: string
  last_update: string
  reason: string
  receiver_comment: string
  return_condition: string
  sender_comment: string
  item_id: string
  state: string
information: map[string]any
state: string
delivery: 
  origin:
    address:
    endpoint_id: string
  destination:
    address:
      id: string
      city: string
      contact:
        title: string
        first_name: string
        last_name: string
   
    company_name: string
        phone_number: string  address:
      mobile_numberid: string
        emailcity: string
      coordinatescontact:
        lontitle: float64string
        lat: float64first_name: string
        informationlast_name: map[string]string
        linescompany_name: []string
      regions  phone_number: map[string]
        namemobile_number: string
        codeemail: string
      zip_codecoordinates:
string     endpoint_id: string  lon: carrier:float64
    name: string   lat: float64
option: string     tracking_codeinformation: map[string]string
      tracking_linklines: []string

   information: map[string]any

return_parcel_created@v3 :

Code Block
languageyaml
documents   regions: map[string]string
order_id: string
id: string
user_id
        name: string
creation_date: int64 last_update: int64 return_line_item_groups: []   idcode: string
    order_item_id  zip_code: string
  creation  endpoint_dateid: int64string
  last_updatecarrier:
 int64   reasonname: string
  receiver_comment  option: string
  return  tracking_conditioncode: string
  sender  tracking_commentlink: string
  quantity: int64   line_item_index_ranges: IndexRanges
  iteminformation: map[string]any

return_parcel_created@v3 :

Code Block
languageyaml
documents: map[string]string
order_id: string
  stateid: string
informationuser_id: map[string]any
statecreation_date: stringint64
deliverylast_update:   originint64
return_line_item_groups: []
   addressid: string
   endpointorder_item_id: string
  destinationcreation_date: int64
   addresslast_update: int64
     idreason: string
      cityreceiver_comment: string
      contactreturn_condition: string
       titlesender_comment: string
  quantity: int64
    first_name: string
    line_item_index_ranges: IndexRanges
   lastitem_nameid: string
  state: string
information:    company_namemap[string]any
state: string
delivery:
  origin:
    phone_numberaddress: string
        mobile_numberendpoint_id: string
  destination:
     emailaddress: string
      coordinatesid: string
       loncity: float64string
       contact:
lat: float64       informationtitle: map[string]string
        linesfirst_name: []string
       regions last_name: map[string]
        company_name: string
        codephone_number: string
        zipmobile_codenumber: string
      endpoint_id  email: string
   carrier:   coordinates:
  name: string     optionlon: stringfloat64
    tracking_code: string   lat: float64
tracking_link: string     information: map[string]any
shipment:string
      idlines: []string
  document_id: string   tracking_coderegions: map[string]
  tracking_link: string      transportername: string
   carrier_data: string

 

return_line_item_group_state_changed

return_parcel_state_changed

 

Notifies of a state change for a return return_line_item_group or return_parcel

return_line_item_group_state_changed and return_parcel_state_changed

Code Block
languageyaml
entity_id: string
entity_type: string
site     code: string
      zip_code: string
    endpoint_id: string
  datecarrier:
   int64 old_statename: string
new_state: string

 

line_items_reservations_updated

Line Items Reservations Update

Notifies of a reservation update on a line item group (global reservation to endpoint reservation, future stock to on hand, endpoint reservation removal)

line_items_reservations_updated

Code Block
languageyaml
added_reservations: []
     option: string
    tracking_code: string
    tracking_link: string
    information: map[string]any
shipment:
  id: string
    orderdocument_id: string
  tracking_code: string
  salestracking_channellink: string
    globaltransporter: string
    carrier_data: string

 

return_line_item_group_state_changed

return_parcel_state_changed

 

Notifies of a state change for a return return_line_item_group or return_parcel

return_line_item_

index_ranges: index_ranges quantity: int64 item_id: string endpoint

group_state_changed and return_parcel_state_changed

Code Block
languageyaml
entity_id: string
entity_type: string
site_id: string
    eta_startdate: int64
    eta_endold_state: int64
    stock_typestring
new_state: string
    purchase_order_number: string
    remaining_line_item_index_ranges: index_ranges
removed

 

line_items_reservations_updated

Line Items Reservations Update

Notifies of a reservation update on a line item group (global reservation to endpoint reservation, future stock to on hand, endpoint reservation removal)

line_items_reservations_updated

Code Block
languageyaml
added_reservations: []
    id: string
    order_id: string
    sales_channel: string
    global: string
    line_item_index_ranges: index_ranges
    quantity: int64
    item_id: string
    endpoint_id: string
    eta_start: int64
    eta_end: int64
    stock_type: string
    purchase_order_number: string
 
  remaining_line_item_index_ranges: index_ranges

 

stock_coverage_import_completed

Stock Coverage Import Completed

Notifies of a completed stock coverage import

stock_coverage_import_completed

Code Block
import_id: string status: string

Status
colourYellow
title12.4

stock_coverage_import_error_occurred

Stock Coverage Import Error Occurred

Notifies when a synchronous stock coverage import using API POST method fails

stock_coverage_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id? remaining_line_item_index_ranges: index_ranges
removed_reservations: []
    id: string
    order_id: string
  message  sales_channel: string
 date: int64

Status
colourYellow
title12.4

async_stock_coverage_import_error_occurred

Asynchronous Stock Coverage Import Error Occurred

Notifies when an asynchronous stock coverage import fails

async_stock_coverage_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64
stock_disposition
   global: string
    line_item_index_ranges: index_ranges
    quantity: int64
    item_id: string
    endpoint_id: string
    eta_start: int64
    eta_end: int64
    stock_type: string
    purchase_order_number: string
    remaining_line_item_index_ranges: index_ranges

 

stock_coverage_import_completed

Stock Disposition Coverage Import Completed

Notifies of a completed stock disposition coverage import

stock_dispositioncoverage_import_completed

Code Block
import_id: string
status: string

Status
colourYellow
title12.4

stock_dispositioncoverage_import_error_occurred

Stock Disposition Coverage Import Error Occurred

Notifies when a synchronous stock disposition coverage import using API POST method fails

stock_dispositioncoverage_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

Status
colourYellow
title12.4

async_stock_dispositioncoverage_import_error_occurred

Asynchronous Stock Disposition Coverage Import Error Occurred

Notifies when an asynchronous stock disposition coverage import fails

async_stock_dispositioncoverage_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

endpointstock_disposition_import_completed

Endpoint Stock Disposition Import Completed

Notifies of a completed stock disposition import

endpointstock_disposition_import_completed

Code Block
import_id: string
status: string

Status
colourYellow
title12.4

endpointstock_disposition_import_error_occurred

Endpoint Stock Disposition Import Error Occurred

Notifies when a synchronous endpoint stock disposition import using API POST method fails

endpointstock_disposition_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

Status
colourYellow
title12.4

async_endpointstock_disposition_import_error_occurred

Asynchronous Endpoint Stock Disposition Import Error Occurred

Notifies when an asynchronous endpoint stock disposition import fails

async_stock_endpointdisposition_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

userendpoint_import_completed

User Endpoint Import Completed

Notifies of a completed user stock import

userendpoint_import_completed

Code Block
import_id: string
status: string

Status
colourYellow
title12.4

user_import_error_occurred

User Import Error Occurred

Notifies when a synchronous user import using API POST method fails

user_import_error_occurred

import_id?: string errors: [] entity_id?
Code Block
Code Block
import_id: string
  messagestatus: string
date: int64

Status
colourYellow
title12.4

asyncendpoint_user_import_error_occurred

Asynchronous User Endpoint Import Error Occurred

Notifies when an asynchronous user import failsasync_usera synchronous endpoint import using API POST method fails

endpoint_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

carrier_error_occurred

Carrier Error

Relays of errors during carrier communication

carrier_error_occurred

Code Block
carrier: string
request_route: string
request_body: string
response_body: string

tracking_link_created

 

Notifies of the creation of a tracking link

tracking_link_created

Code Block
carrier: string
tracking_link: string

shipment_created

 

Notifies of the creation of a shipment

shipment_created

Code Block
languageyaml
carrier: string
endpoint_id: string
order_id: string
parcel_id: string
shipment_id: string
user_id: string

stock_export_completed

Stock Export Completed

Notifies the completion of a stock export by file (SFTP)

Code Block
export_id string
file_job_id string
exported_lines_count int64

1. Subcribe a webhook to a standard topic

To listent to topics, you simply need to subscribe a webhook to one or multiple topics, through a

POST /webhooks call.

POST /webhooks

Status
colourYellow
title12.4

async_endpoint_import_error_occurred

Asynchronous Endpoint Import Error Occurred

Notifies when an asynchronous endpoint import fails

async_endpoint_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

user_import_completed

User Import Completed

Notifies of a completed user import

user_import_completed

Code Block
import_id: string
status: string

Status
colourYellow
title12.4

user_import_error_occurred

User Import Error Occurred

Notifies when a synchronous user import using API POST method fails

user_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

Status
colourYellow
title12.4

async_user_import_error_occurred

Asynchronous User Import Error Occurred

Notifies when an asynchronous user import fails

async_user_import_error_occurred

Code Block
import_id?: string
errors: []
  entity_id?: string
  message: string
date: int64

carrier_error_occurred

Carrier Error

Relays of errors during carrier communication

carrier_error_occurred

Code Block
carrier: string
request_route: string
request_body: string
response_body: string

tracking_link_created

 

Notifies of the creation of a tracking link

tracking_link_created

Code Block
carrier: string
tracking_link: string

shipment_created

 

Notifies of the creation of a shipment

shipment_created

Code Block
languageyaml
carrier: string
endpoint_id: string
order_id: string
parcel_id: string
shipment_id: string
user_id: string

stock_export_completed

Stock Export Completed

Notifies the completion of a stock export by file (SFTP)

Code Block
export_id string
file_job_id string
exported_lines_count int64

2. Test that all works correctly

...