Guides

Conversations

Conversations allow you to exchange messages within the context of a specific payment. Each payment can have one conversation thread where parties can discuss details, share documents, and resolve queries.


Before you start

You will need:

  • A valid API key to authenticate your requests.
  • A connector payment id — the numeric id returned on a submitted payment intent under executions[].connectorPaymentIds. Conversation endpoints are keyed by this id.

JSON examples show the unwrapped `data` payload

Every success response on the wire is { "data": { ... } }. The JSON examples in this guide show the inner data value — what you get after const { data } = await response.json(). Error responses are not wrapped — see Errors.

Getting a conversation

Retrieve the conversation for a payment. Returns an empty messages array if no conversation exists yet:

curl 'https://api.nexpay.com.au/v2/payments/123/conversation' \
  -H 'X-API-Key: nxp_ck_your-client-id:nxp_sk_your-secret'
{
  "id": 42,
  "paymentId": 123,
  "isClosed": false,
  "isRead": true,
  "messages": [
    {
      "userId": 300,
      "isAdminResponse": false,
      "subject": "Payment query",
      "text": "Can you confirm the enrollment letter was received?",
      "createdOn": "2026-03-15T09:00:00.000Z",
      "userFullName": "Jane Doe",
      "attachments": []
    },
    {
      "userId": 1,
      "isAdminResponse": true,
      "text": "Yes, we have received all documents. Payment is being processed.",
      "createdOn": "2026-03-15T10:30:00.000Z",
      "userFullName": "Support Team",
      "attachments": []
    }
  ]
}

Sending a message

Send a message in the payment conversation. If no conversation exists, one is created automatically:

curl -X POST 'https://api.nexpay.com.au/v2/payments/123/conversation/messages' \
  -H 'X-API-Key: nxp_ck_your-client-id:nxp_sk_your-secret' \
  -H 'Content-Type: application/json' \
  -d '{
    "subject": "Payment query",
    "text": "Can you confirm the enrollment letter was received?",
    "attachments": [
      "f47ac10b-58cc-4372-a567-0e02b2c3d479"
    ]
  }'

Message fields

FieldTypeRequiredDescription
textstringYesThe message content.
subjectstringNoOptional subject line for the message.
attachmentsstring[]NoArray of document UUIDs uploaded via the Documents API.

Attachments

Attachments must be uploaded via POST /documents before being referenced in a message. See Uploading documents.


Checking for unread messages

Check if a payment's conversation has unread messages without fetching the full thread:

curl 'https://api.nexpay.com.au/v2/payments/123/conversation/unread' \
  -H 'X-API-Key: nxp_ck_your-client-id:nxp_sk_your-secret'

Downloading an attachment

Download a file attached to a conversation message:

curl 'https://api.nexpay.com.au/v2/payments/123/conversation/attachments/f47ac10b-58cc-4372-a567-0e02b2c3d479' \
  -H 'X-API-Key: nxp_ck_your-client-id:nxp_sk_your-secret' \
  --output attachment.bin

Closing a conversation

Close a conversation when it's no longer needed:

curl -X POST 'https://api.nexpay.com.au/v2/payments/123/conversation/close' \
  -H 'X-API-Key: nxp_ck_your-client-id:nxp_sk_your-secret' \
  -H 'Content-Type: application/json' \
  -d '{}'

Closed conversations

Once a conversation is closed, no new messages can be sent. Attempting to send a message to a closed conversation will return a [CNV0002] error.


Things to know

  • Each payment can have at most one conversation.
  • Conversations are created automatically when the first message is sent.
  • The isAdminResponse field indicates whether a message was sent by the Nexpay admin team.
  • Attachment IDs are UUID v4 references to documents uploaded via the Documents API.
  • Conversations are scoped to your tenant — they cannot be accessed across organizations.
Previous
Commissions