Create message log entry

Credentials

No credentials are documented for this endpoint.

Log a communication event (SMS or Email) sent to a seller. This endpoint is used to track all communications with sellers for audit and support purposes.

Parameters

This endpoint takes no path, query or header parameters.

Request body

Content type: application/json

Field Type Required Description
sellerId string no Seller UUID (mutually exclusive with sellerEmail and sellerSocialId)
sellerEmail string no Seller email address (alternative identifier)
sellerSocialId string no Seller Israeli ID number (ת.ז. / ח.פ.)
sentAt string yes Timestamp when the message was sent
correlationId string no Optional correlation ID for tracking related messages
description string no Optional description of the communication purpose
sms object no SMS message details (optional)
sms.sentTo string yes Recipient address (phone number for SMS, email address for email)
sms.content string yes Message content
email object no Email message details (optional)
email.sentTo string yes Recipient address (phone number for SMS, email address for email)
email.content string yes Message content

Request example

{
  "sellerId": "550e8400-e29b-41d4-a716-446655440000",
  "sentAt": "2024-01-15T10:30:00Z",
  "correlationId": "corr-123456",
  "description": "Payment reminder",
  "sms": {
    "sentTo": "0501234567",
    "content": "Reminder: Your invoice #12345 is due tomorrow."
  }
}

Code samples

curl

curl -X POST 'https://sandbox.payme.io/api/public/message-log' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "sellerId": "550e8400-e29b-41d4-a716-446655440000",
  "sentAt": "2024-01-15T10:30:00Z",
  "correlationId": "corr-123456",
  "description": "Payment reminder",
  "sms": {
    "sentTo": "0501234567",
    "content": "Reminder: Your invoice #12345 is due tomorrow."
  }
}'

Node.js

const response = await fetch("https://sandbox.payme.io/api/public/message-log", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "sellerId": "550e8400-e29b-41d4-a716-446655440000",
    "sentAt": "2024-01-15T10:30:00Z",
    "correlationId": "corr-123456",
    "description": "Payment reminder",
    "sms": {
      "sentTo": "0501234567",
      "content": "Reminder: Your invoice #12345 is due tomorrow."
    }
  }),
});

console.log(await response.text());

Python

import requests

response = requests.post(
    "https://sandbox.payme.io/api/public/message-log",
    json={
        "sellerId": "550e8400-e29b-41d4-a716-446655440000",
        "sentAt": "2024-01-15T10:30:00Z",
        "correlationId": "corr-123456",
        "description": "Payment reminder",
        "sms": {
            "sentTo": "0501234567",
            "content": "Reminder: Your invoice #12345 is due tomorrow.",
        },
    },
)

print(response.text)

PHP

<?php

$body = <<<'BODY'
{
  "sellerId": "550e8400-e29b-41d4-a716-446655440000",
  "sentAt": "2024-01-15T10:30:00Z",
  "correlationId": "corr-123456",
  "description": "Payment reminder",
  "sms": {
    "sentTo": "0501234567",
    "content": "Reminder: Your invoice #12345 is due tomorrow."
  }
}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/public/message-log');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;

Responses

201 — Message log entry created successfully (success)

400 — Bad Request - Validation failed (error)

Field Type Description
statusCode integer
message string
error string
{
  "statusCode": 400,
  "message": [
    "Validation failed"
  ],
  "error": "Bad Request"
}

401 — Unauthorized - Invalid or missing authentication (error)

Field Type Description
statusCode integer
message string
error string
{
  "statusCode": 401,
  "message": "Unauthorized",
  "error": "Unauthorized"
}

404 — Seller not found (error)