Create a one-time code to link your WhatsApp number
POST
/dashboard/v1/merchants/{merchantId}/{mode}/whatsapp/link-codes
const url = 'http://localhost:4000/dashboard/v1/merchants/example/test/whatsapp/link-codes';const options = { method: 'POST', headers: { cookie: 'better-auth.session_token=<better-auth.session_token>', 'Content-Type': 'application/json' }, body: '{"wa_number":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:4000/dashboard/v1/merchants/example/test/whatsapp/link-codes \ --header 'Content-Type: application/json' \ --cookie better-auth.session_token=<better-auth.session_token> \ --data '{ "wa_number": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”merchantId
required
string
mode
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
wa_number
required
string
Examplegenerated
{ "wa_number": "example"}Responses
Section titled “ Responses ”One-time linking code
Media typeapplication/json
object
code
required
string
expires_at
required
string
wa_me_url
required
string
Examplegenerated
{ "code": "example", "expires_at": "example", "wa_me_url": "example"}Invalid request
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Sign-in required
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Forbidden
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Not found
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Idempotency conflict or invalid state
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}