# Receipt Message

*Again, after clicking the **'Messages' icon**, you are directed to the following screen (note: the three previously configured messages are now visible in the list):*

![](/files/-MR0ZYRHW_Kx_AeLLxwV)

1\) Click on the **ellipsis** to the right of the **CreateIncidentReceipt** Message & click **Copy**.

{% hint style="success" %}
Rather than create the Receipt Message from scratch, it will be quicker to copy the CreateIncidentReceipt Message and make one minor change.
{% endhint %}

## Copy Message Modal

The fields to edit for the Copy Message modal are as follows:

|  #  | Field        | Description                                           | Value     |
| :-: | ------------ | ----------------------------------------------------- | --------- |
|  2  | Message name | The message name that is unique for this integration. | 'Receipt' |

*Your Copy Message modal should look like this:*

![](/files/-MR0_5_vx-2J024hDdwm)

3\) Click **Copy**.

You will be redirected to the Details page of the newly created Receipt Message.

## Script Editor Fields

Navigate to **Advanced > Script Editor**, then **View > Inbound**.

*Your Script Editor fields should initially look like this:*

![](/files/-MR0_G2FCuFQ4GXssvWX)

The Script Editor fields to be edited are as follows:

|  #  | Field                     | Description        | Value                                                                               |
| :-: | ------------------------- | ------------------ | ----------------------------------------------------------------------------------- |
|  4  | Stage to Target (Inbound) | The script to run. | **Delete** the following code that sits outside of the End tag: **bond.setOpen();** |

## Scripts

*The code in the 'Stage to Target' script field should look like this:*

```javascript
//===== [ws] Begin Unifi Auto Generated Code =====//

/*
 * This code (between the Begin and End comments) is generated from the
 * Field and Field mapping records which are configured as part of the integration.
 *
 * All code either above or below the comments will be automatically maintained
 * through the build cycle.
 *
 * WARNING: Do not edit the Begin or End comments.
 */



if (x_snd_eb.ws_console.hasError()) {
  var errors = x_snd_eb.ws_console.get({type: 'error'});
  if (errors.length) {
    throw errors[0];
  }
}

//===== [ws] End Unifi Auto Generated Code =====//
```

*Your Script Editor fields should now look like this:*

![](/files/-MR0_g3-cSbEhKNFGApt)

5\) Click **Save**.

6\) Click **Build Message**.

You will see the 'Message build successful' Info Message.

![](/files/-MR0_tANOPBhx2H3fF2k)

7\) Click the **'Messages' icon** to move on & configure the **UpdateIncident** Message.

{% hint style="info" %}
There is no further configuration required for the Receipt Message.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sharelogic.com/unifi/2.2/integration-guides/bidirectional-asynchronous-incident-guide/update-scenario/receipt-message.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
