Create iCount income document

Credentials

No credentials are documented for this endpoint.

Create an income document using the iCount integration format.

Parameters

This endpoint takes no path, query or header parameters.

Request body

Content type: application/json

Field Type Required Description
sellerEmail string yes
sellerSocialIdNumber integer yes
docType string yes
valueDate string yes
currency string yes
clientName string yes
clientId string no
documentNumber string yes
items array yes
items[].itemDescription string no
items[].itemCurrency string no
items[].itemVatExempt boolean no
items[].itemPrice number no
items[].quantity number no
cash object no
cash.amount number no
cash.paymentDate string no
bankTransfer object no
bankTransfer.amount number no
bankTransfer.paymentDate string no
bankTransfer.bankNumber string no
bankTransfer.branch integer no
bankTransfer.account integer no
creditCard object no
creditCard.amount number no
creditCard.paymentDate string no
creditCard.ccCardNumber string no
payPal object no
payPal.amount number no
payPal.paymentDate string no
payPal.accountId string no
totalVat number yes
totalSumIncludingVat number yes
originTaxDeduction number yes
fileName string yes
filePath string yes

Request example

{
  "sellerEmail": "seller@example.com",
  "sellerSocialIdNumber": 123456789,
  "docType": "invoice",
  "valueDate": "2024-01-15",
  "currency": "ILS",
  "clientName": "John Doe",
  "clientId": "987654321",
  "documentNumber": "INV-001",
  "items": [
    {
      "itemDescription": "Consulting Service",
      "itemCurrency": "ILS",
      "itemVatExempt": false,
      "itemPrice": 1000,
      "quantity": 1
    }
  ],
  "totalVat": 170,
  "totalSumIncludingVat": 1170,
  "originTaxDeduction": 0,
  "fileName": "invoice.pdf",
  "filePath": "uploads/invoices/invoice.pdf"
}

Code samples

curl

curl -X POST 'https://sandbox.payme.io/api/partner/api/documents/income/icount' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "sellerEmail": "seller@example.com",
  "sellerSocialIdNumber": 123456789,
  "docType": "invoice",
  "valueDate": "2024-01-15",
  "currency": "ILS",
  "clientName": "John Doe",
  "clientId": "987654321",
  "documentNumber": "INV-001",
  "items": [
    {
      "itemDescription": "Consulting Service",
      "itemCurrency": "ILS",
      "itemVatExempt": false,
      "itemPrice": 1000,
      "quantity": 1
    }
  ],
  "totalVat": 170,
  "totalSumIncludingVat": 1170,
  "originTaxDeduction": 0,
  "fileName": "invoice.pdf",
  "filePath": "uploads/invoices/invoice.pdf"
}'

Node.js

const response = await fetch("https://sandbox.payme.io/api/partner/api/documents/income/icount", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "sellerEmail": "seller@example.com",
    "sellerSocialIdNumber": 123456789,
    "docType": "invoice",
    "valueDate": "2024-01-15",
    "currency": "ILS",
    "clientName": "John Doe",
    "clientId": "987654321",
    "documentNumber": "INV-001",
    "items": [
      {
        "itemDescription": "Consulting Service",
        "itemCurrency": "ILS",
        "itemVatExempt": false,
        "itemPrice": 1000,
        "quantity": 1
      }
    ],
    "totalVat": 170,
    "totalSumIncludingVat": 1170,
    "originTaxDeduction": 0,
    "fileName": "invoice.pdf",
    "filePath": "uploads/invoices/invoice.pdf"
  }),
});

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

Python

import requests

response = requests.post(
    "https://sandbox.payme.io/api/partner/api/documents/income/icount",
    json={
        "sellerEmail": "seller@example.com",
        "sellerSocialIdNumber": 123456789,
        "docType": "invoice",
        "valueDate": "2024-01-15",
        "currency": "ILS",
        "clientName": "John Doe",
        "clientId": "987654321",
        "documentNumber": "INV-001",
        "items": [
            {
                "itemDescription": "Consulting Service",
                "itemCurrency": "ILS",
                "itemVatExempt": False,
                "itemPrice": 1000,
                "quantity": 1,
            },
        ],
        "totalVat": 170,
        "totalSumIncludingVat": 1170,
        "originTaxDeduction": 0,
        "fileName": "invoice.pdf",
        "filePath": "uploads/invoices/invoice.pdf",
    },
)

print(response.text)

PHP

<?php

$body = <<<'BODY'
{
  "sellerEmail": "seller@example.com",
  "sellerSocialIdNumber": 123456789,
  "docType": "invoice",
  "valueDate": "2024-01-15",
  "currency": "ILS",
  "clientName": "John Doe",
  "clientId": "987654321",
  "documentNumber": "INV-001",
  "items": [
    {
      "itemDescription": "Consulting Service",
      "itemCurrency": "ILS",
      "itemVatExempt": false,
      "itemPrice": 1000,
      "quantity": 1
    }
  ],
  "totalVat": 170,
  "totalSumIncludingVat": 1170,
  "originTaxDeduction": 0,
  "fileName": "invoice.pdf",
  "filePath": "uploads/invoices/invoice.pdf"
}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/partner/api/documents/income/icount');
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 — iCount document 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"
}