# Kirim Foto X-RAY (In Development)

Development Base Path\
<https://apisdev-gw.beacukai.go.id/kirim-cn-pibk-barkir-public/kirim-cn-pibk-barkir>\
OR\
<https://apisdev-gw.beacukai.go.id/openapi/cnpibk>

If you use {URL\_API}/nle-oauth/v1/user/login to get token, then use [ttps://apisdev-gw.beacukai.go.id/openapi/cnpibk](https://apisdev-gw.beacukai.go.id/openapi/cnpibk) for the base path API

## Base URL

`https://apisdev-gw.beacukai.go.id/openapi/cnpibk`

***

{% stepper %}
{% step %}

### Kirim Foto X-Ray

This endpoint is used to submit new X-Ray photos for a specific customs declaration.

* URL: `/kirim-foto-xray`
* Method: `POST`
* Content-Type: `multipart/form-data`

#### Headers

* `Authorization`: `Bearer <your_token>` (Required)

#### Request Parts

* `data` (Required) - `application/json`
  * `nomorAju` (String, Required): The customs declaration number you get after sending document.
  * `nomorBlAwb` (String, Required): The Bill of Lading / Air Waybill number.
  * `tanggalBlAwb` (String, Required): The date of the BL/AWB in `yyyy-MM-dd` format.
  * `kodeKantor` (String, Required): The customs office code.
* `images` (Required) - `image/*`
  * An array of image files to be uploaded.

#### Example Request

```bash
curl -X POST \
  https://apisdev-gw.beacukai.go.id/openapi/cnpibk/xray/kirim-foto-xray \
  -H 'Authorization: Bearer <your_token>' \
  -H 'Content-Type: multipart/form-data' \
  -F 'data={
        "kodeKantor": "009000",
        "nomorBlAwb": "CNTESTXRAY3",
        "tanggalBlAwb": "2025-09-30",
        "nomorAju":"012345678901234500000020250930CNTESTXRAY3CN1"
      };type=application/json' \
  -F 'images=@/path/to/your/image1.jpg' \
  -F 'images=@/path/to/your/image2.png'
```

#### Responses

* 200 OK (Success) - HTTP 200

```json
{
    "success": true,
    "data": {
        "nomorAju": "012345678901234500000020250930CNTESTXRAY3CN1",
        "nomorBlAwb": "CNTESTXRAY3",
        "tanggalBlAwb": "2025-09-30",
        "kodeKantor": "009000",
        "npwpPemberitahu": "0123456789012345000000",
        "jumlahFotoTerupload": 2,
        "keterangan": "Sukses Upload Foto"
    },
    "timestamp": "2023-10-27 10:00:00",
    "code": 200,
    "message": "Sukses Kirim Foto Xray"
}
```

* 404 Not Found (BL/AWB Not Found) - HTTP 200

```json
{
    "success": false,
    "data": null,
    "timestamp": "2023-10-27 10:00:00",
    "code": 404,
    "message": "Gagal Kirim Foto Xray, Data BL/AWB CN tidak ditemukan"
}
```

* 401 Unauthorized - HTTP 401

```json
{
    "success": false,
    "data": null,
    "timestamp": "2023-10-27 10:00:00",
    "code": 401,
    "message": "Invalid Authorization Token"
}
```

* 409 Conflict (Data Already Exists) - HTTP 409

```json
{
    "success": false,
    "data": null,
    "timestamp": "2023-10-27 10:00:00",
    "code": 409,
    "message": "Data X-Ray sudah ada, silahkan gunakan API add untuk menambah foto"
}
```

{% endstep %}

{% step %}

### Add Foto X-Ray

This endpoint is used to add more X-Ray photos to an existing customs declaration.

* URL: `/add-foto-xray`
* Method: `POST`
* Content-Type: `multipart/form-data`

#### Headers

* `Authorization`: `Bearer <your_token>` (Required)

#### Request Parts

(Same as `/kirim-foto-xray`)

#### Example Request

(Same as `/kirim-foto-xray`)

#### Responses

* 200 OK (Success) - HTTP 200

```json
{
    "success": true,
    "data": {
        "nomorAju": "012345678901234500000020250930CNTESTXRAY3CN1",
        "nomorBlAwb": "CNTESTXRAY3",
        "tanggalBlAwb": "2025-09-30",
        "kodeKantor": "009000",
        "npwpPemberitahu": "0123456789012345000000",
        "jumlahFotoTerupload": 1,
        "keterangan": "Sukses Upload Foto"
    },
    "timestamp": "2023-10-27 10:00:00",
    "code": 200,
    "message": "Sukses Menambah Foto Xray"
}
```

* 404 Not Found (Data Not Found) - HTTP 200

```json
{
    "success": false,
    "data": null,
    "timestamp": "2023-10-27 10:00:00",
    "code": 404,
    "message": "Data Foto Xray tidak ditemukan"
}
```

* 401 Unauthorized - HTTP 401 (Same as `/kirim-foto-xray`)
  {% endstep %}

{% step %}

### Get Foto X-Ray

This endpoint is used to retrieve the details of X-Ray photos for a specific customs declaration.

* URL: `/get-foto-xray`
* Method: `GET`

#### Headers

* `Authorization`: `Bearer <your_token>` (Required)

#### Query Parameters

You can identify the declaration by either `nomorAju` or the combination of `nomorBlAwb`, `tanggalBlAwb`, and `kodeKantor`.

* `nomorAju` (String, Optional): The customs declaration number you get after sending document.
* `nomorBlAwb` (String, Optional): The Bill of Lading / Air Waybill number.
* `tanggalBlAwb` (String, Optional): The date of the BL/AWB in `yyyy-MM-dd` format.
* `kodeKantor` (String, Optional): The customs office code.

#### Example Request

By nomorAju:

```bash
curl -X GET \
  'https://apisdev-gw.beacukai.go.id/openapi/cnpibk/xray/get-foto-xray?nomorAju=012345678901234500000020250930CNTESTXRAY3CN1' \
  -H 'Authorization: Bearer <your_token>'
```

By BL/AWB details:

```bash
curl -X GET \
  'https://apisdev-gw.beacukai.go.id/openapi/cnpibk/xray/get-foto-xray?nomorBlAwb=CNTESTXRAY3&tanggalBlAwb=2025-09-30&kodeKantor=009000' \
  -H 'Authorization: Bearer <your_token>'
```

#### Responses

* 200 OK (Success) - HTTP 200

```json
{
    "success": true,
    "data": {
        "nomorAju": "012345678901234500000020250930CNTESTXRAY3CN1",
        "nomorBlAwb": "CNTESTXRAY3",
        "tanggalBlAwb": "2025-09-30",
        "kodeKantor": "009000",
        "npwpPemberitahu": "0123456789012345000000",
        "totalFotoTerupload": 2,
        "keterangan": null,
        "detail": [
            {
                "namaFile": "image1.jpg",
                "waktuRekam": "2023-10-27 10:00:00"
            },
            {
                "namaFile": "image2.png",
                "waktuRekam": "2023-10-27 10:00:05"
            }
        ]
    },
    "timestamp": "2023-10-27 10:01:00",
    "code": 200,
    "message": "Sukses Mengambil Data Foto X-Ray"
}
```

* 404 Not Found - HTTP 404

```json
{
    "success": false,
    "data": null,
    "timestamp": "2023-10-27 10:01:00",
    "code": 404,
    "message": "Data Foto Xray tidak ditemukan atas request yang diminta"
}
```

* 401 Unauthorized - HTTP 401 (Same as `/kirim-foto-xray`)
  {% endstep %}
  {% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ceisa40.gitbook.io/pia-ceisa40/api-services-barang-kiriman/daftar-service-impor-barang-kiriman/kirim-foto-x-ray-in-development.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
