[{"data":1,"prerenderedAt":893},["ShallowReactive",2],{"navigation":3,"\u002Fuser":43,"\u002Fuser-surround":888},[4,8,13,18,23,28,33,38],{"title":5,"path":6,"stem":7},"Getting started","\u002F","index",{"title":9,"path":10,"stem":11,"order":12},"Numbers","\u002Fnumbers","numbers",1,{"title":14,"path":15,"stem":16,"order":17},"Rent","\u002Frent","rent",2,{"title":19,"path":20,"stem":21,"order":22},"User","\u002Fuser","user",3,{"title":24,"path":25,"stem":26,"order":27},"Free numbers","\u002Ffree","free",4,{"title":29,"path":30,"stem":31,"order":32},"Webhooks","\u002Fwebhooks","webhooks",5,{"title":34,"path":35,"stem":36,"order":37},"Testing","\u002Ftesting","testing",6,{"title":39,"path":40,"stem":41,"order":42},"Changelog","\u002Fchangelog","changelog",7,{"id":44,"title":19,"body":45,"description":882,"extension":883,"meta":884,"navigation":885,"path":20,"seo":886,"stem":21,"__hash__":887},"docs\u002Fuser.md",{"type":46,"value":47,"toc":874},"minimark",[48,52,56,89,114,205,226,229,232,250,273,364,368,371,406,437,530,534,544,573,603,611,615,620,638,659,663,666,696,741,870],[49,50,51],"h2",{"id":51},"balance",[53,54,55],"p",{},"Balance in USD.",[57,58,63],"pre",{"className":59,"code":60,"language":61,"meta":62,"style":62},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","public function balance(): array\n","php","",[64,65,66],"code",{"__ignoreMap":62},[67,68,70,74,77,81,85],"span",{"class":69,"line":12},"line",[67,71,73],{"class":72},"spNyl","public",[67,75,76],{"class":72}," function",[67,78,80],{"class":79},"s2Zo4"," balance",[67,82,84],{"class":83},"sMK4o","():",[67,86,88],{"class":87},"sbssI"," array\n",[53,90,91,92,95,96,99,100,102,103,106,107,110,111,113],{},"Returns ",[64,93,94],{},"['balance' => float, 'zbalance' => float, 'income' => float]"," (",[64,97,98],{},"income"," only when the server sends it). ",[64,101,51],{}," includes the sum frozen by numbers and unconfirmed rents in progress (",[64,104,105],{},"zbalance",", which may be negative): available = ",[64,108,109],{},"balance − max(zbalance, 0)",". ",[64,112,98],{}," is the partner income. The server caches the answer for 60 s.",[57,115,117],{"className":59,"code":116,"language":61,"meta":62,"style":62},"$b = $client->user->balance();\n$available = $b['balance'] - max($b['zbalance'], 0);\n",[64,118,119,149],{"__ignoreMap":62},[67,120,121,124,128,131,134,137,140,142,144,146],{"class":69,"line":12},[67,122,123],{"class":83},"$",[67,125,127],{"class":126},"sTEyZ","b ",[67,129,130],{"class":83},"=",[67,132,133],{"class":83}," $",[67,135,136],{"class":126},"client",[67,138,139],{"class":83},"->",[67,141,21],{"class":126},[67,143,139],{"class":83},[67,145,51],{"class":79},[67,147,148],{"class":83},"();\n",[67,150,151,153,156,158,160,163,166,169,172,174,177,180,183,186,188,190,192,194,196,199,202],{"class":69,"line":17},[67,152,123],{"class":83},[67,154,155],{"class":126},"available ",[67,157,130],{"class":83},[67,159,133],{"class":83},[67,161,162],{"class":126},"b",[67,164,165],{"class":83},"[",[67,167,168],{"class":83},"'",[67,170,51],{"class":171},"sfazB",[67,173,168],{"class":83},[67,175,176],{"class":83},"]",[67,178,179],{"class":83}," -",[67,181,182],{"class":79}," max",[67,184,185],{"class":83},"($",[67,187,162],{"class":126},[67,189,165],{"class":83},[67,191,168],{"class":83},[67,193,105],{"class":171},[67,195,168],{"class":83},[67,197,198],{"class":83},"],",[67,200,201],{"class":87}," 0",[67,203,204],{"class":83},");\n",[53,206,207,208,211,212,215,216,215,219,215,222,225],{},"Errors: ",[64,209,210],{},"ApiError"," ",[64,213,214],{},"ERROR_WRONG_KEY",", ",[64,217,218],{},"ACCOUNT_BLOCKED",[64,220,221],{},"API_ACCESS_DISABLED",[64,223,224],{},"API_ACCESS_IP",".",[49,227,228],{"id":228},"profile",[53,230,231],{},"The account profile.",[57,233,235],{"className":59,"code":234,"language":61,"meta":62,"style":62},"public function profile(): array\n",[64,236,237],{"__ignoreMap":62},[67,238,239,241,243,246,248],{"class":69,"line":12},[67,240,73],{"class":72},[67,242,76],{"class":72},[67,244,245],{"class":79}," profile",[67,247,84],{"class":83},[67,249,88],{"class":87},[53,251,252,255,256,259,260,263,264,215,267,211,270,225],{},[64,253,254],{},"Profile",": ",[64,257,258],{},"['id', 'name', 'username', 'email', 'locale', 'currency', 'number_country', 'number_reject', 'webhook_url', 'api_access', 'number', 'country', …]"," — ",[64,261,262],{},"number"," is ",[64,265,266],{},"?int",[64,268,269],{},"country",[64,271,272],{},"?string",[57,274,276],{"className":59,"code":275,"language":61,"meta":62,"style":62},"$profile = $client->user->profile();\necho $profile['email'] ?? '', ' ', $profile['webhook_url'] ?? 'no webhook';\n",[64,277,278,301],{"__ignoreMap":62},[67,279,280,282,285,287,289,291,293,295,297,299],{"class":69,"line":12},[67,281,123],{"class":83},[67,283,284],{"class":126},"profile ",[67,286,130],{"class":83},[67,288,133],{"class":83},[67,290,136],{"class":126},[67,292,139],{"class":83},[67,294,21],{"class":126},[67,296,139],{"class":83},[67,298,228],{"class":79},[67,300,148],{"class":83},[67,302,303,306,308,310,312,314,317,319,321,324,327,330,333,335,337,339,341,343,345,348,350,352,354,356,359,361],{"class":69,"line":17},[67,304,305],{"class":79},"echo",[67,307,133],{"class":83},[67,309,228],{"class":126},[67,311,165],{"class":83},[67,313,168],{"class":83},[67,315,316],{"class":171},"email",[67,318,168],{"class":83},[67,320,176],{"class":83},[67,322,323],{"class":83}," ??",[67,325,326],{"class":83}," ''",[67,328,329],{"class":83},",",[67,331,332],{"class":83}," '",[67,334,332],{"class":83},[67,336,329],{"class":83},[67,338,133],{"class":83},[67,340,228],{"class":126},[67,342,165],{"class":83},[67,344,168],{"class":83},[67,346,347],{"class":171},"webhook_url",[67,349,168],{"class":83},[67,351,176],{"class":83},[67,353,323],{"class":83},[67,355,332],{"class":83},[67,357,358],{"class":171},"no webhook",[67,360,168],{"class":83},[67,362,363],{"class":83},";\n",[49,365,367],{"id":366},"paymenthistory","paymentHistory",[53,369,370],{},"Top-up orders (paginated, newest first) and the available payment methods.",[57,372,374],{"className":59,"code":373,"language":61,"meta":62,"style":62},"public function paymentHistory(int $page = 1): array\n",[64,375,376],{"__ignoreMap":62},[67,377,378,380,382,385,388,391,393,396,398,401,404],{"class":69,"line":12},[67,379,73],{"class":72},[67,381,76],{"class":72},[67,383,384],{"class":79}," paymentHistory",[67,386,387],{"class":83},"(",[67,389,390],{"class":87},"int",[67,392,133],{"class":83},[67,394,395],{"class":126},"page ",[67,397,130],{"class":83},[67,399,400],{"class":87}," 1",[67,402,403],{"class":83},"):",[67,405,88],{"class":87},[53,407,408,255,411,110,414,417,418,421,422,425,426,429,430,110,433,436],{},[64,409,410],{},"PaymentHistory",[64,412,413],{},"['orders' => Paginator\u003CPaymentOrder>, 'paylist', 'domains'?, 'forms'?, 'currency'?, 'buttons'?]",[64,415,416],{},"PaymentOrder['sum']"," stays a decimal string (",[64,419,420],{},"\"89.00\"","); ",[64,423,424],{},"currency"," and ",[64,427,428],{},"form_text"," may be ",[64,431,432],{},"null",[64,434,435],{},"paylist"," maps a group id to its payment methods, or is a list when the ids are 0, 1, 2… (the server sends a JSON array then).",[57,438,440],{"className":59,"code":439,"language":61,"meta":62,"style":62},"$orders = $client->user->paymentHistory()['orders'];\necho \"{$orders['total']} orders, page {$orders['current_page']}\u002F{$orders['last_page']}\\n\";\n",[64,441,442,476],{"__ignoreMap":62},[67,443,444,446,449,451,453,455,457,459,461,463,466,468,471,473],{"class":69,"line":12},[67,445,123],{"class":83},[67,447,448],{"class":126},"orders ",[67,450,130],{"class":83},[67,452,133],{"class":83},[67,454,136],{"class":126},[67,456,139],{"class":83},[67,458,21],{"class":126},[67,460,139],{"class":83},[67,462,367],{"class":79},[67,464,465],{"class":83},"()[",[67,467,168],{"class":83},[67,469,470],{"class":171},"orders",[67,472,168],{"class":83},[67,474,475],{"class":83},"];\n",[67,477,478,480,483,485,488,491,494,497,500,502,504,507,509,511,513,515,517,520,522,525,528],{"class":69,"line":17},[67,479,305],{"class":79},[67,481,482],{"class":83}," \"{$",[67,484,470],{"class":126},[67,486,487],{"class":83},"['",[67,489,490],{"class":171},"total",[67,492,493],{"class":83},"']}",[67,495,496],{"class":171}," orders, page ",[67,498,499],{"class":83},"{$",[67,501,470],{"class":126},[67,503,487],{"class":83},[67,505,506],{"class":171},"current_page",[67,508,493],{"class":83},[67,510,6],{"class":171},[67,512,499],{"class":83},[67,514,470],{"class":126},[67,516,487],{"class":83},[67,518,519],{"class":171},"last_page",[67,521,493],{"class":83},[67,523,524],{"class":126},"\\n",[67,526,527],{"class":83},"\"",[67,529,363],{"class":83},[49,531,533],{"id":532},"setwebhookurl","setWebhookUrl",[53,535,536,537,540,541,225],{},"Set the URL that receives SMS webhooks (see ",[538,539,29],"a",{"href":30},"). Returns ",[64,542,543],{},"true",[57,545,547],{"className":59,"code":546,"language":61,"meta":62,"style":62},"public function setWebhookUrl(string $url): bool\n",[64,548,549],{"__ignoreMap":62},[67,550,551,553,555,558,560,563,565,568,570],{"class":69,"line":12},[67,552,73],{"class":72},[67,554,76],{"class":72},[67,556,557],{"class":79}," setWebhookUrl",[67,559,387],{"class":83},[67,561,562],{"class":87},"string",[67,564,133],{"class":83},[67,566,567],{"class":126},"url",[67,569,403],{"class":83},[67,571,572],{"class":87}," bool\n",[57,574,576],{"className":59,"code":575,"language":61,"meta":62,"style":62},"$client->user->setWebhookUrl('https:\u002F\u002Fexample.com\u002Fonlinesim-hook');\n",[64,577,578],{"__ignoreMap":62},[67,579,580,582,584,586,588,590,592,594,596,599,601],{"class":69,"line":12},[67,581,123],{"class":83},[67,583,136],{"class":126},[67,585,139],{"class":83},[67,587,21],{"class":126},[67,589,139],{"class":83},[67,591,533],{"class":79},[67,593,387],{"class":83},[67,595,168],{"class":83},[67,597,598],{"class":171},"https:\u002F\u002Fexample.com\u002Fonlinesim-hook",[67,600,168],{"class":83},[67,602,204],{"class":83},[53,604,207,605,211,607,610],{},[64,606,210],{},[64,608,609],{},"VALIDATION_ERROR"," for an invalid URL; the message holds the server's field messages.",[49,612,614],{"id":613},"clearwebhookurl","clearWebhookUrl",[53,616,617,618,225],{},"Remove the webhook URL, also from operations in progress. Returns ",[64,619,543],{},[57,621,623],{"className":59,"code":622,"language":61,"meta":62,"style":62},"public function clearWebhookUrl(): bool\n",[64,624,625],{"__ignoreMap":62},[67,626,627,629,631,634,636],{"class":69,"line":12},[67,628,73],{"class":72},[67,630,76],{"class":72},[67,632,633],{"class":79}," clearWebhookUrl",[67,635,84],{"class":83},[67,637,572],{"class":87},[57,639,641],{"className":59,"code":640,"language":61,"meta":62,"style":62},"$client->user->clearWebhookUrl();\n",[64,642,643],{"__ignoreMap":62},[67,644,645,647,649,651,653,655,657],{"class":69,"line":12},[67,646,123],{"class":83},[67,648,136],{"class":126},[67,650,139],{"class":83},[67,652,21],{"class":126},[67,654,139],{"class":83},[67,656,614],{"class":79},[67,658,148],{"class":83},[49,660,662],{"id":661},"webhooklogs","webhookLogs",[53,664,665],{},"Webhook delivery log, newest first, 10 per page.",[57,667,669],{"className":59,"code":668,"language":61,"meta":62,"style":62},"public function webhookLogs(int $page = 1): array\n",[64,670,671],{"__ignoreMap":62},[67,672,673,675,677,680,682,684,686,688,690,692,694],{"class":69,"line":12},[67,674,73],{"class":72},[67,676,76],{"class":72},[67,678,679],{"class":79}," webhookLogs",[67,681,387],{"class":83},[67,683,390],{"class":87},[67,685,133],{"class":83},[67,687,395],{"class":126},[67,689,130],{"class":83},[67,691,400],{"class":87},[67,693,403],{"class":83},[67,695,88],{"class":87},[53,697,698,699,215,701,215,704,215,706,708,709,255,712,259,715,263,718,721,722,215,725,263,728,215,731,721,734,215,737,740],{},"Returns a paginator (",[64,700,506],{},[64,702,703],{},"data",[64,705,519],{},[64,707,490],{},", …) of ",[64,710,711],{},"WebhookLog",[64,713,714],{},"['id', 'user_id', 'webhook_url', 'type', 'params', 'status', 'error', 'created_at', 'updated_at']",[64,716,717],{},"type",[64,719,720],{},"receiving_sms"," or ",[64,723,724],{},"rent_sms",[64,726,727],{},"status",[64,729,730],{},"success",[64,732,733],{},"fail",[64,735,736],{},"pending",[64,738,739],{},"params"," the payload that was sent.",[57,742,744],{"className":59,"code":743,"language":61,"meta":62,"style":62},"foreach ($client->user->webhookLogs()['data'] as $log) {\n    echo $log['created_at'], ' ', $log['status'], ' ', $log['error'] ?? '', \"\\n\";\n}\n",[64,745,746,789,865],{"__ignoreMap":62},[67,747,748,752,755,757,759,761,763,765,767,769,771,773,775,778,780,783,786],{"class":69,"line":12},[67,749,751],{"class":750},"s7zQu","foreach",[67,753,754],{"class":83}," ($",[67,756,136],{"class":126},[67,758,139],{"class":83},[67,760,21],{"class":126},[67,762,139],{"class":83},[67,764,662],{"class":79},[67,766,465],{"class":83},[67,768,168],{"class":83},[67,770,703],{"class":171},[67,772,168],{"class":83},[67,774,176],{"class":83},[67,776,777],{"class":83}," as",[67,779,133],{"class":83},[67,781,782],{"class":126},"log",[67,784,785],{"class":83},")",[67,787,788],{"class":83}," {\n",[67,790,791,794,796,798,800,802,805,807,809,811,813,815,817,819,821,823,825,827,829,831,833,835,837,839,841,843,846,848,850,852,854,856,859,861,863],{"class":69,"line":17},[67,792,793],{"class":79},"    echo",[67,795,133],{"class":83},[67,797,782],{"class":126},[67,799,165],{"class":83},[67,801,168],{"class":83},[67,803,804],{"class":171},"created_at",[67,806,168],{"class":83},[67,808,198],{"class":83},[67,810,332],{"class":83},[67,812,332],{"class":83},[67,814,329],{"class":83},[67,816,133],{"class":83},[67,818,782],{"class":126},[67,820,165],{"class":83},[67,822,168],{"class":83},[67,824,727],{"class":171},[67,826,168],{"class":83},[67,828,198],{"class":83},[67,830,332],{"class":83},[67,832,332],{"class":83},[67,834,329],{"class":83},[67,836,133],{"class":83},[67,838,782],{"class":126},[67,840,165],{"class":83},[67,842,168],{"class":83},[67,844,845],{"class":171},"error",[67,847,168],{"class":83},[67,849,176],{"class":83},[67,851,323],{"class":83},[67,853,326],{"class":83},[67,855,329],{"class":83},[67,857,858],{"class":83}," \"",[67,860,524],{"class":126},[67,862,527],{"class":83},[67,864,363],{"class":83},[67,866,867],{"class":69,"line":22},[67,868,869],{"class":83},"}\n",[871,872,873],"style",{},"html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}",{"title":62,"searchDepth":17,"depth":17,"links":875},[876,877,878,879,880,881],{"id":51,"depth":17,"text":51},{"id":228,"depth":17,"text":228},{"id":366,"depth":17,"text":367},{"id":532,"depth":17,"text":533},{"id":613,"depth":17,"text":614},{"id":661,"depth":17,"text":662},"Balance, profile, payments and the webhook URL — $client->user.","md",{},{"order":22},{"title":19,"description":882},"mhR9948K90zmPU0iBnohH6EAvFmW1GSMDWPkz7UMnSc",[889,891],{"title":34,"path":35,"stem":36,"description":890,"order":37},"Test your integration offline with MockOnlineSim — no network, key or money.",{"title":29,"path":30,"stem":31,"description":892,"order":32},"Receive SMS as HTTP callbacks and parse them with parseWebhook.",1795164122569]