The api object provides methods to facilitate communication with your backend service. It enables you to make a variety of API calls, allowing you to create, retrieve, update, or delete data within your application. More information on the API can be found here.

Example code:

const onSave = async () => {
  try {
    const client = await api?.getClient()
    const document = {
      gtinQuantities: gtinQuantities,
      readPointId: readPoint.id,
    }

    client.CreateOrReplaceDocument(null, {
      type: 'shipment',
      reference: moment().format(),
      contents: document,
    })

  } catch (e) {
    console.error(e)
  }
}