/api/v1/moonpay/sign-buy-urlSign a MoonPay buy link
Countersigns a MoonPay purchase link so the payment widget will accept it, checking the link is tagged with the caller's own identity and delivery address, and recording that address in the audit log.
VIEW_BALANCESMembers can buy Bitcoin with regular money through MoonPay (moonpay.com). The
widget will only open a purchase from a link the platform has countersigned, so
build the widget URL, send it here with the delivery address, and put the
returned signature back on the link. The signing secret stays on the platform:
it is never handed to the browser, which is why the countersigning happens through
this call rather than in your front end.
The coins are delivered to the member's own profile address, derived from their own
registered key, so the platform never takes custody of them. Read that address
from GET /api/v1/signing-profile-address and pass
it as wallet_address. Where a member has several registered keys, the address is
what identifies which key is meant, and if your application and the platform
disagree about it the request is rejected rather than guessed.
widget_url must carry a walletAddress equal to wallet_address and an
externalCustomerId equal to the caller's own user id. A purchase therefore
cannot be tagged with another member's identity or pointed at an address the
platform cannot attribute to the caller. The delivery address is recorded in the
audit log.
workspace_idnumberrequiredwidget_urlstringrequiredwallet_addressstringrequiredvault_idstringoptional#What happens next
Put the signature back on the link and open the widget, and the member completes
the payment with MoonPay.
GET /api/v1/moonpay/transactions then reports the
purchase's progress and the Bitcoin transaction id once the coins are sent. When
the deposit arrives at the profile address, moving it into a vault is a normal
transaction proposal, which
POST /api/v1/forward-to-vault creates and the member
approves alone.