Skip to main content
POST
/
v1
/
purchase-invoices
Create Purchase Invoice
curl --request POST \
  --url https://staging-openapi.accountingplus.id/v1/purchase-invoices \
  --header 'A-Data: <api-key>' \
  --header 'A-Signature: <api-key>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "vendor_name": "CV Agus System",
  "document_date": "30/07/2029",
  "items": [
    {
      "item_code": "0745114900005",
      "item_name": "Product A",
      "quantity": 2,
      "unit_of_measurement": "pcs",
      "unit_price": 2000,
      "discount_amount": 0,
      "tax_code": ""
    },
    {
      "item_code": "0745114900006",
      "item_name": "Product B",
      "quantity": 5,
      "unit_of_measurement": "pcs",
      "unit_price": 1000,
      "discount_amount": 0,
      "tax_code": ""
    }
  ],
  "auto_create_payment": true,
  "other_amount": 0
}
'
{
  "status": "00",
  "message": "success",
  "data": {
    "aging_days": 0,
    "auto_create_payment": true,
    "bank_account_code": "002",
    "bank_account_name": "Bank",
    "currency_code": "IDR",
    "currency_name": "Rupiah Indonesia",
    "description": "From API Integration id 1754626495",
    "discount_amount": 0,
    "document_date": "2029-07-30T00:00:00Z",
    "document_number": "00006/FPB/07/29",
    "document_status": "Final",
    "due_date": "2023-11-07T05:31:56Z",
    "other_amount": 0,
    "outstanding_amount": 9000,
    "purchase_order_document_number": "",
    "process_status": "Lunas",
    "rounding_amount": 0,
    "sub_total_amount": 9000,
    "tax_included_indicator": false,
    "total_amount": 9000,
    "total_payment": 9000,
    "total_tax_amount": 0,
    "vendor_address": "Indonesia",
    "vendor_code": "00006",
    "vendor_invoice_number": "",
    "vendor_name": "CV Agus System",
    "items": [
      {
        "detail_number": "00001",
        "discount_amount": 0,
        "document_number": "00006/FPB/07/29",
        "item_code": "0745114900005",
        "item_name": "Product A",
        "quantity": 2,
        "sub_total_amount": 4000,
        "tax_code": "",
        "tax_name": "",
        "tax_rate": 0,
        "total_amount": 4000,
        "total_tax_amount": 0,
        "unit_of_measurement_code": "PCS01",
        "unit_of_measurement_name": "pcs",
        "unit_price": 2000
      },
      {
        "detail_number": "00002",
        "discount_amount": 0,
        "document_number": "00006/FPB/07/29",
        "item_code": "0745114900006",
        "item_name": "Product B",
        "quantity": 5,
        "sub_total_amount": 5000,
        "tax_code": "",
        "tax_name": "",
        "tax_rate": 0,
        "total_amount": 5000,
        "total_tax_amount": 0,
        "unit_of_measurement_code": "PCS01",
        "unit_of_measurement_name": "pcs",
        "unit_price": 1000
      }
    ]
  }
}
Plain Signature
path=/v1/purchase-invoices&token=YOUR_TOKEN&email=john@gmail.com&tenant_id=841eaf97-c428-47d1-9f6d-c61cc9df7bee

Authorizations

Authorization
string
header
required

Generate a JWT signed with the client_secret and include the client_id as a claim in its payload.

A-Signature
string
header
required

Generate the signature by creating an SHA256-HMAC hash from the plain signature above, using the signature_secret as the key. Then, Base64-encode the resulting hash and place the final value in the A-Signature header.

A-Data
string
header
required

Include the email and tenant_id in the payload as Base64 encoded.

Body

application/json

Purchase invoice details

vendor_name
string
required
Example:

"CV Agus System"

document_date
string<date-time>
required
Example:

"30/07/2029"

items
object[]
required
Example:
[
{
"item_code": "0745114900005",
"item_name": "Product A",
"quantity": 2,
"unit_of_measurement": "pcs",
"unit_price": 2000,
"discount_amount": 0,
"tax_code": ""
},
{
"item_code": "0745114900006",
"item_name": "Product B",
"quantity": 5,
"unit_of_measurement": "pcs",
"unit_price": 1000,
"discount_amount": 0,
"tax_code": ""
}
]
auto_create_payment
boolean

Set to true if you want to create payment automatically

Example:

true

other_amount
number
Example:

0

Response

Purchase invoice created successfully

status
string
Example:

"00"

message
string
Example:

"success"

data
object