Morning.co invoice webhook

Credentials

No credentials are documented for this endpoint.

Webhook endpoint for Morning.co invoice integration. Receives notifications when invoices are created in Morning system.

Parameters

This endpoint takes no path, query or header parameters.

Request body

Content type: application/json

Field Type Required Description
event string no Event type (e.g., document.issued)
documentId string no Morning document ID
documentType string no Document type (tax_invoice, receipt, etc.)
amount number no Total document amount
currency string no Currency code
customerEmail string no Customer email address
issuedAt string no Document issuance timestamp

Request example

{
  "event": "document.issued",
  "documentId": "doc_123456",
  "documentType": "tax_invoice",
  "amount": 1170,
  "currency": "ILS",
  "customerEmail": "customer@example.com",
  "issuedAt": "2024-01-15T10:30:00Z"
}

Code samples

curl

curl -X POST 'https://sandbox.payme.io/api/partner/api/documents/income/hook/morning' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "event": "document.issued",
  "documentId": "doc_123456",
  "documentType": "tax_invoice",
  "amount": 1170,
  "currency": "ILS",
  "customerEmail": "customer@example.com",
  "issuedAt": "2024-01-15T10:30:00Z"
}'

Node.js

const response = await fetch("https://sandbox.payme.io/api/partner/api/documents/income/hook/morning", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "event": "document.issued",
    "documentId": "doc_123456",
    "documentType": "tax_invoice",
    "amount": 1170,
    "currency": "ILS",
    "customerEmail": "customer@example.com",
    "issuedAt": "2024-01-15T10:30:00Z"
  }),
});

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

Python

import requests

response = requests.post(
    "https://sandbox.payme.io/api/partner/api/documents/income/hook/morning",
    json={
        "event": "document.issued",
        "documentId": "doc_123456",
        "documentType": "tax_invoice",
        "amount": 1170,
        "currency": "ILS",
        "customerEmail": "customer@example.com",
        "issuedAt": "2024-01-15T10:30:00Z",
    },
)

print(response.text)

PHP

<?php

$body = <<<'BODY'
{
  "event": "document.issued",
  "documentId": "doc_123456",
  "documentType": "tax_invoice",
  "amount": 1170,
  "currency": "ILS",
  "customerEmail": "customer@example.com",
  "issuedAt": "2024-01-15T10:30:00Z"
}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/partner/api/documents/income/hook/morning');
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

200 — Webhook processed successfully (success)

401 — Unauthorized - Invalid or missing authentication (error)

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