Merchant Auth
Merchant dashboard sign-in: email/password, OAuth, passkeys, TOTP 2FA, sessions, token refresh, and switching the active merchant context.
Log in
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/loginAuthenticates with email and password. Returns either an authenticated session (tokens, user, memberships) when $case is authenticated, or an mfaToken to complete via 2FA when $case is mfa_required.
Body required
application/jsonemailstringrequiredstringpasswordstringrequiredstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "string",
"password": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"$case": "authenticated",
"tokens": {
"accessToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"expiresAt": 1718012345
},
"user": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"email": "string",
"emailVerified": true,
"displayName": "Satoshi Coffee",
"avatarUrl": "string",
"twoFactorEnabled": true,
"status": "active"
},
"memberships": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantName": "Satoshi Coffee",
"role": "admin",
"status": "active",
"isCustodial": true,
"isDemo": true,
"actionsBlocked": true
}
],
"activeMerchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
}Register
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/registerCreates a new merchant user from email and password, with optional displayName and merchantName (bootstraps the first merchant with the user as admin). Returns the new userId and status.
Body required
application/jsonemailstringrequiredstringpasswordstringrequiredstringdisplayNamestringPublic display name shown to payers (optional).
Satoshi CoffeemerchantNamestringMerchant's internal name.
Satoshi CoffeereferralCodestringstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/register" \
-H "Content-Type: application/json" \
-d '{
"email": "string",
"password": "string",
"displayName": "Satoshi Coffee",
"merchantName": "Satoshi Coffee",
"referralCode": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "active"
}
}
}Refresh tokens
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/refreshExchanges a valid refreshToken for a fresh tokens bundle (accessToken, refreshToken, expiresAt).
Body required
application/jsonrefreshTokenstringrequiredLong-lived JWT refresh token. Use it at Refresh access tokens to obtain a new token pair.
eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3a…Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/refresh" \
-H "Content-Type: application/json" \
-d '{
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"tokens": {
"accessToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"expiresAt": 1718012345
}
}
}
}Log out
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/logoutRevokes the given refreshToken, or the current session if omitted. Returns { ok }.
Authorization: merchantAuth
Body required
application/jsonrefreshTokenstringLong-lived JWT refresh token. Use it at Refresh access tokens to obtain a new token pair.
eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3a…Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/logout" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"ok": true
}
}
}Current user
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/meReturns the authenticated user profile and the list of memberships linking the user to merchants with a role.
Authorization: merchantAuth
Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/me" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"user": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"email": "string",
"emailVerified": true,
"displayName": "Satoshi Coffee",
"avatarUrl": "string",
"twoFactorEnabled": true,
"status": "active"
},
"memberships": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantName": "Satoshi Coffee",
"role": "admin",
"status": "active",
"isCustodial": true,
"isDemo": true,
"actionsBlocked": true
}
],
"activeMerchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"walletLinked": true,
"walletAddress": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",
"hasReferralAttribution": true
}
}
}Verify email
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/verify-emailConfirms an email address using the email and the emailed code. On success the user is signed in: returns the full auth bundle (tokens, user, memberships) so the client can log straight into the merchant cabinet without a separate login.
Body required
application/jsonemailstringrequiredstringcodestringrequiredstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/verify-email" \
-H "Content-Type: application/json" \
-d '{
"email": "string",
"code": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"tokens": {
"accessToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"expiresAt": 1718012345
},
"user": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"email": "string",
"emailVerified": true,
"displayName": "Satoshi Coffee",
"avatarUrl": "string",
"twoFactorEnabled": true,
"status": "active"
},
"memberships": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantName": "Satoshi Coffee",
"role": "admin",
"status": "active",
"isCustodial": true,
"isDemo": true,
"actionsBlocked": true
}
],
"activeMerchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
}OAuth login
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/oauth/loginLogs in via an OAuth provider using authCode or idToken (with optional redirectUri); merchantName bootstraps the first merchant for new accounts. Returns an authenticated session or an mfaToken challenge.
Body required
application/jsonproviderenumrequiredapplegoogleappleauthCodestringstringidTokenstringeyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3a…redirectUristringstringmerchantNamestringMerchant's internal name.
Satoshi CoffeeResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/oauth/login" \
-H "Content-Type: application/json" \
-d '{
"provider": "apple",
"authCode": "string",
"idToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"redirectUri": "string",
"merchantName": "Satoshi Coffee"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"$case": "authenticated",
"tokens": {
"accessToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"expiresAt": 1718012345
},
"user": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"email": "string",
"emailVerified": true,
"displayName": "Satoshi Coffee",
"avatarUrl": "string",
"twoFactorEnabled": true,
"status": "active"
},
"memberships": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantName": "Satoshi Coffee",
"role": "admin",
"status": "active",
"isCustodial": true,
"isDemo": true,
"actionsBlocked": true
}
],
"activeMerchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
}Change password
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/password/changeSets newPassword for the current user; oldPassword is required unless setting a password for the first time. Returns { ok }.
Authorization: merchantAuth
Body required
application/jsonoldPasswordstringstringnewPasswordstringrequiredstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/password/change" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"oldPassword": "string",
"newPassword": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"ok": true
}
}
}Forgot password
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/password/forgotTriggers a password-reset email for the given email. Always returns { ok } to avoid account enumeration.
Body required
application/jsonemailstringrequiredstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/password/forgot" \
-H "Content-Type: application/json" \
-d '{
"email": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"ok": true
}
}
}Reset password
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/password/resetSets newPassword using a reset token from the password-reset email. Returns { ok }.
Body required
application/jsontokenstringrequiredeyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3a…newPasswordstringrequiredstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/password/reset" \
-H "Content-Type: application/json" \
-d '{
"token": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"newPassword": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"ok": true
}
}
}Verify 2FA
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/2fa/verifyCompletes an MFA login challenge with the mfaToken and a TOTP or recovery code. Returns an authenticated session (tokens, user, memberships).
Body required
application/jsonmfaTokenstringrequiredeyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3a…codestringrequiredstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/2fa/verify" \
-H "Content-Type: application/json" \
-d '{
"mfaToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"code": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"tokens": {
"accessToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"expiresAt": 1718012345
},
"user": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"email": "string",
"emailVerified": true,
"displayName": "Satoshi Coffee",
"avatarUrl": "string",
"twoFactorEnabled": true,
"status": "active"
},
"memberships": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantName": "Satoshi Coffee",
"role": "admin",
"status": "active",
"isCustodial": true,
"isDemo": true,
"actionsBlocked": true
}
],
"activeMerchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
}Set up TOTP
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/2fa/totp/setupBegins TOTP enrollment, returning the secret, otpauthUri, and a qr data URI for the authenticator app. TOTP is not active until confirmed via enable.
Authorization: merchantAuth
Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/2fa/totp/setup" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"secret": "string",
"otpauthUri": "string",
"qr": "bitcoin:bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq?amount=0.0005"
}
}
}Enable TOTP
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/2fa/totp/enableActivates TOTP by confirming a code from the authenticator. Returns one-time recoveryCodes shown only once.
Authorization: merchantAuth
Body required
application/jsoncodestringrequiredstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/2fa/totp/enable" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"code": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"recoveryCodes": [
"string"
]
}
}
}Disable TOTP
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/2fa/totp/disableDisables TOTP after re-authenticating with a current TOTP code or the account password. Returns { ok }.
Authorization: merchantAuth
Body required
application/jsoncodestringstringpasswordstringstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/2fa/totp/disable" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"code": "string",
"password": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"ok": true
}
}
}Passkey register options
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/passkey/register/optionsReturns WebAuthn publicKeyOptions (PublicKeyCredentialCreationOptions incl. challenge) to pass to navigator.credentials.create() for registering a new passkey.
Authorization: merchantAuth
Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/passkey/register/options" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"publicKeyOptions": {}
}
}
}Passkey register verify
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/passkey/register/verifyVerifies the authenticator attestation credential (with optional deviceLabel) and stores the passkey. Returns the created credential descriptor.
Authorization: merchantAuth
Body required
application/jsoncredentialanyPublicKeyCredential attestation JSON from the authenticator
deviceLabelstringFront deskResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/passkey/register/verify" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"credential": {},
"deviceLabel": "Front desk"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"credential": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"deviceLabel": "Front desk",
"createdAt": 1718012345,
"lastUsedAt": 1718012345
}
}
}
}Passkey login options
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/passkey/login/optionsReturns WebAuthn publicKeyOptions (PublicKeyCredentialRequestOptions incl. challenge) for navigator.credentials.get(). Pass email for a specific user, or omit for discoverable (usernameless) login.
Body required
application/jsonemailstringstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/passkey/login/options" \
-H "Content-Type: application/json" \
-d '{
"email": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"publicKeyOptions": {}
}
}
}Passkey login verify
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/passkey/login/verifyVerifies the authenticator assertion credential and signs the user in (single-step, no extra MFA). Returns an authenticated session (tokens, user, memberships).
Body required
application/jsoncredentialanyPublicKeyCredential assertion JSON from the authenticator
Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/passkey/login/verify" \
-H "Content-Type: application/json" \
-d '{
"credential": {}
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"tokens": {
"accessToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"expiresAt": 1718012345
},
"user": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"email": "string",
"emailVerified": true,
"displayName": "Satoshi Coffee",
"avatarUrl": "string",
"twoFactorEnabled": true,
"status": "active"
},
"memberships": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"merchantName": "Satoshi Coffee",
"role": "admin",
"status": "active",
"isCustodial": true,
"isDemo": true,
"actionsBlocked": true
}
],
"activeMerchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
}List passkeys
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/passkey/listReturns the current user's registered passkeys as items, each with id, deviceLabel, createdAt, and lastUsedAt.
Authorization: merchantAuth
Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/passkey/list" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"deviceLabel": "Front desk",
"createdAt": 1718012345,
"lastUsedAt": 1718012345
}
]
}
}
}Delete passkey
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/passkey/deleteRemoves the passkey identified by credentialId from the current user. Returns { ok }.
Authorization: merchantAuth
Body required
application/jsoncredentialIdstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/passkey/delete" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"credentialId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"ok": true
}
}
}List sessions
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/sessions/listLists the current user's active sessions as items (with userAgent, ip, timestamps, and current flag) plus totalCount. Accepts optional pagination.
Authorization: merchantAuth
Body required
application/jsonpaginationobjectResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/sessions/list" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"pagination": {
"limit": 20,
"skip": 0
}
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"userAgent": "string",
"ip": "string",
"createdAt": 1718012345,
"expiresAt": 1718012345,
"current": true
}
],
"totalCount": 0
}
}
}Revoke session
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/sessions/revokeRevokes the session identified by sessionId. Returns { ok }.
Authorization: merchantAuth
Body required
application/jsonsessionIdstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/sessions/revoke" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"ok": true
}
}
}Switch merchant
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/context/switchSwitches the active merchant context to merchantId, returning fresh tokens carrying the new merchantId/role claims.
Authorization: merchantAuth
Body required
application/jsonmerchantIdstringrequiredIdentifier of the merchant (UUID).
3fa85f64-5717-4562-b3fc-2c963f66afa6Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/context/switch" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"merchantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"tokens": {
"accessToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"expiresAt": 1718012345
}
}
}
}Link xpub key (via link token)
https://api.gobtcpay.com/public/api/v1.2/merchant/auth/xpub/linkLinks a BIP32 extended public key (xpub) to the merchant account, authorized by the one-time linkToken from Start wallet link (read from the scanned QR), no bearer auth required. Receiving addresses are later derived from this key along its derivationPath. Optionally pass the masterFingerprint (for PSBT key origins) and a label. Returns the stored key record with its keyId. For the signed-in dashboard flow, use Link xpub key (authorized).
Body required
application/jsonlinkTokenstringrequiredOne-time link token from Start wallet link, read from the scanned QR. Scopes the call to the merchant's link session (no bearer auth needed).
eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3a…xpubstringrequiredBIP32 extended public key (xpub/ypub/zpub) to link to the merchant account.
stringderivationPathstringBase derivation path the xpub is exported at (e.g. m/84'/0'/0'); receiving addresses derive from it.
stringmasterFingerprintstringMaster key fingerprint (8 hex chars), used in PSBT key origins so signers can match derived inputs.
stringlabelstringOptional human-readable label for the linked key.
Front deskResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/auth/xpub/link" \
-H "Content-Type: application/json" \
-d '{
"linkToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"xpub": "string",
"derivationPath": "string",
"masterFingerprint": "string",
"label": "Front desk"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"keyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"xpub": "string",
"derivationPath": "string",
"masterFingerprint": "string",
"label": "Front desk",
"linkedAt": 1718012345
}
}
}Register (custodial)
https://api.gobtcpay.com/public/api/v1.2/merchant/custodial/auth/registerCustodial counterpart of Register: creates the cabinet user and a custodial merchant, then creates that merchant's Uphold business user and its BTC account. Alongside email / password it takes the legal entity details Uphold requires, businessEmail, country, subdivision, legalEntityType, and the accepted termsOfService code, which is recorded together with the time and the caller's IP. Returns the new userId and status. The Uphold half is best-effort: if it fails the registration still stands, and the entities are replayed by Create Uphold entities.
Body required
application/jsonemailstringrequiredstringbusinessEmailstringrequiredstringpasswordstringrequiredstringdisplayNamestringPublic display name shown to payers (optional).
Satoshi CoffeemerchantNamestringMerchant's internal name.
Satoshi CoffeecountrystringrequiredstringsubdivisionstringrequiredstringlegalEntityTypeenumrequiredgovernment-entitynon-profitpartnershipprivate-limited-companypublic-companysole-proprietorgovernment-entitytermsOfServiceenumrequiredgeneral-us-hqgeneral-gb-fcageneral-pt-bopgeneral-lt-fcsgeneral-bs-scbgeneral-us-hquserIpstringstringResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/custodial/auth/register" \
-H "Content-Type: application/json" \
-d '{
"email": "string",
"businessEmail": "string",
"password": "string",
"displayName": "Satoshi Coffee",
"merchantName": "Satoshi Coffee",
"country": "string",
"subdivision": "string",
"legalEntityType": "government-entity",
"termsOfService": "general-us-hq",
"userIp": "string"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "active"
}
}
}Create Uphold entities
https://api.gobtcpay.com/public/api/v1.2/merchant/custodial/create-uphold-entitiesReplays the creation of the signed-in custodial merchant's Uphold business user and BTC account for the case where that step did not go through during Register (custodial). Takes no parameters, everything it needs, including the recorded Terms of Service acceptance, was stored at registration. Idempotent: once the entities exist the call is a no-op and never creates a second pair.
Authorization: merchantAuth
Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/merchant/custodial/create-uphold-entities" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {}
}
}