Chuyển tới nội dung chính

Tạo hóa đơn

Để tạo một hóa đơn mới theo định dạng của Provider dựa trên thông tin được cung cấp, sử dụng hàm apiInstance.createInvoice

import { CreateInvoiceRequest } from "@invoice-sdk/api"

let createInvoiceRequest: CreateInvoiceRequest

const { status, data } = await apiInstance.createInvoice(createInvoiceRequest);

Để phương thức apiInstance.createInvoice hoạt động, cần cung cấp một tham số:

  • createInvoiceRequest: CreateInvoiceRequest - thông tin hóa đơn cần được tạo.

Sau khi phương thức được thực thi, SDK sẽ trả về token xác thực CreateInvoiceSuccess hoặc thông báo lỗi CreateInvoiceError.

Định dạng các kiểu dữ liệu

Các kiểu dữ liệu được sử dụng trong phương thức apiInstance.createInvoice.

import { CreateInvoiceRequest, CreateInvoiceSuccess, CreateInvoiceError } from '@invoice-sdk/api'