BillOSDocs
Console
Payments
POST/businesses/{bid}/documents/{id}/payment-request

Requires the documents scope.

For an issued tax invoice (305) or proforma (300) in shekels with something still owed. The amount defaults to what is owed. Paid, it issues a קבלה (400) that names the invoice, or for a proforma a חשבונית מס/קבלה (320) that names it (a 400 for an עוסק פטור), and the document is closed.

Path parameters

bidstringrequired
Business id, from POST /businesses.
idstringrequired
Document id.

Headers

Idempotency-Keystring
Your own stable id for this call. A retry returns the same row with deduped: true instead of creating a duplicate. Interchangeable with externalRef in the body.

Body (optional)

amountinteger
Integer agorot (₪1 = 100).
descriptionstring
partyobject
ShowHide 2 child attributes
party.phonestring
party.emailstring
maxInstallmentsinteger
expiresAtstring
externalRefstring

Response

201: { "ok": true, … }

okbooleanrequired
paymentRequestPaymentRequestrequired
A request for a payment and its public link. When the card company confirms the payment, BillOS issues the receipt itself: a קבלה (400) for an invoice it pays, a חשבונית מס/קבלה (320) for a proforma or for its own lines (a 400 for an עוסק פטור), and the invoice it paid is closed.
dedupedboolean

Errors: 400, 401, 403, 404, 429. Every failure answers { "error", "reason", "hint", "param", "doc_url", "retryable", "request_id" }: branch on reason, and read hint for what to change (https://docs.billos.co.il/errors.md).

curl -X POST "$BASE/businesses/$BID/documents/$DOC_ID/payment-request" \
  -H "X-Api-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "party": {
      "phone": "0521111111",
      "email": "dana@example.com"
    },
    "externalRef": "order-8812"
  }'
const res = await fetch(`${BASE}/businesses/${BID}/documents/${DOC_ID}/payment-request`, {
  method: 'POST',
  headers: {
    'X-Api-Key': KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "party": {
      "phone": "0521111111",
      "email": "dana@example.com"
    },
    "externalRef": "order-8812"
  }),
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
import requests
res = requests.post(
    f"{BASE}/businesses/{BID}/documents/{DOC_ID}/payment-request",
    headers={"X-Api-Key": KEY},
    json={
      "party": {
        "phone": "0521111111",
        "email": "dana@example.com"
      },
      "externalRef": "order-8812"
    },
)
data = res.json()
$ch = curl_init("$BASE/businesses/$BID/documents/$DOC_ID/payment-request");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["X-Api-Key: $KEY", 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'party' => [
      'phone' => '0521111111',
      'email' => 'dana@example.com',
    ],
    'externalRef' => 'order-8812',
  ]),
]);
$data = json_decode(curl_exec($ch), true);
using System.Text;
using System.Text.Json;

using var http = new HttpClient();
using var req = new HttpRequestMessage(HttpMethod.Post, $"{BASE}/businesses/{BID}/documents/{DOC_ID}/payment-request");
req.Headers.Add("X-Api-Key", KEY);
req.Content = new StringContent("""
    {
      "party": {
        "phone": "0521111111",
        "email": "dana@example.com"
      },
      "externalRef": "order-8812"
    }
    """, Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);
var data = JsonDocument.Parse(await res.Content.ReadAsStringAsync()).RootElement;
$BASE https://api.billos.co.il/v1$KEY a bk_test_… or bk_live_… key