Shopee SDK API Reference - v1.11.0
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    config: ShopeeConfig

    Methods

    • Use this api to cancel an order. This action can only be performed before an order has been shipped.

      Parameters

      • params: CancelOrderParams

        Parameters for canceling the order

        Parameters for canceling an order

        • cancel_reason: string

          The reason seller want to cancel this order. Applicable values: OUT_OF_STOCK, UNDELIVERABLE_AREA(only apply for TW and MY)

        • Optionalitem_list?: CancelOrderItem[]

          Required when cancel_reason is OUT_OF_STOCK

        • order_sn: string

          Shopee's unique identifier for an order

        • Optionalpartial_cancel_item_list?: CancelOrderPartialCancelItem[]

          The list of item models and quantities that the seller wants to partially cancel

      Returns Promise<CancelOrderResponse>

      Promise - Response containing the update time of the canceled order

      • Throws error if:
      • Wrong parameters are provided
      • No permission to cancel order
      • Cannot cancel warehouse order
      • Shop and partner are not linked on seller center
      • Order has already been shipped
    • Download FBS invoices

      This API allows you to download FBS invoices. To use this API, the client must first call v2.order.generate_fbs_invoices to create a new shipping document task, followed by calling v2.order.get_fbs_invoices_result to check the task status. The document can only be downloaded once the task status is "READY."

      Parameters

      Returns Promise<DownloadFbsInvoicesResponse>

      A promise that resolves to the download FBS invoices response containing:

      • result_list: The list of download results

      When the API request fails or returns an error

    • Download invoice document

      This endpoint only for PH and BR local seller. Seller can download the invoice uploaded before through this endpoint.

      Parameters

      • params: DownloadInvoiceDocParams

        The parameters for downloading invoice document

        Parameters for downloading invoice document

        • order_sn: string

          Shopee's unique identifier for an order

      Returns Promise<DownloadInvoiceDocResponse>

      A promise that resolves to the download invoice document response containing:

      • url: The URL of the invoice document

      When the API request fails or returns an error

    • Generate FBS invoices

      This API creates a task to download a specific tax document (e.g., sales invoice, remessa invoice) for the seller's account, available only after the document is issued by the system as part of the Fulfilled by Shopee (FBS) process. The workflow is as follows: (1) v2.order.generate_fbs_invoices; (2) v2.order.get_fbs_invoices_result; (3) v2.order.download_fbs_invoices. Please note: The download link for the document will expire 30 minutes after being generated.

      Parameters

      Returns Promise<GenerateFbsInvoicesResponse>

      A promise that resolves to the generate FBS invoices response containing:

      • request_id: The request ID for the generated task

      When the API request fails or returns an error

    • Get booking detail

      Use this API to get booking detail.

      Parameters

      • params: GetBookingDetailParams

        The parameters for getting booking detail

        Parameters for getting booking detail

        • booking_sn_list: string[]

          The set of booking_sn. If there are multiple booking_sn, you need to use English comma to connect them. limit [1,50]

        • Optionalresponse_optional_fields?: string

          Optional fields in response

      Returns Promise<GetBookingDetailResponse>

      A promise that resolves to the booking detail response containing:

      • booking_list: List of booking details

      When the API request fails or returns an error

    • Get booking list

      Use this API to search bookings. You may also filter them by status, if needed.

      Parameters

      • params: GetBookingListParams

        The parameters for getting booking list

        Parameters for getting booking list

        • Optionalbooking_status?: string

          The booking_status filter for retrieving bookings. Available value: READY_TO_SHIP/PROCESSED/SHIPPED/CANCELLED/MATCHED

        • Optionalcursor?: string

          Specifies the starting entry of data to return in the current call

        • page_size: number

          Maximum number of entries to return in a single page (between 1 and 100)

        • time_from: number

          The starting date range for retrieving bookings. The maximum date range is 15 days

        • time_range_field: "create_time" | "update_time"

          The kind of time_from and time_to. Available value: create_time, update_time

        • time_to: number

          The ending date range for retrieving bookings. The maximum date range is 15 days

      Returns Promise<GetBookingListResponse>

      A promise that resolves to the booking list response containing:

      • more: Indicates whether the booking list is more than one page
      • next_cursor: If more is true, you should pass the next_cursor in the next request as cursor
      • booking_list: The list of bookings

      When the API request fails or returns an error

    • Get buyer invoice information for orders

      Use this API to obtain buyer submitted invoice info for VN, TH and PH local sellers only.

      Parameters

      Returns Promise<GetBuyerInvoiceInfoResponse>

      A promise that resolves to the invoice info response containing:

      • invoice_info_list: List of invoice information for each order
        • order_sn: Order identifier
        • invoice_type: Type of invoice (personal/company)
        • invoice_detail: Detailed invoice information
        • error: Error message if any
        • is_requested: Whether buyer requested invoice

      When the API request fails or returns an error

      • error_param: Missing or invalid parameters
      • error_auth: Authentication or permission errors
      • error_server: Internal server errors
    • Use this api to search orders. You may also filter them by status, if needed.

      Parameters

      • params: GetOrderListParams

        The parameters for getting order list

        Parameters for getting order list

        • Optionalcursor?: string

          Specifies the starting entry of data to return in the current call

        • Optionallogistics_channel_id?: number

          The identity of logistic channel. Valid only for BR

        • Optionalorder_status?: OrderStatus

          The order status filter for retrieving orders

        • page_size: number

          The maximum number of entries to return in a single page (between 1 and 100)

        • Optionalrequest_order_status_pending?: boolean

          Compatible parameter during migration period, send True will let API support PENDING status

        • Optionalresponse_optional_fields?: string

          Optional fields in response. Available value: order_status

        • time_from: number

          The starting date range for retrieving orders. The maximum date range is 15 days

        • time_range_field: TimeRangeField

          The kind of time_from and time_to. Available value: create_time, update_time

        • time_to: number

          The ending date range for retrieving orders. The maximum date range is 15 days

      Returns Promise<GetOrderListResponse>

      Promise - The response containing order list and pagination information

    • Use this api to get order detail.

      Parameters

      • params: GetOrdersDetailParams

        The parameters for getting order details

        Parameters for getting order details

        • order_sn_list: string[]

          The set of order_sn. If there are multiple order_sn, you need to use English comma to connect them. limit [1,50]

        • Optionalrequest_order_status_pending?: boolean

          Compatible parameter during migration period, send True will let API support PENDING status and return pending_terms, send False or don't send will fallback to old logic

        • Optionalresponse_optional_fields?: string

          A response fields you want to get. Please select from the below response parameters. If you input an object field, all the params under it will be included automatically in the response. If there are multiple response fields you want to get, you need to use English comma to connect them.

      Returns Promise<GetOrdersDetailResponse>

      Promise - The response containing detailed order information

    • Get package detail

      Use this API to get package detail.

      Parameters

      • params: GetPackageDetailParams

        The parameters for getting package detail

        Parameters for getting package detail

        • package_number_list: string[]

          The set of package_number. If there are multiple package_number, you need to use English comma to connect them. limit [1,50]

      Returns Promise<GetPackageDetailResponse>

      A promise that resolves to the package detail response containing:

      • package_list: List of package details

      When the API request fails or returns an error

    • Get pending buyer invoice order list

      This endpoint only for PH and BR local sellers only. This API is used for seller to retrieve a list of order IDs that are pending invoice upload.

      Parameters

      • params: GetPendingBuyerInvoiceOrderListParams

        The parameters for getting pending buyer invoice order list

        Parameters for getting pending buyer invoice order list

        • Optionalcursor?: string

          Specifies the starting entry of data to return in the current call

        • page_size: number

          Maximum number of entries to return in a single page (between 1 and 100)

      Returns Promise<GetPendingBuyerInvoiceOrderListResponse>

      A promise that resolves to the pending buyer invoice order list response containing:

      • more: Indicates whether the order list is more than one page
      • next_cursor: If more is true, you should pass the next_cursor in the next request as cursor
      • order_sn_list: The list of order serial numbers

      When the API request fails or returns an error

    • Use this api to get order list which order_status is READY_TO_SHIP to start process the whole shipping progress.

      Parameters

      • params: GetShipmentListParams

        The parameters for getting shipment list

        Parameters for getting shipment list

        • Optionalcursor?: string

          Specifies the starting entry of data to return in the current call. Default is "". If data is more than one page, the offset can be some entry to start next call

        • page_size: number

          Each result set is returned as a page of entries. Use the "page_size" filters to control the maximum number of entries to retrieve per page (i.e., per call). This integer value is used to specify the maximum number of entries to return in a single "page" of data. The limit of page_size if between 1 and 100

      Returns Promise<GetShipmentListResponse>

      Promise - The response containing shipment list and pagination information

    • Get warehouse filter config

      For multi-warehouse shops, return all warehouses with packages that have not been SHIPPED including product_location_id and address_id.

      Returns Promise<GetWarehouseFilterConfigResponse>

      A promise that resolves to the warehouse filter config response containing:

      • warehouse_list: The list of warehouse filter configurations

      When the API request fails or returns an error

    • Handle prescription check

      Use this API to approve or reject a prescription.

      Parameters

      • params: HandlePrescriptionCheckParams

        The parameters for handling prescription check

        Parameters for handling prescription check

        • Optionalfree_text?: string

          Free text remarks

        • Optionalis_approved?: boolean

          Indicate whether the prescription is approved or not

        • Optionalitems?: { item_id?: number; model_id?: number; prescription_status?: number }[]

          Prescription check items

        • operation: "REJECT" | "APPROVE"

          The operation you want to handle. Available value: APPROVE, REJECT

        • Optionalorder_sn?: string

          Shopee's unique identifier for an order

        • package_number: string

          Shopee's unique identifier for the package under an order

        • Optionalpharmacist_name?: string

          Name of the pharmacist

        • Optionalreject_reason?: string

          The reason for rejection. Required when operation is REJECT

        • Optionalreject_reason_code?: number

          Reject reason code

      Returns Promise<HandlePrescriptionCheckResponse>

      A promise that resolves to the handle prescription check response

      When the API request fails or returns an error

    • Set note for an order

      Use this API to set note for an order.

      Parameters

      • params: SetNoteParams

        The parameters for setting note

        Parameters for setting a note on an order

        • note: string

          The note seller add for reference

        • order_sn: string

          Shopee's unique identifier for an order

      Returns Promise<SetNoteResponse>

      A promise that resolves to the set note response

      When the API request fails or returns an error

    • Use this api to unsplit an order that has been split into multiple packages.

      Parameters

      • params: UnsplitOrderParams

        Parameters for unsplitting the order

        Parameters for unsplitting an order

        • order_sn: string

          Shopee's unique identifier for an order

      Returns Promise<UnsplitOrderResponse>

      Promise - Response containing the unsplit order details

      • Throws error if:
      • Wrong parameters are provided
      • No permission to unsplit order
      • Order has not been split
      • Unsplit order failed
      • Cannot unsplit order with invalid items
      • Cannot unsplit order with missing items
    • Upload invoice document

      This endpoint is for PH and BR local seller. Upload the invoice document.

      Parameters

      • params: UploadInvoiceDocParams

        The parameters for uploading invoice document

        Parameters for uploading invoice document

        • Optionalfile?: string

          File content/name

        • Optionalfile_type?: string

          File type (PDF, etc)

        • invoice_file: string

          The invoice document file

        • order_sn: string

          Shopee's unique identifier for an order

      Returns Promise<UploadInvoiceDocResponse>

      A promise that resolves to the upload invoice document response

      When the API request fails or returns an error