Skip to content

Print Receipt Notification

Description

列印發票通知

Resource

POST /v1/receipt/notification

Authorization

採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。

Request Body Parameters

Name Type Description
tax_id_number string 統一編號
receipt_no_list list[string] 發票號碼列表

Response

Status-Code: 204 No Content

sequenceDiagram
    autonumber
    participant C as Client
    participant O as Omniplatform
    participant DB as Database
    participant API as 接單門市

    C->>O: Call Print Receipt Notification API
    activate O

    O->>O: Call Check Params
    alt if check_result != 204
      O->>C: Return response(400)
    end

    O->>DB: Call Get Shop00 Of shop_id
    activate DB
    DB->>O: Return result
    deactivate DB

    alt if shop_id == ''
        O->>C: Return response(400, message='查無此統一編號所屬門市: {shop_id}')
    end

    O->>DB: Call Get Order Sync Url
    activate DB
    DB->>O: Return result
    deactivate DB

    alt if not result:
        O->>C: Return response(400, message='接單網址尚未設定')
    end

    O->>API: Call Print Receipt Notification API
    activate API
    API->>O: Return status_code, response_dict
    deactivate API

    alt if response_dict.get('code', '-1') != '0': 
        O->>C: Return response(400)
    end
    O->>C: Return response(204)
    deactivate O