[{"data":1,"prerenderedAt":730},["ShallowReactive",2],{"navigation-en":3,"en:\u002Fwithdrawals\u002Foverview":193,"en:\u002Fwithdrawals\u002Foverview:surround":725},[4,20,51,77,95,110,133,158,172],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15],{"title":11,"path":12,"stem":13,"icon":14},"Portal Preparation","\u002Fgetting-started\u002Fportal-setup","1.getting-started\u002F1.portal-setup","i-lucide-rocket",{"title":16,"path":17,"stem":18,"icon":19},"Quickstart","\u002Fgetting-started\u002Fquickstart","1.getting-started\u002F2.quickstart","i-lucide-zap",{"title":21,"icon":22,"path":23,"stem":24,"children":25,"page":6},"Core Concepts","i-lucide-key-round","\u002Fconcepts","2.concepts",[26,31,36,41,46],{"title":27,"path":28,"stem":29,"icon":30},"Authentication","\u002Fconcepts\u002Fauthentication","2.concepts\u002F1.authentication","i-lucide-fingerprint",{"title":32,"path":33,"stem":34,"icon":35},"IP Allowlist","\u002Fconcepts\u002Fip-allowlist","2.concepts\u002F2.ip-allowlist","i-lucide-shield-check",{"title":37,"path":38,"stem":39,"icon":40},"Money Format","\u002Fconcepts\u002Fmoney","2.concepts\u002F3.money","i-lucide-banknote",{"title":42,"path":43,"stem":44,"icon":45},"Idempotency","\u002Fconcepts\u002Fidempotency","2.concepts\u002F4.idempotency","i-lucide-repeat",{"title":47,"path":48,"stem":49,"icon":50},"Error envelope & codes","\u002Fconcepts\u002Ferrors","2.concepts\u002F5.errors","i-lucide-octagon-alert",{"title":52,"icon":53,"path":54,"stem":55,"children":56,"page":6},"Deposits","i-lucide-arrow-down-to-line","\u002Fdeposits","3.deposits",[57,62,67,72],{"title":58,"path":59,"stem":60,"icon":61},"Deposit Overview & State Machine","\u002Fdeposits\u002Foverview","3.deposits\u002F1.overview","i-lucide-info",{"title":63,"path":64,"stem":65,"icon":66},"Create a Deposit","\u002Fdeposits\u002Fcreate","3.deposits\u002F2.create","i-lucide-plus",{"title":68,"path":69,"stem":70,"icon":71},"Get a Deposit","\u002Fdeposits\u002Fretrieve","3.deposits\u002F3.retrieve","i-lucide-search",{"title":73,"path":74,"stem":75,"icon":76},"Cancel a Deposit","\u002Fdeposits\u002Fcancel","3.deposits\u002F4.cancel","i-lucide-x",{"title":78,"icon":79,"path":80,"stem":81,"children":82,"page":6},"Withdrawals","i-lucide-arrow-up-from-line","\u002Fwithdrawals","4.withdrawals",[83,87,91],{"title":84,"path":85,"stem":86,"icon":61},"Withdrawal Overview","\u002Fwithdrawals\u002Foverview","4.withdrawals\u002F1.overview",{"title":88,"path":89,"stem":90,"icon":66},"Create a Withdrawal","\u002Fwithdrawals\u002Fcreate","4.withdrawals\u002F2.create",{"title":92,"path":93,"stem":94,"icon":71},"Get & List Withdrawals","\u002Fwithdrawals\u002Fretrieve","4.withdrawals\u002F3.retrieve",{"title":96,"icon":97,"path":98,"stem":99,"children":100,"page":6},"Balance & Banks","i-lucide-wallet","\u002Fbalance","5.balance",[101,105],{"title":102,"path":103,"stem":104,"icon":97},"Get Balance","\u002Fbalance\u002Fget-balance","5.balance\u002F1.get-balance",{"title":106,"path":107,"stem":108,"icon":109},"Bank List","\u002Fbalance\u002Fbanks","5.balance\u002F2.banks","i-lucide-landmark",{"title":111,"icon":112,"path":113,"stem":114,"children":115,"page":6},"Webhooks","i-lucide-webhook","\u002Fwebhooks","6.webhooks",[116,120,125,129],{"title":117,"path":118,"stem":119,"icon":61},"Webhook Overview","\u002Fwebhooks\u002Foverview","6.webhooks\u002F1.overview",{"title":121,"path":122,"stem":123,"icon":124},"Event Catalog & Payloads","\u002Fwebhooks\u002Fevents","6.webhooks\u002F2.events","i-lucide-list",{"title":126,"path":127,"stem":128,"icon":35},"Signature Verification","\u002Fwebhooks\u002Fsignature-verification","6.webhooks\u002F3.signature-verification",{"title":130,"path":131,"stem":132,"icon":45},"Endpoint Requirements, Retries & SSRF","\u002Fwebhooks\u002Fdelivery-and-retries","6.webhooks\u002F4.delivery-and-retries",{"title":134,"icon":135,"path":136,"stem":137,"children":138,"page":6},"Sandbox","i-lucide-flask-conical","\u002Fsandbox","7.sandbox",[139,143,148,153],{"title":140,"path":141,"stem":142,"icon":61},"Test Mode Overview","\u002Fsandbox\u002Foverview","7.sandbox\u002F1.overview",{"title":144,"path":145,"stem":146,"icon":147},"Simulate Transfer","\u002Fsandbox\u002Fsimulate-transfer","7.sandbox\u002F2.simulate-transfer","i-lucide-banknote-arrow-down",{"title":149,"path":150,"stem":151,"icon":152},"Top-up & Reset","\u002Fsandbox\u002Ftop-up-and-reset","7.sandbox\u002F3.top-up-and-reset","i-lucide-rotate-ccw",{"title":154,"path":155,"stem":156,"icon":157},"End-to-End Test Flow","\u002Fsandbox\u002Fe2e-test-flow","7.sandbox\u002F4.e2e-test-flow","i-lucide-list-checks",{"title":159,"icon":14,"path":160,"stem":161,"children":162,"page":6},"Go-live","\u002Fgo-live","8.go-live",[163,167],{"title":164,"path":165,"stem":166,"icon":157},"Go-live Checklist","\u002Fgo-live\u002Fchecklist","8.go-live\u002F1.checklist",{"title":168,"path":169,"stem":170,"icon":171},"Contact & Support","\u002Fgo-live\u002Fsupport","8.go-live\u002F2.support","i-lucide-life-buoy",{"title":173,"icon":174,"path":175,"stem":176,"children":177,"page":6},"Reference","i-lucide-book-marked","\u002Freference","9.reference",[178,183,188],{"title":179,"path":180,"stem":181,"icon":182},"Endpoint Catalog","\u002Freference\u002Fendpoints","9.reference\u002F1.endpoints","i-lucide-table",{"title":184,"path":185,"stem":186,"icon":187},"Code Samples (Node.js & PHP)","\u002Freference\u002Fcode-samples","9.reference\u002F2.code-samples","i-lucide-code",{"title":189,"path":190,"stem":191,"icon":192},"Status Values & Glossary","\u002Freference\u002Fglossary-states","9.reference\u002F3.glossary-states","i-lucide-book-a",{"id":194,"title":84,"badge":195,"body":196,"description":719,"extension":720,"links":195,"meta":721,"method":195,"navigation":722,"path":85,"seo":723,"stem":86,"__hash__":724},"docs_en\u002F4.withdrawals\u002F1.overview.md",null,{"type":197,"value":198,"toc":711},"minimark",[199,208,234,260,264,269,335,345,349,352,362,491,494,537,576,580,583,589,593,676,686,690],[200,201,202,203,207],"p",{},"This section explains how your merchant system creates a ",[204,205,206],"strong",{},"withdrawal request"," (payout) out of your wallet through UnknownPay, paying a destination (e.g. your end customer) into a bank account over a Server-to-Server (S2S) connection.",[209,210,211],"caution",{},[200,212,213,216,217,220,221,229,230,233],{},[204,214,215],{},"A payout does not move money out instantly."," Every withdrawal request must pass ",[204,218,219],{},"manual approval by the UnknownPay team"," before the system sends the real pay-out instruction to the bank. Your system must therefore ",[204,222,223,224,228],{},"wait for the ",[225,226,227],"code",{},"withdrawal.success"," webhook"," to confirm the payout succeeded — never treat the request as successful just because creation returned ",[225,231,232],{},"201 Created",".",[235,236,237],"warning",{},[200,238,239,240,243,244,247,248,251,252,255,256,259],{},"Every money field on the wire is always a ",[204,241,242],{},"baht string with 2 decimals",", e.g. ",[225,245,246],{},"\"100.50\""," (not a number, not satang) — in both request and response. Fields such as ",[225,249,250],{},"amount",", ",[225,253,254],{},"fee",", and ",[225,257,258],{},"net_payout"," must always be sent\u002Fread as baht strings.",[261,262],"placeholder-image",{"subject":263},"sequence diagram — merchant → POST \u002Fv1\u002Fwithdrawals → UnknownPay (PENDING) → team approve → bank pays out → withdrawal.success webhook back to merchant",[265,266,268],"h2",{"id":267},"endpoints","Endpoints",[270,271,272,288],"table",{},[273,274,275],"thead",{},[276,277,278,282,285],"tr",{},[279,280,281],"th",{},"Operation",[279,283,284],{},"Method",[279,286,287],{},"Path",[289,290,291,307,322],"tbody",{},[276,292,293,297,302],{},[294,295,296],"td",{},"Create a withdrawal",[294,298,299],{},[225,300,301],{},"POST",[294,303,304],{},[225,305,306],{},"\u002Fv1\u002Fwithdrawals",[276,308,309,312,317],{},[294,310,311],{},"Get one withdrawal (single)",[294,313,314],{},[225,315,316],{},"GET",[294,318,319],{},[225,320,321],{},"\u002Fv1\u002Fwithdrawals\u002F:id",[276,323,324,327,331],{},[294,325,326],{},"List your own withdrawals",[294,328,329],{},[225,330,316],{},[294,332,333],{},[225,334,306],{},[200,336,337,338,341,342,233],{},"Every endpoint lives on the ",[225,339,340],{},"\u002Fv1"," gateway surface and requires S2S authentication (API key + HMAC) just like the other merchant endpoints — see ",[343,344,27],"a",{"href":28},[265,346,348],{"id":347},"state-machine","State machine",[200,350,351],{},"The live state flow:",[353,354,359],"pre",{"className":355,"code":357,"language":358},[356],"language-text","PENDING ──(team approves as a batch)──▶ PROCESSING ──▶ [IN_PROGRESS] ──▶ SUCCESS\n   │                                          │                              │\n   │                                          └──────────────┬───────────────┘\n   │                                                         ▼\n   └──(team rejects)──▶ REJECTED                          FAILED\n                                              (bank\u002Fbot reports failure → refund)\n","text",[225,360,357],{"__ignoreMap":361},"",[270,363,364,377],{},[273,365,366],{},[276,367,368,371,374],{},[279,369,370],{},"Status",[279,372,373],{},"Meaning",[279,375,376],{},"What the merchant should do",[289,378,379,395,408,421,433,451,475],{},[276,380,381,386,392],{},[294,382,383],{},[225,384,385],{},"PENDING",[294,387,388,389],{},"Request created, gross already debited from the wallet, ",[204,390,391],{},"awaiting team approval",[294,393,394],{},"Wait — not paid out yet",[276,396,397,402,405],{},[294,398,399],{},[225,400,401],{},"APPROVED",[294,403,404],{},"Approved (mainly a sandbox\u002Ftest resting state — live skips it)",[294,406,407],{},"Wait",[276,409,410,415,418],{},[294,411,412],{},[225,413,414],{},"PROCESSING",[294,416,417],{},"Team approved + the pay instruction was sent to the payment system\u002Fbank (money is going out)",[294,419,420],{},"Wait — can no longer be cancelled",[276,422,423,428,431],{},[294,424,425],{},[225,426,427],{},"IN_PROGRESS",[294,429,430],{},"In progress at the bank (intermediate state, may be skipped)",[294,432,407],{},[276,434,435,440,446],{},[294,436,437],{},[225,438,439],{},"SUCCESS",[294,441,442,445],{},[204,443,444],{},"Payout succeeded"," (terminal)",[294,447,448,449,228],{},"✅ Treat as success — ",[225,450,227],{},[276,452,453,458,464],{},[294,454,455],{},[225,456,457],{},"FAILED",[294,459,460,461],{},"Payout failed (terminal) — system ",[204,462,463],{},"refunds the gross back to the wallet",[294,465,466,467,470,471,474],{},"❌ ",[225,468,469],{},"withdrawal.failed"," + ",[225,472,473],{},"withdrawal.refunded"," webhooks",[276,476,477,482,487],{},[294,478,479],{},[225,480,481],{},"REJECTED",[294,483,484,485],{},"Team rejected the request (terminal) — system ",[204,486,463],{},[294,488,466,489,228],{},[225,490,473],{},[200,492,493],{},"Technical notes that match the code:",[495,496,497,510,528],"ul",{},[498,499,500,501,503,504,506,507,509],"li",{},"The live approval path goes straight from ",[225,502,385],{}," → ",[225,505,414],{}," (approval happens as a \"batch\") — ",[225,508,401],{}," is not a resting state in live (it is used mainly in sandbox\u002Ftest mode).",[498,511,512,514,515,518,519,521,522,524,525,527],{},[225,513,427],{}," is ",[204,516,517],{},"optional"," — the bank may report ",[225,520,439],{}," directly from ",[225,523,414],{},". Do not design your system to require ",[225,526,427],{}," as a mandatory condition.",[498,529,530,251,532,255,534,536],{},[225,531,439],{},[225,533,457],{},[225,535,481],{}," are terminal (they never change again).",[209,538,539,545,568],{},[200,540,541,544],{},[204,542,543],{},"The statuses the merchant should \"wait for the webhook\" on:"," treat a payout as truly finished only when you receive a terminal-status webhook, namely:",[495,546,547,552,557],{},[498,548,549,551],{},[225,550,227],{}," (paid out successfully — money has really left)",[498,553,554,556],{},[225,555,469],{}," (payout failed — money refunded to the wallet)",[498,558,559,561,562,564,565,567],{},[225,560,473],{}," (money refunded to the wallet; fires for both ",[225,563,481],{}," and ",[225,566,457],{},")",[200,569,570,573,574,233],{},[225,571,572],{},"withdrawal.rejected"," (team rejected) always comes paired with ",[225,575,473],{},[577,578],"placeholder-note",{"value":579},"confirm the exact event names emitted by the live webhook side (code confirms: withdrawal.success \u002F withdrawal.failed \u002F withdrawal.refunded \u002F withdrawal.rejected) and document the real webhook payload",[261,581],{"subject":582},"withdrawal state diagram (PENDING → PROCESSING → IN_PROGRESS → SUCCESS \u002F FAILED \u002F REJECTED)",[200,584,585,586,588],{},"The exact payload of each event and how to verify the signature are covered in the ",[343,587,111],{"href":118}," section.",[265,590,592],{"id":591},"debit-at-create-refund-matters-for-reconciliation","Debit at create + refund (matters for reconciliation)",[495,594,595,616,638,655],{},[498,596,597,600,601,604,605,607,608,615],{},[204,598,599],{},"Debit at create (debit-at-request):"," when the request is created successfully (",[225,602,603],{},"201",", status ",[225,606,385],{},"), the system immediately debits ",[204,609,610,611,470,613],{},"gross = ",[225,612,250],{},[225,614,254],{}," from your wallet — that amount is \"reserved\" from this moment, not at approval.",[498,617,618,621,622,624,625,627,628,631,632,634,635,637],{},[204,619,620],{},"Rejected → refund:"," if the team rejects the request (while still ",[225,623,385],{}," or ",[225,626,401],{},"), the system ",[204,629,630],{},"refunds the full gross back to the wallet"," and sends the ",[225,633,473],{}," webhook (status ",[225,636,481],{},").",[498,639,640,643,644,646,647,649,650,470,652,654],{},[204,641,642],{},"Failed → refund:"," if the payout was attempted and failed (",[225,645,457],{},"), the system likewise ",[204,648,463],{}," (",[225,651,469],{},[225,653,473],{}," webhooks).",[498,656,657,663,664,666,667,670,671,624,673,675],{},[204,658,659,660,662],{},"Once ",[225,661,414],{},", it cannot be cancelled:"," once approved and dispatched (",[225,665,414],{},"), the team can no longer reject it (it returns ",[225,668,669],{},"409",") — from this point only ",[225,672,439],{},[225,674,457],{}," will settle the money.",[677,678,679],"note",{},[200,680,681,682,685],{},"Effect on your merchant-side logic: do not deduct your own internal balance again. The debit happens on the UnknownPay side. Rely on the ",[343,683,684],{"href":103},"balance endpoint"," for the wallet balance, and rely on the terminal webhook as the deciding factor for the final outcome.",[265,687,689],{"id":688},"next-steps","Next steps",[495,691,692,700],{},[498,693,694,696,697],{},[343,695,296],{"href":89}," — ",[225,698,699],{},"POST \u002Fv1\u002Fwithdrawals",[498,701,702,696,705,564,708],{},[343,703,704],{"href":93},"Get & list withdrawals",[225,706,707],{},"GET \u002Fv1\u002Fwithdrawals\u002F:id",[225,709,710],{},"GET \u002Fv1\u002Fwithdrawals",{"title":361,"searchDepth":712,"depth":713,"links":714},1,2,[715,716,717,718],{"id":267,"depth":713,"text":268},{"id":347,"depth":713,"text":348},{"id":591,"depth":713,"text":592},{"id":688,"depth":713,"text":689},"How payouts work — gross debited immediately at create, manual approval, and the PENDING→SUCCESS\u002FFAILED\u002FREJECTED state machine","md",{},{"icon":61},{"title":84,"description":719},"a3IQPnYcLPlqp23DJVXMS-y4su7QNuVLF04kBAq8duQ",[726,728],{"title":73,"path":74,"stem":75,"description":727,"icon":76,"children":-1},"POST \u002Fv1\u002Fdeposits\u002F:id\u002Fcancel — cancel a still-PENDING deposit and release the amount slot; own + same-mode only",{"title":88,"path":89,"stem":90,"description":729,"icon":66,"children":-1},"POST \u002Fv1\u002Fwithdrawals — create a payout request; gross (amount + fee) is debited immediately and the request starts in PENDING awaiting manual approval",1781891152608]