Petfen
  1. Partner
Petfen
  • Petfen-Account
    • APIs
      • Shipping Address
        • Get List Shipping Address
        • Get Detail Shipping Address
        • Get Default Address
        • Create Shipping Address
        • Update Shipping Address
        • Delete Shipping Addres
      • Seller
        • Verify Phone Number
        • Confirm Phone Number
        • Create Shop
        • Login
        • Renew Access Token Copy
        • Change Password Copy
        • Forgot Password Copy
        • Confirm Forgot Password Copy
        • Logout Copy
      • User Bag
        • Add Item To Bag
        • List Item In Bag
        • Use Item
        • Undo Item To Bag
      • User
        • Register
        • Confirm Register with OTP
        • Login
        • Renew Access Token
        • Change Password
        • Forgot Password
        • Verify OTP Forgot Password
        • Resend OTP Forgot Password
        • Confirm Forgot Password
        • Logout
        • Get Account Info
        • List Accounts
        • Update Account
      • Shop
        • Get shop info
        • Follow Shop
        • UnFollow Shop
    • CMS
  • Petfen-Product
    • CMS
      • Internal CMS
        • Product
      • Product
      • Category
      • FlashSale
        • Get List Flash Sale
        • Create Flash Sale
        • Update Flash Sale
        • Get Detail Flash Sale
    • Client
      • Flash Sale
        • Get List Flash Sale
        • Get List Flash Sale Active
        • Get Detail Flash Sale
      • Category
        • Get List Category
        • Get Detail Category
      • Add Wishlist
      • Remove Wishlist
      • Get List Product
      • Get Detail Product
      • Get Detail Product By Id
      • Add Review
      • Get List Review
      • Get Shipping Methods List
      • Get Review Distribution
      • Get Filter Data
    • Seller
      • Product
  • Petfen-Order
    • Order - Create
      POST
    • Order - Cancel
      POST
    • Order - Update
      PUT
    • Order - List
      GET
    • Order - Detail
      GET
    • Cart - Sync
      POST
    • Cart - List
      GET
    • Order - Detail With Payment Id
      GET
    • Order statistic
      GET
  • Petfen-Payment
    • Request Payment
    • Confirm Payment
  • Petfen-voucher
    • Cms
      • Customer Group
        • Create Customer Group
        • Update Customer Group
        • Get Customer Group
        • Detail Customer Group
        • Delete Customer Group
      • Voucher
        • Create Voucher
        • Get Detail Voucher
        • Get List Voucher
    • Client
      • Get Voucher info
      • Get List Voucher
      • Get voucher code available
      • Calculate Discount
      • Check Voucher Valid
  • Petfen-Shipping
    • GHN
      • Delivery
        • Get Province
        • Get Station
        • Get Print Order Token
        • Print Order
        • Get District
        • Get Ward
        • Picking Shifts
        • Delivery Service
        • Calculate Delivery Fee
        • Calculate Expected Delivery Time
        • Create Order
        • Update Order
        • Cancel Order
        • Return Order
        • Get Order Info
        • Update COD
      • Support Ticket
        • Create Support Ticket
        • Get List Ticket
        • Get Ticket Detail
    • Service
      • Delivery
        • Get Province
        • Get District
        • Get Ward
        • Get Picking Shift
        • Get Order Info
        • Delivery Method
        • Calculate Delivery Fee
        • Calculate Expected Delivery Time
        • Create Order
        • Update Order
        • Cancel Order
        • Print Order
        • Return Order
        • Delivery Again
        • Update COD
      • Support Ticket
        • Create
        • Feedback
        • Get List
        • Get Detail
      • IPN Transaction
    • Ahamove
      • Order APIs
        • Estimate order fee with services
        • Estimate order fee with services
        • Estimate order fee with group services
        • Estimate order fee with group services
        • Create order by service ID
        • Create order by service ID
        • Create order by group service ID
        • Create order by group service ID
        • Cancel order by order_id
        • Cancel order by order_id
        • Cancel order by tracking_number
        • Cancel order by tracking_number
        • Get order detail
        • Get order detail
        • Get multiple order detail
        • Get multiple order detail
        • Get order list by tracking number
        • Get order list by tracking number
        • Get order tracking link
        • Get order tracking link
        • Get order callback logs
        • Get order callback logs
        • Update order Information
        • Update order Information
        • Rate a supplier
        • Rate a supplier
      • Master Data
        • Get cities
        • Get cities
        • Get list of services
        • Get list of services
        • Get service details
        • Get service details
      • Account APIs
        • Register account
        • Register account
        • Authenticate token
        • Authenticate token
        • Add child account
        • Add child account
        • Activate child account
        • Activate child account
        • Remove child account
        • Remove child account
        • Get child accounts list
        • Get child accounts list
        • Update user profile
        • Update user profile
    • Get list providers
    • Get list Provinces
    • Get list communes
    • Get list methods
  • Testing
  • Petfen-Invoice
    • S-Invoice
      • Login
      • SInvoice - Create invoice
      • SInvoice - Kê khai thuế
      • SInvoice - Lấy file hóa đơn chuyển đổi (pdf)
    • Partner
      • Auth Login
        POST
      • Create Invoice
        POST
      • Create Draft Invoice
        POST
      • Download Invoice File
        POST
      • Get Invoices
        POST
      • Cancel Invoice
        POST
      • Tax Declaration
        POST
      • Invoice Stat
        POST
      • Reconciliation
        POST
    • Service
      • Create Invoice
      • Update Invoice
      • Download Invoice
      • Cancel Invoice
      • Update Tax Declaration
      • Get Invoices
      • Get Invoice Stat
      • Reconciliation
  • Interal
    • Internal - Get access token
  1. Partner

Create Draft Invoice

POST
/InvoiceAPI/InvoiceWS/createOrUpdateInvoiceDraft/{{s-invoice-supplier-tax-code}}

Request

Header Params

Body Params application/json

Example
{
    "generalInvoiceInfo": { //Thông tin chung của hóa đơn
        "transactionUuid": "test-transaction-5",
        "invoiceType": "1",
        "templateCode": "1/779",
        "invoiceSeries": "K24MTB",
        "invoiceIssuedDate": 1605027600000,
        "currencyCode": "VND",
        "adjustmentType": "1",
        "paymentStatus": true,
        "cusGetInvoiceRight": true,
        "reservationCode": "681DDYKLMOEFD",
        "validation": 1,
        "originalInvoiceType": "1",
        "originalTemplateCode": "1/779",
        "originalInvoiceId": null
    },
    "buyerInfo": { //thông tin người mua
        "buyerName": "Tên khách hàng",
        "buyerLegalName": "Tên đơn vị",
        "buyerTaxCode": "0100109106",
        "buyerAddressLine": "An Khánh Hoài Đức Hà Nội",
        "buyerPostalCode": "2342324323",
        "buyerDistrictName": "Số 9, đường 11, VSIP Bắc Ninh, Thị xã Từ Sơn, Tỉnh",
        "buyerCityName": "Thành Phố Hà Nội",
        "buyerCountryCode": "84",
        "buyerPhoneNumber": "987999999",
        "buyerFaxNumber": "0458954",
        "buyerEmail": "minhltt@viettel.com.vn",
        "buyerBankName": "Ngân hàng Quân đội MB",
        "buyerBankAccount": "01578987871236547",
        "buyerIdType": "3",
        "buyerIdNo": "8888899999",
        "buyerCode": "832472343b_b",
        "buyerBirthDay": ""
    },
    "sellerInfo": { //thông tin người bán
        "sellerLegalName": "Người bán hàng",
        "sellerTaxCode": "0100109106",
        "sellerAddressLine": "Thành Phố Hà Nội - Việt Nam",
        "sellerPhoneNumber": "0123456789",
        "sellerFaxNumber": "0123456789",
        "sellerEmail": "email@gmail.com",
        "sellerBankName": "Ngân hàng ",
        "sellerBankAccount": "012345678901",
        "sellerDistrictName": "",
        "sellerCityName": "Thành Phố Hà Nội",
        "sellerCountryCode": "84",
        "sellerWebsite": "sinvoice.viettel.vn"
    },
    "payments": [ //thông tin thanh toán   
        {
            "paymentMethod": "2",
            "paymentMethodName": "CK"
        }
    ],
    "itemInfo": [ //thông tin hàng hóa
        {
            "lineNumber": 1,
            "itemCode": "PCDELLV3653_i56400_R4H10DVDRW",
            "itemName": "Máy tính để bàn DELL VOSTRO 3653 Desktop Core i5-6400 upto3.30Ghz/ 4GB/ 1TB HDD/DVDRW/NVIDIA Geforce 705 2Gb/ Wireless-Bluetooth/ K/ M/1Yr Pro",
            "unitName": "Cái",
            "itemNote": "",
            "unitPrice": 10300000,
            "quantity": 2,
            "itemTotalAmountWithoutTax": 20600000,
            "itemTotalAmountWithTax": 22660000,
            "itemTotalAmountAfterDiscount": 20600000,
            "taxPercentage": 10,
            "taxAmount": 2060000,
            "customTaxAmount": "0",
            "discount": 0,
            "itemDiscount": 0,
            "batchNo": "",
            "expDate": ""
        },
        {
            "lineNumber": 2,
            "itemCode": "LCDLI2215S_LNV",
            "itemName": "Màn hình vi tính LENOVO LCD LI2215S 21.5\" Led (65CCAACC6VN)",
            "unitName": "Cái",
            "itemNote": "",
            "unitPrice": 1750000,
            "quantity": 2,
            "itemTotalAmountWithoutTax": 3500000,
            "itemTotalAmountWithTax": 3696000,
            "itemTotalAmountAfterDiscount": 3360000,
            "taxPercentage": 10,
            "taxAmount": 336000,
            "customTaxAmount": "0",
            "discount": 4,
            "itemDiscount": 140000,
            "batchNo": "",
            "expDate": ""
        }
    ],
    "metadata": [ //thông tin trường động
    ],
    "meterReading": [ //thông tin đặc biệt dành cho hóa đơn điện nước
    ],
    "summarizeInfo": { //thông tin tổng hợp tiền của hóa đơn
    },
    "taxBreakdowns": [ //thông tin gom nhóm tiền hóa đơn theo thuế suất
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'http://petfen-account.local.com:8081/InvoiceAPI/InvoiceWS/createOrUpdateInvoiceDraft/{{s-invoice-supplier-tax-code}}' \
--header 'Cookie: access_token:{{s-invoice-access-token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "generalInvoiceInfo": { //Thông tin chung của hóa đơn
        "transactionUuid": "test-transaction-5",
        "invoiceType": "1",
        "templateCode": "1/779",
        "invoiceSeries": "K24MTB",
        "invoiceIssuedDate": 1605027600000,
        "currencyCode": "VND",
        "adjustmentType": "1",
        "paymentStatus": true,
        "cusGetInvoiceRight": true,
        "reservationCode": "681DDYKLMOEFD",
        "validation": 1,
        "originalInvoiceType": "1",
        "originalTemplateCode": "1/779",
        "originalInvoiceId": null
    },
    "buyerInfo": { //thông tin người mua
        "buyerName": "Tên khách hàng",
        "buyerLegalName": "Tên đơn vị",
        "buyerTaxCode": "0100109106",
        "buyerAddressLine": "An Khánh Hoài Đức Hà Nội",
        "buyerPostalCode": "2342324323",
        "buyerDistrictName": "Số 9, đường 11, VSIP Bắc Ninh, Thị xã Từ Sơn, Tỉnh",
        "buyerCityName": "Thành Phố Hà Nội",
        "buyerCountryCode": "84",
        "buyerPhoneNumber": "987999999",
        "buyerFaxNumber": "0458954",
        "buyerEmail": "minhltt@viettel.com.vn",
        "buyerBankName": "Ngân hàng Quân đội MB",
        "buyerBankAccount": "01578987871236547",
        "buyerIdType": "3",
        "buyerIdNo": "8888899999",
        "buyerCode": "832472343b_b",
        "buyerBirthDay": ""
    },
    "sellerInfo": { //thông tin người bán
        "sellerLegalName": "Người bán hàng",
        "sellerTaxCode": "0100109106",
        "sellerAddressLine": "Thành Phố Hà Nội - Việt Nam",
        "sellerPhoneNumber": "0123456789",
        "sellerFaxNumber": "0123456789",
        "sellerEmail": "email@gmail.com",
        "sellerBankName": "Ngân hàng ",
        "sellerBankAccount": "012345678901",
        "sellerDistrictName": "",
        "sellerCityName": "Thành Phố Hà Nội",
        "sellerCountryCode": "84",
        "sellerWebsite": "sinvoice.viettel.vn"
    },
    "payments": [ //thông tin thanh toán   
        {
            "paymentMethod": "2",
            "paymentMethodName": "CK"
        }
    ],
    "itemInfo": [ //thông tin hàng hóa
        {
            "lineNumber": 1,
            "itemCode": "PCDELLV3653_i56400_R4H10DVDRW",
            "itemName": "Máy tính để bàn DELL VOSTRO 3653 Desktop Core i5-6400 upto3.30Ghz/ 4GB/ 1TB HDD/DVDRW/NVIDIA Geforce 705 2Gb/ Wireless-Bluetooth/ K/ M/1Yr Pro",
            "unitName": "Cái",
            "itemNote": "",
            "unitPrice": 10300000,
            "quantity": 2,
            "itemTotalAmountWithoutTax": 20600000,
            "itemTotalAmountWithTax": 22660000,
            "itemTotalAmountAfterDiscount": 20600000,
            "taxPercentage": 10,
            "taxAmount": 2060000,
            "customTaxAmount": "0",
            "discount": 0,
            "itemDiscount": 0,
            "batchNo": "",
            "expDate": ""
        },
        {
            "lineNumber": 2,
            "itemCode": "LCDLI2215S_LNV",
            "itemName": "Màn hình vi tính LENOVO LCD LI2215S 21.5\" Led (65CCAACC6VN)",
            "unitName": "Cái",
            "itemNote": "",
            "unitPrice": 1750000,
            "quantity": 2,
            "itemTotalAmountWithoutTax": 3500000,
            "itemTotalAmountWithTax": 3696000,
            "itemTotalAmountAfterDiscount": 3360000,
            "taxPercentage": 10,
            "taxAmount": 336000,
            "customTaxAmount": "0",
            "discount": 4,
            "itemDiscount": 140000,
            "batchNo": "",
            "expDate": ""
        }
    ],
    "metadata": [ //thông tin trường động
    ],
    "meterReading": [ //thông tin đặc biệt dành cho hóa đơn điện nước
    ],
    "summarizeInfo": { //thông tin tổng hợp tiền của hóa đơn
    },
    "taxBreakdowns": [ //thông tin gom nhóm tiền hóa đơn theo thuế suất
    ]
}'

Responses

🟢200Success
application/json
Body

Example
{}
Modified at 2025-09-15 16:10:15
Previous
Create Invoice
Next
Download Invoice File
Built with