← All requests

POST /v1/advertiser/auth/register/establishment

Status
201
Duration
46.9 ms
Started (UTC)
2026-10-07 15:11:11.369
Route
/v1/advertiser/auth/register/establishment
Request ID
608c0cf9-a444-4b5d-a6d6-28943b588dfb
IP
37.19.196.100
User agent
curl/8.7.1
Language
ar
Queries
19 (30.7 ms)
Cache hit / miss
2 / 0

Timeline

query +2.0 ms 1.3 ms
select `id`, `mobile`, `status`, `language`, `last_sign_in_at`, `disabled_reason`, `created_at`, `updated_at`, `deleted_at`, `account_type`, `name`, `email`, `city_id`, `avatar_file_id`, `logo_file_id`, `establishment_name`, `cr_number`, `cr_file_id`, `address`, `tax_number`, `terms_accepted_at` from `advertisers` where `advertisers`.`mobile` = '+966524216590'

Parameters

[
  "+966524216590"
]

0 rows

cache +3.6 ms 0.4 ms
hit list:cities:bf21a9e8fbc5a384
query +5.0 ms 0.3 ms
select `id` from `advertisers` where `advertisers`.`cr_number` = '1034216590'

Parameters

[
  "1034216590"
]

0 rows

query +5.0 ms 0.4 ms
select `id`, `purpose`, `visibility`, `storage_key`, `original_name`, `mime_type`, `size_bytes`, `sha256`, `owner_type`, `owner_id`, `attached_at`, `created_at`, `updated_at` from `files` where `files`.`id` = '01a116eb-19d1-7759-a924-ea6ee8750216'

Parameters

[
  "01a116eb-19d1-7759-a924-ea6ee8750216"
]

1 rows

query +6.0 ms 0.4 ms
select `id`, `namespace`, `purpose`, `mobile`, `code_hash`, `attempts`, `ip`, `created_at`, `expires_at`, `consumed_at` from `otp_codes` where (`otp_codes`.`namespace` = 'advertiser' and `otp_codes`.`purpose` = 'register' and `otp_codes`.`mobile` = '+966524216590') order by `otp_codes`.`created_at` desc limit 1

Parameters

[
  "advertiser",
  "register",
  "+966524216590",
  1
]

1 rows

query +6.0 ms 6.4 ms
update `otp_codes` set `consumed_at` = '2026-10-07 15:11:11.374' where (`otp_codes`.`id` = '01a116eb-1f38-706c-859a-a079ac63f82d' and `otp_codes`.`consumed_at` is null)

Parameters

[
  "2026-10-07 15:11:11.374",
  "01a116eb-1f38-706c-859a-a079ac63f82d"
]

1 rows

query +14.0 ms 0.7 ms
begin

0 rows

cache +15.2 ms 0.8 ms
hit list:cities:bf21a9e8fbc5a384
query +17.0 ms 0.7 ms
select `id`, `purpose`, `visibility`, `storage_key`, `original_name`, `mime_type`, `size_bytes`, `sha256`, `owner_type`, `owner_id`, `attached_at`, `created_at`, `updated_at` from `files` where `files`.`id` = '01a116eb-19d1-7759-a924-ea6ee8750216'

Parameters

[
  "01a116eb-19d1-7759-a924-ea6ee8750216"
]

1 rows

query +18.0 ms 1.5 ms
insert into `advertisers` (`id`, `mobile`, `status`, `language`, `last_sign_in_at`, `disabled_reason`, `created_at`, `updated_at`, `deleted_at`, `account_type`, `name`, `email`, `city_id`, `avatar_file_id`, `logo_file_id`, `establishment_name`, `cr_number`, `cr_file_id`, `address`, `tax_number`, `terms_accepted_at`) values ('01a116eb-2419-71d5-b9fb-2b674b37a1a9', '+966524216590', default, default, default, default, default, default, default, 'establishment', 'خالد', NULL, '01a116db-4248-772b-be06-e37ca966bf09', default, NULL, 'مؤسسة تجربة', '1034216590', '01a116eb-19d1-7759-a924-ea6ee8750216', NULL, '300000000000003', '2026-10-07 15:11:11.387')

Parameters

[
  "01a116eb-2419-71d5-b9fb-2b674b37a1a9",
  "+966524216590",
  "establishment",
  "خالد",
  null,
  "01a116db-4248-772b-be06-e37ca966bf09",
  null,
  "مؤسسة تجربة",
  "1034216590",
  "01a116eb-19d1-7759-a924-ea6ee8750216",
  null,
  "300000000000003",
  "2026-10-07 15:11:11.387"
]

1 rows

query +20.0 ms 1.4 ms
select `id`, `purpose`, `visibility`, `storage_key`, `original_name`, `mime_type`, `size_bytes`, `sha256`, `owner_type`, `owner_id`, `attached_at`, `created_at`, `updated_at` from `files` where `files`.`id` = '01a116eb-19d1-7759-a924-ea6ee8750216'

Parameters

[
  "01a116eb-19d1-7759-a924-ea6ee8750216"
]

1 rows

query +21.0 ms 1.1 ms
update `files` set `owner_type` = 'advertiser', `owner_id` = '01a116eb-2419-71d5-b9fb-2b674b37a1a9', `attached_at` = '2026-10-07 15:11:11.390', `updated_at` = '2026-10-07 15:11:11.390' where (`files`.`id` = '01a116eb-19d1-7759-a924-ea6ee8750216' and `files`.`attached_at` is null)

Parameters

[
  "advertiser",
  "01a116eb-2419-71d5-b9fb-2b674b37a1a9",
  "2026-10-07 15:11:11.390",
  "2026-10-07 15:11:11.390",
  "01a116eb-19d1-7759-a924-ea6ee8750216"
]

1 rows

query +23.0 ms 0.5 ms
select `id`, `purpose`, `visibility`, `storage_key`, `original_name`, `mime_type`, `size_bytes`, `sha256`, `owner_type`, `owner_id`, `attached_at`, `created_at`, `updated_at` from `files` where `files`.`id` = '01a116eb-19d1-7759-a924-ea6ee8750216'

Parameters

[
  "01a116eb-19d1-7759-a924-ea6ee8750216"
]

1 rows

query +24.0 ms 0.6 ms
select `id`, `mobile`, `status`, `language`, `last_sign_in_at`, `disabled_reason`, `created_at`, `updated_at`, `deleted_at`, `account_type`, `name`, `email`, `city_id`, `avatar_file_id`, `logo_file_id`, `establishment_name`, `cr_number`, `cr_file_id`, `address`, `tax_number`, `terms_accepted_at` from `advertisers` where (`advertisers`.`id` = '01a116eb-2419-71d5-b9fb-2b674b37a1a9' and `advertisers`.`deleted_at` is null)

Parameters

[
  "01a116eb-2419-71d5-b9fb-2b674b37a1a9"
]

1 rows

query +25.0 ms 0.6 ms
update `advertisers` set `last_sign_in_at` = '2026-10-07 15:11:11.393', `updated_at` = '2026-10-07 15:11:11.394' where (`advertisers`.`id` = '01a116eb-2419-71d5-b9fb-2b674b37a1a9' and `advertisers`.`deleted_at` is null)

Parameters

[
  "2026-10-07 15:11:11.393",
  "2026-10-07 15:11:11.394",
  "01a116eb-2419-71d5-b9fb-2b674b37a1a9"
]

1 rows

query +25.0 ms 1.1 ms
select `id`, `mobile`, `status`, `language`, `last_sign_in_at`, `disabled_reason`, `created_at`, `updated_at`, `deleted_at`, `account_type`, `name`, `email`, `city_id`, `avatar_file_id`, `logo_file_id`, `establishment_name`, `cr_number`, `cr_file_id`, `address`, `tax_number`, `terms_accepted_at` from `advertisers` where (`advertisers`.`id` = '01a116eb-2419-71d5-b9fb-2b674b37a1a9' and `advertisers`.`deleted_at` is null)

Parameters

[
  "01a116eb-2419-71d5-b9fb-2b674b37a1a9"
]

1 rows

query +27.0 ms 2.0 ms
insert into `sessions` (`id`, `subject_type`, `subject_id`, `token_hash`, `device_name`, `ip`, `user_agent`, `created_at`, `last_used_at`, `expires_at`, `revoked_at`, `revoked_reason`) values ('01a116eb-2424-7736-9964-9c4ea692f081', 'advertiser', '01a116eb-2419-71d5-b9fb-2b674b37a1a9', '7dadbe4d1cb42f43f9c3395ad6c6a4ee148682df8b4f00aa1dd6706fe1254b88', NULL, '37.19.196.100', 'curl/8.7.1', '2026-10-07 15:11:11.396', '2026-10-07 15:11:11.396', '2027-10-07 15:11:11.396', NULL, NULL)

Parameters

[
  "01a116eb-2424-7736-9964-9c4ea692f081",
  "advertiser",
  "01a116eb-2419-71d5-b9fb-2b674b37a1a9",
  "7dadbe4d1cb42f43f9c3395ad6c6a4ee148682df8b4f00aa1dd6706fe1254b88",
  null,
  "37.19.196.100",
  "curl/8.7.1",
  "2026-10-07 15:11:11.396",
  "2026-10-07 15:11:11.396",
  "2027-10-07 15:11:11.396",
  null,
  null
]

1 rows

query +31.0 ms 0.5 ms
select `id` from `sessions` where ((`sessions`.`subject_type` = 'advertiser' and `sessions`.`subject_id` = '01a116eb-2419-71d5-b9fb-2b674b37a1a9') and `sessions`.`revoked_at` is null and `sessions`.`expires_at` > '2026-10-07 15:11:11.398' and `sessions`.`id` <> '01a116eb-2424-7736-9964-9c4ea692f081') order by `sessions`.`last_used_at` desc

Parameters

[
  "advertiser",
  "01a116eb-2419-71d5-b9fb-2b674b37a1a9",
  "2026-10-07 15:11:11.398",
  "01a116eb-2424-7736-9964-9c4ea692f081"
]

0 rows

query +31.0 ms 8.5 ms
commit

0 rows

query +40.0 ms 2.0 ms
select `id`, `code`, `name_ar`, `name_en`, `region_code`, `region_ar`, `region_en`, `active`, `created_at`, `updated_at` from `cities` where `cities`.`id` = '01a116db-4248-772b-be06-e37ca966bf09'

Parameters

[
  "01a116db-4248-772b-be06-e37ca966bf09"
]

1 rows

query +43.0 ms 0.5 ms
select `id`, `purpose`, `visibility`, `storage_key`, `original_name`, `mime_type`, `size_bytes`, `sha256`, `owner_type`, `owner_id`, `attached_at`, `created_at`, `updated_at` from `files` where `files`.`id` = '01a116eb-19d1-7759-a924-ea6ee8750216'

Parameters

[
  "01a116eb-19d1-7759-a924-ea6ee8750216"
]

1 rows

Request

Headers
{
  "host": "maqsed-api.dev-moltaqa.cloud",
  "user-agent": "curl/8.7.1",
  "content-length": "270",
  "accept": "*/*",
  "content-type": "application/json",
  "x-forwarded-for": "37.19.196.100",
  "x-forwarded-host": "maqsed-api.dev-moltaqa.cloud",
  "x-forwarded-port": "443",
  "x-forwarded-proto": "https",
  "x-forwarded-server": "2608fbae9cc2",
  "x-real-ip": "37.19.196.100",
  "accept-encoding": "gzip"
}
Query
{}
Body
{
  "establishmentName": "مؤسسة تجربة",
  "crNumber": "********",
  "name": "خالد",
  "mobile": "0524216590",
  "cityId": "01a116db-4248-772b-be06-e37ca966bf09",
  "taxNumber": "300000000000003",
  "crFileId": "01a116eb-19d1-7759-a924-ea6ee8750216",
  "acceptTerms": true,
  "code": "********"
}

Response

Body
{
  "accessToken": "********",
  "advertiser": {
    "id": "01a116eb-2419-71d5-b9fb-2b674b37a1a9",
    "accountType": "establishment",
    "displayName": "مؤسسة تجربة",
    "name": "خالد",
    "mobile": "+966524216590",
    "email": null,
    "city": {
      "id": "01a116db-4248-772b-be06-e37ca966bf09",
      "name": "أبها",
      "region": {
        "code": "asir",
        "name": "منطقة عسير"
      }
    },
    "language": "ar",
    "createdAt": "2026-10-07T15:11:11.388Z",
    "establishment": {
      "name": "مؤسسة تجربة",
      "crNumber": "********",
      "taxNumber": "300000000000003",
      "address": null,
      "logoUrl": null,
      "crDocument": {
        "id": "01a116eb-19d1-7759-a924-ea6ee8750216",
        "purpose": "commercial_registration",
        "name": "cr.pdf",
        "mimeType": "application/pdf",
        "size": 69,
        "url": "https://maqsed-api.dev-moltaqa.cloud/files/01a116eb-19d1-7759-a924-ea6ee8750216?expires=1791389471&signature=16e24b91e5074c9ee2fa7e75469b8b0c074bc43270cecb1e0c4abcdca61d62e3",
        "urlExpiresAt": "2026-10-07T16:11:11.000Z"
      }
    }
  },
  "nextStep": "packages"
}