{
  "name": "mayHaveBeenProcessed — по всему вызову, а не по последней попытке",
  "description": "Запись с ключом вызывающего оборвалась после отправки, оба повтора не смогли соединиться — transport с mayHaveBeenProcessed = true и ключом вызова: первая попытка могла быть обработана. Запись с ключом SDK получила 429 (Retry-After: 1), затем два сбоя соединения — false: ограничитель отказывает до обработки. GET получил 503, затем два сбоя соединения — true: 503 прокси мог прийти после обработки. Паузы: 500, 1000; 1000 (Retry-After), 1000; 500, 1000.",
  "client": {
    "api": "runtime",
    "credential": {"terminalKey": "lk_test_k7m2p9q4r8s3.RqTvNAJirupwDOPZ8O48PZpsbGlZGfecp04FD7w06kw"},
    "baseUrl": "https://api.example.com"
  },
  "calls": [
    {
      "operation": "registerReceipt",
      "args": {
        "body": {
          "number": "1044",
          "business_date": "2026-10-11",
          "purchased_at": "2026-10-11T15:04:12+03:00",
          "member": {"phone": "+79000000001"},
          "lines": [{"id": "1", "sku": "LATTE-M", "name": "Латте 300 мл", "quantity": 2000, "amount": 50000}],
          "cashier": "Иванова"
        }
      },
      "options": {"idempotencyKey": "receipt:till-07:2026-10-11:1044"},
      "expect": {
        "error": {
          "class": "transport",
          "mayHaveBeenProcessed": true,
          "idempotencyKey": "receipt:till-07:2026-10-11:1044"
        }
      }
    },
    {
      "operation": "registerReceipt",
      "args": {
        "body": {
          "number": "1045",
          "business_date": "2026-10-11",
          "purchased_at": "2026-10-11T15:06:40+03:00",
          "member": {"phone": "+79000000001"},
          "lines": [{"id": "1", "sku": "LATTE-M", "name": "Латте 300 мл", "quantity": 2000, "amount": 50000}],
          "cashier": "Иванова"
        }
      },
      "expect": {
        "error": {
          "class": "transport",
          "mayHaveBeenProcessed": false,
          "idempotencyKey": "{{idempotency-key}}"
        },
        "meta": {"operationId": "registerReceipt", "status": 429, "requestId": "01929c20-0001-7000-8000-000000000001"}
      }
    },
    {
      "operation": "getReceipt",
      "args": {"receipt": "01929c1e-0050-7050-8050-000000000050"},
      "expect": {
        "error": {
          "class": "transport",
          "mayHaveBeenProcessed": true,
          "idempotencyKey": null
        },
        "meta": {"operationId": "getReceipt", "status": 503, "requestId": "01929c20-0002-7000-8000-000000000002"}
      }
    }
  ],
  "exchanges": [
    {
      "request": {
        "method": "POST",
        "url": "https://api.example.com/api/v1/receipts",
        "headers": {
          "authorization": "Bearer lk_test_k7m2p9q4r8s3.RqTvNAJirupwDOPZ8O48PZpsbGlZGfecp04FD7w06kw",
          "accept": "application/json",
          "content-type": "application/json",
          "idempotency-key": "receipt:till-07:2026-10-11:1044",
          "loyal-merchant": null
        },
        "json": {
          "number": "1044",
          "business_date": "2026-10-11",
          "purchased_at": "2026-10-11T15:04:12+03:00",
          "member": {"phone": "+79000000001"},
          "lines": [{"id": "1", "sku": "LATTE-M", "name": "Латте 300 мл", "quantity": 2000, "amount": 50000}],
          "cashier": "Иванова"
        }
      },
      "failure": "after_send"
    },
    {
      "request": {
        "method": "POST",
        "url": "https://api.example.com/api/v1/receipts",
        "headers": {
          "authorization": "Bearer lk_test_k7m2p9q4r8s3.RqTvNAJirupwDOPZ8O48PZpsbGlZGfecp04FD7w06kw",
          "accept": "application/json",
          "content-type": "application/json",
          "idempotency-key": "receipt:till-07:2026-10-11:1044",
          "loyal-merchant": null
        },
        "json": {
          "number": "1044",
          "business_date": "2026-10-11",
          "purchased_at": "2026-10-11T15:04:12+03:00",
          "member": {"phone": "+79000000001"},
          "lines": [{"id": "1", "sku": "LATTE-M", "name": "Латте 300 мл", "quantity": 2000, "amount": 50000}],
          "cashier": "Иванова"
        }
      },
      "failure": "before_send"
    },
    {
      "request": {
        "method": "POST",
        "url": "https://api.example.com/api/v1/receipts",
        "headers": {
          "authorization": "Bearer lk_test_k7m2p9q4r8s3.RqTvNAJirupwDOPZ8O48PZpsbGlZGfecp04FD7w06kw",
          "accept": "application/json",
          "content-type": "application/json",
          "idempotency-key": "receipt:till-07:2026-10-11:1044",
          "loyal-merchant": null
        },
        "json": {
          "number": "1044",
          "business_date": "2026-10-11",
          "purchased_at": "2026-10-11T15:04:12+03:00",
          "member": {"phone": "+79000000001"},
          "lines": [{"id": "1", "sku": "LATTE-M", "name": "Латте 300 мл", "quantity": 2000, "amount": 50000}],
          "cashier": "Иванова"
        }
      },
      "failure": "before_send"
    },
    {
      "request": {
        "method": "POST",
        "url": "https://api.example.com/api/v1/receipts",
        "headers": {
          "authorization": "Bearer lk_test_k7m2p9q4r8s3.RqTvNAJirupwDOPZ8O48PZpsbGlZGfecp04FD7w06kw",
          "accept": "application/json",
          "content-type": "application/json",
          "idempotency-key": "{{idempotency-key}}",
          "loyal-merchant": null
        },
        "json": {
          "number": "1045",
          "business_date": "2026-10-11",
          "purchased_at": "2026-10-11T15:06:40+03:00",
          "member": {"phone": "+79000000001"},
          "lines": [{"id": "1", "sku": "LATTE-M", "name": "Латте 300 мл", "quantity": 2000, "amount": 50000}],
          "cashier": "Иванова"
        }
      },
      "response": {
        "status": 429,
        "headers": {
          "Content-Type": "application/problem+json",
          "X-Request-Id": "01929c20-0001-7000-8000-000000000001",
          "Loyal-Environment": "sandbox",
          "Retry-After": "1",
          "RateLimit-Limit": "60",
          "RateLimit-Remaining": "0",
          "RateLimit-Reset": "1"
        },
        "json": {
          "type": "urn:loyal:problem:too_many_requests",
          "title": "Too many requests.",
          "status": 429,
          "code": "too_many_requests",
          "request_id": "01929c20-0001-7000-8000-000000000001"
        }
      }
    },
    {
      "request": {
        "method": "POST",
        "url": "https://api.example.com/api/v1/receipts",
        "headers": {
          "authorization": "Bearer lk_test_k7m2p9q4r8s3.RqTvNAJirupwDOPZ8O48PZpsbGlZGfecp04FD7w06kw",
          "accept": "application/json",
          "content-type": "application/json",
          "idempotency-key": "{{idempotency-key}}",
          "loyal-merchant": null
        },
        "json": {
          "number": "1045",
          "business_date": "2026-10-11",
          "purchased_at": "2026-10-11T15:06:40+03:00",
          "member": {"phone": "+79000000001"},
          "lines": [{"id": "1", "sku": "LATTE-M", "name": "Латте 300 мл", "quantity": 2000, "amount": 50000}],
          "cashier": "Иванова"
        }
      },
      "failure": "before_send"
    },
    {
      "request": {
        "method": "POST",
        "url": "https://api.example.com/api/v1/receipts",
        "headers": {
          "authorization": "Bearer lk_test_k7m2p9q4r8s3.RqTvNAJirupwDOPZ8O48PZpsbGlZGfecp04FD7w06kw",
          "accept": "application/json",
          "content-type": "application/json",
          "idempotency-key": "{{idempotency-key}}",
          "loyal-merchant": null
        },
        "json": {
          "number": "1045",
          "business_date": "2026-10-11",
          "purchased_at": "2026-10-11T15:06:40+03:00",
          "member": {"phone": "+79000000001"},
          "lines": [{"id": "1", "sku": "LATTE-M", "name": "Латте 300 мл", "quantity": 2000, "amount": 50000}],
          "cashier": "Иванова"
        }
      },
      "failure": "before_send"
    },
    {
      "request": {
        "method": "GET",
        "url": "https://api.example.com/api/v1/receipts/01929c1e-0050-7050-8050-000000000050",
        "headers": {
          "authorization": "Bearer lk_test_k7m2p9q4r8s3.RqTvNAJirupwDOPZ8O48PZpsbGlZGfecp04FD7w06kw",
          "accept": "application/json",
          "content-type": null,
          "idempotency-key": null,
          "loyal-merchant": null
        }
      },
      "response": {
        "status": 503,
        "headers": {
          "Content-Type": "application/problem+json",
          "X-Request-Id": "01929c20-0002-7000-8000-000000000002",
          "Loyal-Environment": "sandbox"
        },
        "json": {
          "type": "urn:loyal:problem:http_503",
          "title": "Service Unavailable",
          "status": 503,
          "code": "http_503",
          "request_id": "01929c20-0002-7000-8000-000000000002"
        }
      }
    },
    {
      "request": {
        "method": "GET",
        "url": "https://api.example.com/api/v1/receipts/01929c1e-0050-7050-8050-000000000050",
        "headers": {
          "authorization": "Bearer lk_test_k7m2p9q4r8s3.RqTvNAJirupwDOPZ8O48PZpsbGlZGfecp04FD7w06kw",
          "accept": "application/json",
          "content-type": null,
          "idempotency-key": null,
          "loyal-merchant": null
        }
      },
      "failure": "before_send"
    },
    {
      "request": {
        "method": "GET",
        "url": "https://api.example.com/api/v1/receipts/01929c1e-0050-7050-8050-000000000050",
        "headers": {
          "authorization": "Bearer lk_test_k7m2p9q4r8s3.RqTvNAJirupwDOPZ8O48PZpsbGlZGfecp04FD7w06kw",
          "accept": "application/json",
          "content-type": null,
          "idempotency-key": null,
          "loyal-merchant": null
        }
      },
      "failure": "before_send"
    }
  ],
  "sleeps": [500, 1000, 1000, 1000, 500, 1000]
}
