منو
shell php java .Net javascript

مدیریت پلاک خودرو (Plate Management API)

این بخش وب‌سرویس‌های مدیریت پلاک خودرو و موتورسیکلت (ثبت، فهرست، جزئیات، ویرایش و حذف) و دریافت ثابت‌های کاتالوگ خودرو را شرح می‌دهد. پلاک‌های ثبت‌شده در این سرویس در فرایند بیمه شخص ثالث مورد استفاده قرار می‌گیرند.

https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/ آدرس پایه
v1 نسخه API

۱. مفهوم هدر user-id

سرویس‌های این مستند در دو دسته قرار می‌گیرند و مقدار هدر user-id در هر دسته معنای متفاوتی دارد:

معنای user-id شناسایی مشتری دسته
شناسه کسب‌وکار (Provider) فراخوان؛ پلاک‌ها به همان کسب‌وکار محدود هستند mobileNumber سرویس‌های مبتنی بر شماره همراه (کسب‌وکار)
شناسه واقعی کاربر دیجی‌پی؛ پلاک‌ها با ProviderId تهی ذخیره می‌شوند هدر user-id سرویس‌های مبتنی بر شناسه کاربر دیجی‌پی

۲. ساختار خطای اعتبارسنجی (HTTP 400)

توضیحات نوع داده نام فیلد
کد وضعیت HTTP (پیش‌فرض 400) Integer statusCode
پیام کلی خطا String message
خطاها به تفکیک نام فیلد؛ هر کلید آرایه‌ای از پیام‌ها Object<String, Array<String>> errors
{
  "statusCode": 400,
  "message": "One or more errors occurred!",
  "errors": {
    "fieldName": [
      "error message"
    ]
  }
}

۳. مقادیر شمارشی (Enums)

دسته وسیله نقلیه (VehicleCategoryType)

توضیحات عنوان مقدار
خودرو Car 1
موتورسیکلت Motor 2

۴. سرویس‌های کسب‌وکار (مبتنی بر شماره همراه)

هدر user-id در این سرویس‌ها کسب‌وکار فراخوان را مشخص می‌کند و تنها پلاک‌های ثبت‌شده توسط همان کسب‌وکار قابل دسترسی هستند. مشتری با mobileNumber شناسایی می‌شود.

۱-۴. ثبت پلاک خودرو با شماره همراه

پلاک برای مشتری با mobileNumber در کسب‌وکار فراخوان ثبت می‌شود.

/vehicle-plates آدرس سرویس
POST متد سرویس

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه کسب‌وکار (Provider) فراخوان که توسط API Gateway ارسال می‌شود String بله user-id
application/json String بله Content-Type

فیلدهای درخواست

توضیحات نوع فیلد اجباری نام فیلد
عنوان پلاک؛ حداکثر ۱۲۸ کاراکتر String بله plateName
شماره پلاک؛ حداکثر ۳۲ کاراکتر String بله plateNumber
سال ساخت (شمسی)؛ بین ۱۳۰۰ تا ۱۴۰۶؛ قابل تهی Integer خیر productionYear
شناسه نوع خودرو (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر typeId
شناسه برند (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر brandId
شناسه مدل (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر modelId
شناسه نوع کاربری (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر usageTypeId
دسته وسیله نقلیه Integer (Enum) خیر vehicleCategoryType
شماره همراه مشتری؛ حداکثر ۲۰ کاراکتر String بله mobileNumber

نمونه درخواست

curl --location --request POST 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b' \
--header 'Content-Type: application/json' \
--data-raw '{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567"
}'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
    'Content-Type: application/json',
]);
$body = <<<'JSON'
{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567"
}
JSON;
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

String body = """
{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567"
}
""";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates"))
    .method("POST", HttpRequest.BodyPublishers.ofString(body))
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .setHeader("Content-Type", "application/json")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;
using System.Text;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("POST"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");
request.Content = new StringContent(@"{
  ""plateName"": ""ماشین شخصی"",
  ""plateNumber"": ""12B34567"",
  ""productionYear"": 1400,
  ""typeId"": 1,
  ""brandId"": 1,
  ""modelId"": 1,
  ""usageTypeId"": 1,
  ""vehicleCategoryType"": 1,
  ""mobileNumber"": ""09121234567""
}", Encoding.UTF8, "application/json");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates', {
  method: 'POST',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "plateName": "ماشین شخصی",
    "plateNumber": "12B34567",
    "productionYear": 1400,
    "typeId": 1,
    "brandId": 1,
    "modelId": 1,
    "usageTypeId": 1,
    "vehicleCategoryType": 1,
    "mobileNumber": "09121234567"
  }),
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

در صورت نامعتبر بودن ورودی، پاسخ HTTP 400 با ساختار خطای اعتبارسنجی بازگردانده می‌شود.

۲-۴. فهرست پلاک‌های مشتری با شماره همراه

تنها پلاک‌های ثبت‌شده توسط کسب‌وکار فراخوان بازگردانده می‌شوند. پاسخ شامل plateNumber، plateName و brand است.

/vehicle-plates/by-mobile آدرس سرویس
GET متد سرویس

پارامترها

توضیحات نوع داده محل اجباری نام فیلد
شماره همراه مشتری String Query بله mobileNumber

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه کسب‌وکار (Provider) فراخوان که توسط API Gateway ارسال می‌شود String بله user-id

نمونه درخواست

curl --location --request GET 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-mobile?mobileNumber=09121234567' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-mobile?mobileNumber=09121234567');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
]);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-mobile?mobileNumber=09121234567"))
    .GET()
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("GET"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-mobile?mobileNumber=09121234567");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-mobile?mobileNumber=09121234567', {
  method: 'GET',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
  },
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

۳-۴. دریافت جزئیات پلاک با شماره همراه و شماره پلاک

جستجو به پلاک‌های کسب‌وکار فراخوان محدود است.

/vehicle-plates/detail/by-mobile آدرس سرویس
GET متد سرویس

پارامترها

توضیحات نوع داده محل اجباری نام فیلد
شماره همراه مشتری String Query بله mobileNumber
شماره پلاک String Query بله plateNumber

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه کسب‌وکار (Provider) فراخوان که توسط API Gateway ارسال می‌شود String بله user-id

نمونه درخواست

curl --location --request GET 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-mobile?mobileNumber=09121234567&plateNumber=12B34567' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-mobile?mobileNumber=09121234567&plateNumber=12B34567');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
]);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-mobile?mobileNumber=09121234567&plateNumber=12B34567"))
    .GET()
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("GET"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-mobile?mobileNumber=09121234567&plateNumber=12B34567");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-mobile?mobileNumber=09121234567&plateNumber=12B34567', {
  method: 'GET',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
  },
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

در صورت نامعتبر بودن ورودی، پاسخ HTTP 400 با ساختار خطای اعتبارسنجی بازگردانده می‌شود.

۴-۴. ویرایش پلاک خودرو

تمامی فیلدهای پلاک جایگزین می‌شوند؛ فیلدهای plateName، plateNumber و mobileNumber اجباری هستند.

/vehicle-plates/{id} آدرس سرویس
PUT متد سرویس

پارامترها

توضیحات نوع داده محل اجباری نام فیلد
شناسه پلاک String (UUID) Path بله id

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه کسب‌وکار (Provider) فراخوان که توسط API Gateway ارسال می‌شود String بله user-id
application/json String بله Content-Type

فیلدهای درخواست

توضیحات نوع فیلد اجباری نام فیلد
عنوان پلاک؛ حداکثر ۱۲۸ کاراکتر String بله plateName
شماره پلاک؛ حداکثر ۳۲ کاراکتر String بله plateNumber
سال ساخت (شمسی)؛ بین ۱۳۰۰ تا ۱۴۰۶؛ قابل تهی Integer خیر productionYear
شناسه نوع خودرو (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر typeId
شناسه برند (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر brandId
شناسه مدل (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر modelId
شناسه نوع کاربری (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر usageTypeId
دسته وسیله نقلیه Integer (Enum) خیر vehicleCategoryType
شماره همراه مشتری؛ حداکثر ۲۰ کاراکتر String بله mobileNumber

نمونه درخواست

curl --location --request PUT 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/3fa85f64-5717-4562-b3fc-2c963f66afa6' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b' \
--header 'Content-Type: application/json' \
--data-raw '{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567"
}'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/3fa85f64-5717-4562-b3fc-2c963f66afa6');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
    'Content-Type: application/json',
]);
$body = <<<'JSON'
{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567"
}
JSON;
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

String body = """
{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567"
}
""";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/3fa85f64-5717-4562-b3fc-2c963f66afa6"))
    .method("PUT", HttpRequest.BodyPublishers.ofString(body))
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .setHeader("Content-Type", "application/json")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;
using System.Text;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("PUT"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/3fa85f64-5717-4562-b3fc-2c963f66afa6");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");
request.Content = new StringContent(@"{
  ""plateName"": ""ماشین شخصی"",
  ""plateNumber"": ""12B34567"",
  ""productionYear"": 1400,
  ""typeId"": 1,
  ""brandId"": 1,
  ""modelId"": 1,
  ""usageTypeId"": 1,
  ""vehicleCategoryType"": 1,
  ""mobileNumber"": ""09121234567""
}", Encoding.UTF8, "application/json");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/3fa85f64-5717-4562-b3fc-2c963f66afa6', {
  method: 'PUT',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "plateName": "ماشین شخصی",
    "plateNumber": "12B34567",
    "productionYear": 1400,
    "typeId": 1,
    "brandId": 1,
    "modelId": 1,
    "usageTypeId": 1,
    "vehicleCategoryType": 1,
    "mobileNumber": "09121234567"
  }),
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

در صورت نامعتبر بودن ورودی، پاسخ HTTP 400 با ساختار خطای اعتبارسنجی بازگردانده می‌شود.

۵-۴. حذف پلاک خودرو

پلاک به‌صورت منطقی (Soft Delete) حذف می‌شود و در جستجوهای بعدی بازگردانده نمی‌شود. تنها پلاک‌های متعلق به کسب‌وکار فراخوان قابل حذف هستند.

/vehicle-plates/{id} آدرس سرویس
DELETE متد سرویس

پارامترها

توضیحات نوع داده محل اجباری نام فیلد
شناسه پلاک String (UUID) Path بله id

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه کسب‌وکار (Provider) فراخوان که توسط API Gateway ارسال می‌شود String بله user-id

نمونه درخواست

curl --location --request DELETE 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/3fa85f64-5717-4562-b3fc-2c963f66afa6' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/3fa85f64-5717-4562-b3fc-2c963f66afa6');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
]);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/3fa85f64-5717-4562-b3fc-2c963f66afa6"))
    .DELETE()
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("DELETE"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/3fa85f64-5717-4562-b3fc-2c963f66afa6");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/3fa85f64-5717-4562-b3fc-2c963f66afa6', {
  method: 'DELETE',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
  },
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

۵. سرویس‌های کاربر دیجی‌پی (مبتنی بر شناسه کاربر)

هدر user-id در این سرویس‌ها شناسه واقعی کاربر دیجی‌پی است (نه شناسه کسب‌وکار). تنها پلاک‌های بدون ProviderId در این سرویس‌ها قابل دسترسی هستند.

۱-۵. ثبت پلاک خودرو برای کاربر دیجی‌پی

پلاک برای کاربر هدر user-id ثبت می‌شود و ProviderId آن تهی ذخیره می‌شود. فیلد mobileNumber اختیاری است.

/vehicle-plates/by-user-id آدرس سرویس
POST متد سرویس

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه کاربر دیجی‌پی که توسط API Gateway ارسال می‌شود (شناسه کسب‌وکار نیست) String بله user-id
application/json String بله Content-Type

فیلدهای درخواست

توضیحات نوع فیلد اجباری نام فیلد
عنوان پلاک؛ حداکثر ۱۲۸ کاراکتر String بله plateName
شماره پلاک؛ حداکثر ۳۲ کاراکتر String بله plateNumber
سال ساخت (شمسی)؛ بین ۱۳۰۰ تا ۱۴۰۶؛ قابل تهی Integer خیر productionYear
شناسه نوع خودرو (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر typeId
شناسه برند (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر brandId
شناسه مدل (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر modelId
شناسه نوع کاربری (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر usageTypeId
دسته وسیله نقلیه Integer (Enum) خیر vehicleCategoryType
شماره همراه مشتری؛ حداکثر ۲۰ کاراکتر String خیر mobileNumber
کد ملی؛ حداکثر ۱۰ کاراکتر؛ قابل تهی String خیر nationalCode

نمونه درخواست

curl --location --request POST 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b' \
--header 'Content-Type: application/json' \
--data-raw '{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567",
  "nationalCode": "0012345678"
}'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
    'Content-Type: application/json',
]);
$body = <<<'JSON'
{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567",
  "nationalCode": "0012345678"
}
JSON;
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

String body = """
{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567",
  "nationalCode": "0012345678"
}
""";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id"))
    .method("POST", HttpRequest.BodyPublishers.ofString(body))
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .setHeader("Content-Type", "application/json")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;
using System.Text;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("POST"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");
request.Content = new StringContent(@"{
  ""plateName"": ""ماشین شخصی"",
  ""plateNumber"": ""12B34567"",
  ""productionYear"": 1400,
  ""typeId"": 1,
  ""brandId"": 1,
  ""modelId"": 1,
  ""usageTypeId"": 1,
  ""vehicleCategoryType"": 1,
  ""mobileNumber"": ""09121234567"",
  ""nationalCode"": ""0012345678""
}", Encoding.UTF8, "application/json");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id', {
  method: 'POST',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "plateName": "ماشین شخصی",
    "plateNumber": "12B34567",
    "productionYear": 1400,
    "typeId": 1,
    "brandId": 1,
    "modelId": 1,
    "usageTypeId": 1,
    "vehicleCategoryType": 1,
    "mobileNumber": "09121234567",
    "nationalCode": "0012345678"
  }),
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

در صورت نامعتبر بودن ورودی، پاسخ HTTP 400 با ساختار خطای اعتبارسنجی بازگردانده می‌شود.

۲-۵. فهرست پلاک‌های کاربر دیجی‌پی

تنها پلاک‌های بدون ProviderId بازگردانده می‌شوند. پاسخ شامل plateNumber، plateName و brand است.

/vehicle-plates/by-user-id آدرس سرویس
GET متد سرویس

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه کاربر دیجی‌پی که توسط API Gateway ارسال می‌شود (شناسه کسب‌وکار نیست) String بله user-id

نمونه درخواست

curl --location --request GET 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
]);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id"))
    .GET()
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("GET"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id', {
  method: 'GET',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
  },
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

۳-۵. دریافت جزئیات پلاک کاربر با شناسه پلاک

تنها پلاک‌های بدون ProviderId بازگردانده می‌شوند. پاسخ شامل فیلدهای کاتالوگ مانند brandId و modelTitle است.

/vehicle-plates/detail/by-user-id/{id} آدرس سرویس
GET متد سرویس

پارامترها

توضیحات نوع داده محل اجباری نام فیلد
شناسه پلاک String (UUID) Path بله id

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه کاربر دیجی‌پی که توسط API Gateway ارسال می‌شود (شناسه کسب‌وکار نیست) String بله user-id

نمونه درخواست

curl --location --request GET 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-user-id/3fa85f64-5717-4562-b3fc-2c963f66afa6' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-user-id/3fa85f64-5717-4562-b3fc-2c963f66afa6');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
]);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-user-id/3fa85f64-5717-4562-b3fc-2c963f66afa6"))
    .GET()
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("GET"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-user-id/3fa85f64-5717-4562-b3fc-2c963f66afa6");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-user-id/3fa85f64-5717-4562-b3fc-2c963f66afa6', {
  method: 'GET',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
  },
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

در صورت نامعتبر بودن ورودی، پاسخ HTTP 400 با ساختار خطای اعتبارسنجی بازگردانده می‌شود.

۴-۵. دریافت جزئیات پلاک کاربر با شماره پلاک

پارامتر اختیاری businessId پلاک‌ها را بر اساس کسب‌وکار فیلتر می‌کند؛ در صورت عدم ارسال، پلاک‌های بدون businessId جستجو می‌شوند.

/vehicle-plates/detail/by-user-id آدرس سرویس
GET متد سرویس

پارامترها

توضیحات نوع داده محل اجباری نام فیلد
شماره پلاک String Query بله plateNumber
شناسه کسب‌وکار (اختیاری) String Query خیر businessId

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه کاربر دیجی‌پی که توسط API Gateway ارسال می‌شود (شناسه کسب‌وکار نیست) String بله user-id

نمونه درخواست

curl --location --request GET 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-user-id?plateNumber=12B34567' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-user-id?plateNumber=12B34567');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
]);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-user-id?plateNumber=12B34567"))
    .GET()
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("GET"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-user-id?plateNumber=12B34567");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/detail/by-user-id?plateNumber=12B34567', {
  method: 'GET',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
  },
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

در صورت نامعتبر بودن ورودی، پاسخ HTTP 400 با ساختار خطای اعتبارسنجی بازگردانده می‌شود.

۵-۵. ویرایش جزئی پلاک کاربر

همه فیلدها اختیاری هستند و فیلدهای تهی بدون تغییر باقی می‌مانند. فیلد businessId پلاک را بر اساس کسب‌وکار فیلتر می‌کند؛ در صورت عدم ارسال، پلاک‌های بدون businessId جستجو می‌شوند.

/vehicle-plates/by-user-id/{id} آدرس سرویس
PUT متد سرویس

پارامترها

توضیحات نوع داده محل اجباری نام فیلد
شناسه پلاک String (UUID) Path بله id

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه کاربر دیجی‌پی که توسط API Gateway ارسال می‌شود (شناسه کسب‌وکار نیست) String بله user-id
application/json String بله Content-Type

فیلدهای درخواست

توضیحات نوع فیلد اجباری نام فیلد
عنوان پلاک؛ حداکثر ۱۲۸ کاراکتر String خیر plateName
شماره پلاک؛ حداکثر ۳۲ کاراکتر String خیر plateNumber
سال ساخت (شمسی)؛ بین ۱۳۰۰ تا ۱۴۰۶؛ قابل تهی Integer خیر productionYear
شناسه نوع خودرو (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر typeId
شناسه برند (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر brandId
شناسه مدل (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر modelId
شناسه نوع کاربری (از ثابت‌ها)؛ بزرگ‌تر از صفر؛ قابل تهی Long خیر usageTypeId
دسته وسیله نقلیه Integer (Enum) خیر vehicleCategoryType
شماره همراه مشتری؛ حداکثر ۲۰ کاراکتر String خیر mobileNumber
کد ملی؛ حداکثر ۱۰ کاراکتر؛ قابل تهی String خیر nationalId
شناسه کسب‌وکار پلاک؛ قابل تهی String خیر businessId

نمونه درخواست

curl --location --request PUT 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id/3fa85f64-5717-4562-b3fc-2c963f66afa6' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b' \
--header 'Content-Type: application/json' \
--data-raw '{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567",
  "nationalId": "0012345678",
  "businessId": "string"
}'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id/3fa85f64-5717-4562-b3fc-2c963f66afa6');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
    'Content-Type: application/json',
]);
$body = <<<'JSON'
{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567",
  "nationalId": "0012345678",
  "businessId": "string"
}
JSON;
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

String body = """
{
  "plateName": "ماشین شخصی",
  "plateNumber": "12B34567",
  "productionYear": 1400,
  "typeId": 1,
  "brandId": 1,
  "modelId": 1,
  "usageTypeId": 1,
  "vehicleCategoryType": 1,
  "mobileNumber": "09121234567",
  "nationalId": "0012345678",
  "businessId": "string"
}
""";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id/3fa85f64-5717-4562-b3fc-2c963f66afa6"))
    .method("PUT", HttpRequest.BodyPublishers.ofString(body))
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .setHeader("Content-Type", "application/json")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;
using System.Text;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("PUT"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id/3fa85f64-5717-4562-b3fc-2c963f66afa6");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");
request.Content = new StringContent(@"{
  ""plateName"": ""ماشین شخصی"",
  ""plateNumber"": ""12B34567"",
  ""productionYear"": 1400,
  ""typeId"": 1,
  ""brandId"": 1,
  ""modelId"": 1,
  ""usageTypeId"": 1,
  ""vehicleCategoryType"": 1,
  ""mobileNumber"": ""09121234567"",
  ""nationalId"": ""0012345678"",
  ""businessId"": ""string""
}", Encoding.UTF8, "application/json");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/vehicle-plates/by-user-id/3fa85f64-5717-4562-b3fc-2c963f66afa6', {
  method: 'PUT',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "plateName": "ماشین شخصی",
    "plateNumber": "12B34567",
    "productionYear": 1400,
    "typeId": 1,
    "brandId": 1,
    "modelId": 1,
    "usageTypeId": 1,
    "vehicleCategoryType": 1,
    "mobileNumber": "09121234567",
    "nationalId": "0012345678",
    "businessId": "string"
  }),
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

در صورت نامعتبر بودن ورودی، پاسخ HTTP 400 با ساختار خطای اعتبارسنجی بازگردانده می‌شود.

۶. ثابت‌های کاتالوگ خودرو (Constants)

این سرویس‌ها به هدر user-id وابسته نیستند، اما ارسال آن توسط API Gateway الزامی است.

۱-۶. دریافت ثابت‌های کاتالوگ خودرو

تمامی ثابت‌های مورد استفاده در پلاک شامل انواع، برندها، مدل‌ها، انواع کاربری و حروف پلاک را برمی‌گرداند. شناسه‌های typeId، brandId، modelId و usageTypeId از این سرویس دریافت می‌شوند.

/constants آدرس سرویس
GET متد سرویس

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه فراخوان که توسط API Gateway ارسال می‌شود String بله user-id

نمونه درخواست

curl --location --request GET 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/constants' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/constants');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
]);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/constants"))
    .GET()
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("GET"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/constants");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/constants', {
  method: 'GET',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
  },
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.

۲-۶. پاک‌سازی کش ثابت‌ها

کش Redis پاسخ سرویس GET /constants را حذف می‌کند؛ فراخوانی بعدی ثابت‌ها را مجدداً از پایگاه داده بارگذاری می‌کند.

/constants/cache آدرس سرویس
DELETE متد سرویس

هدرهای سرویس

توضیحات نوع داده اجباری نام هدر
شناسه فراخوان که توسط API Gateway ارسال می‌شود String بله user-id

نمونه درخواست

curl --location --request DELETE 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/constants/cache' \
--header 'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/constants/cache');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'user-id: 6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
]);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);

curl_close($ch);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newBuilder()
    .followRedirects(HttpClient.Redirect.NORMAL)
    .build();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/constants/cache"))
    .DELETE()
    .setHeader("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("DELETE"), "https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/constants/cache");

request.Headers.Add("user-id", "6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
const response = await fetch('https://app.mydigipay.com/digipay/api/business/v1/insurance/plates/constants/cache', {
  method: 'DELETE',
  headers: {
    'user-id': '6f1c2b7e-9d3a-4c1e-8b2f-0a1d2e3f4a5b',
  },
});

const data = await response.json();

پاسخ سرویس

پاسخ موفق HTTP 200 با بدنه JSON بازگردانده می‌شود.