# Kirim Data E-Invoice

* **Development**

URL Dev: [https://apisdev-gw.beacukai.go.id/kirim-einvoice-barkir-public/kirim-data-einvoice-barkir](https://apisdev-gw.beacukai.go.id/kirim-einvoice-barkir-public/kirim-data-einvoice-barkir/e-invoice/sendData)

* **Production**

URL Prod : [https://apis-gw.beacukai.go.id/kirim-einvoice-barkir-public/kirim-data-einvoice-barkir](https://apis-gw.beacukai.go.id/kirim-einvoice-barkir-public/kirim-data-einvoice-barkir/e-invoice/sendData)

## Kirim Data E-Invoice

<mark style="color:green;">`POST`</mark> `{API_URL}/e-invoice/send-data`

API *Endpoint* to send E-Invoice data from Marketplace

Discount refer to Discount Type and Discount Provider References

#### Headers

| Name                                            | Type   | Description                         |
| ----------------------------------------------- | ------ | ----------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer Token from Authorization API |

#### Request Body

| Name                                            | Type   | Description               |
| ----------------------------------------------- | ------ | ------------------------- |
| Data Einvoice<mark style="color:red;">\*</mark> | String | JSONSchema E-Invoice Data |

{% tabs %}
{% tab title="200: OK Ok" %}

```javascript
[
    {
        "status": "100",
        "data": "Invoice Number: INVOICETEST-2 Date: 2024-11-18",
        "messages": [
            "Data Received, waiting for CEISA validation"
        ]
    }
]
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="403: Forbidden Forbidden" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="404: Not Found Not Found" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### JSONSchema Kirim Data E-Invoice

```
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": [
    {
      "type": "object",
      "properties": {
        "buyerName": {
          "type": "string"
        },
        "buyerPhoneNumber": {
          "type": "string"
        },
        "commodity": {
          "type": "array",
          "items": [
            {
              "type": "object",
              "properties": {
                "countQuantity": {
                  "type": "string"
                },
                "discountProvider": {
                  "type": "string"
                },
                "discountType": {
                  "type": "string"
                },
                "discountValue": {
                  "type": "string"
                },
                "exitToEntryChargeAmount": {
                  "type": "string"
                },
                "identityQualifierCode": {
                  "type": "string"
                },
                "measurementUnit": {
                  "type": "string"
                },
                "orderUrl": {
                  "type": "string"
                }
              },
              "required": [
                "countQuantity",
                "discountProvider",
                "discountType",
                "discountValue",
                "exitToEntryChargeAmount",
                "identityQualifierCode",
                "measurementUnit",
                "orderUrl"
              ]
            }
          ]
        },
        "currencyTypeCode": {
          "type": "string"
        },
        "exchangeRate": {
          "type": "string"
        },
        "invoiceDate": {
          "type": "string"
        },
        "invoiceNumber": {
          "type": "string"
        },
        "invoiceURL": {
          "type": "string"
        },
        "marketplaceName": {
          "type": "string"
        }
      },
      "required": [
        "buyerName",
        "buyerPhoneNumber",
        "commodity",
        "currencyTypeCode",
        "exchangeRate",
        "invoiceDate",
        "invoiceNumber",
        "invoiceURL",
        "marketplaceName"
      ]
    }
  ]
}
```

### Contoh Data E-Invoice

```
[
  {
    "buyerName": "PENERIMA-1",
    "buyerPhoneNumber": "081233334444",
    "commodity": [
      {
        "countQuantity": "1",
        "discountProvider": "",
        "discountType": "",
        "discountValue": "",
        "exitToEntryChargeAmount": "4.5",
        "identityQualifierCode": "SKU_ABC10",
        "measurementUnit": "PCE",
        "orderUrl": "-"
      }
    ],
    "currencyTypeCode": "USD",
    "exchangeRate": "15759",
    "invoiceDate": "2024-11-18",
    "invoiceNumber": "INVOICETEST-2",
    "invoiceURL": "-",
    "marketplaceName": "DEMO BEACUKAI"
  }
]
```

Sample Response :

```json
[
    {
        "status": "100",
        "data": "Invoice Number: INVOICETEST-2 Date: 2024-11-18",
        "messages": [
            "Data Received, waiting for CEISA validation"
        ]
    }
]
```


---

# 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-data-e-invoice.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.
