Apps WebHook
    • Goodcom Webhook API
    • API Testing
      • Order Submit
        POST
      • Order Cancel
        POST

    Goodcom Webhook API

    Version: V1.1

    Table of Contents#

    1.
    Webhook Communication Diagram
    2.
    Webhook API Overview
    API Key and Secret Key
    Order Submit URL
    Order Cancel URL
    3.
    JSON Content Definition
    Fields for Submitting Orders
    Response
    Definition of order_json Field
    4.
    Callback
    5.
    Examples
    JSON Order Example
    PHP: Generate JSON Order
    PHP: Submit Order to Cloud Server
    PHP: Order Cancellation
    PHP: Receive Callback

    1. Webhook Communication Diagram#

    Flow description:
    1.
    Your website submits an order to the CLOUD server via the Webhook API.
    2.
    The CLOUD server forwards the order to the Printer.
    3.
    After the user confirms the order on the printer, the printer sends confirmation back to the CLOUD server.
    4.
    The CLOUD server relays the confirmation to your website via the Callback URL.

    2. Webhook API Overview#

    Orders are submitted via the Webhook API in JSON format. The JSON payload must include the api_key. The secret_key is optional but recommended for security — it is not passed as a JSON parameter; instead it is used to compute the sign field.

    2.1 API Key and Secret Key#

    To retrieve your API key and Secret Key:
    Step 1 — Login
    Go to https://gcanyapps.com/ and enter your account credentials.
    Step 2 — Navigate to Regions
    屏幕截图 2026-06-16 150157.png
    Click Regions in the left sidebar. Locate your region in the Region List and click Edit.
    Note: If no region exists yet, click Add Region to create one, then click "Click to select App Accounts" to associate accounts. Multiple accounts can be added to a single region.
    Step 3 — View Keys
    6_12751_20.png
    In the Edit Region pop-up:
    LabelDescription
    ① API KeyAutomatically generated; always visible
    ② Dynamic Validation toggleMust be ON to enable the Secret Key
    ③ Secret KeyVisible only when Dynamic Validation is enabled
    The Secret Key is never transmitted over the network — it is used only for local signature computation.

    2.2 Order Submit URL#

    NameDetails
    URLhttps://app.gcanyapps.com/v1/api/submitorder
    MethodPOST
    Content FormatJSON — see Section 3.1 for field definitions

    2.3 Order Cancel URL#

    NameDetails
    URLhttps://app.gcanyapps.com/v1/api/cancelorder
    MethodPOST
    Content FormatJSON — see Section 3.1 for field definitions

    3. JSON Content Definition#

    Data Structure#

    {
      "api_key": "string",
      "cur_time": "string",
      "sign": "string",
      "callback_url": "string",
      "order_id": "string",
      "order_json": {
        "CreateTime": "string",
        "DeliveryType": "string",
        "OrderId": "string",
        "Order": [
          {
            "o_title": "string",
            "o_num": "string",
            "o_name": "string",
            "o_amt": "string",
            "OrderOption": [
              {
                "o_oName": "string",
                "o_oAmt": "string"
              }
            ]
          }
        ],
        "SubTotal": "string",
        "DiscountAmt": "string",
        "DiscountTaxes": "string",
        "DeliveryCharges": "string",
        "DeliveryTaxes": "string",
        "ExtraFeeAmt": "string",
        "TotalTaxes": "string",
        "Total": "string",
        "PaymentStatus": "string",
        "CustName": "string",
        "CustAddr": "string",
        "CustTown": "string",
        "CustPhone": "string",
        "RequestTime": "string",
        "PaidType": "string",
        "Comment": "string"
      },
      "order_txt": "string"
    }

    3.1 Fields for Submitting Orders#

    FieldImportanceFormatDetails
    api_keyMandatoryStringThe API key auto-generated by the cloud server when creating a region (refer to ① in the Edit Region panel)
    cur_timeMandatoryStringCurrent UNIX timestamp in milliseconds. Acts as the unique order identifier — keep the same value when resending a failed order. If Dynamic Validation is enabled (②), this is also used as part of the encrypted signature.
    signOptionalStringMD5 hash of api_key + secret_key + cur_time. The secret key (③) is never sent over the network — used for encryption only. See Section 5.1 for an example.
    callback_urlOptionalStringURL on your web server to receive printer accept/reject responses. Falls back to the region's pre-configured callback URL if omitted. No response is sent if neither is set.
    order_idMandatoryStringUnique identifier for the order (must be unique per order).
    order_jsonOptionalObjectOrder content in JSON format. See Section 3.3 for the full definition.
    order_txtOptionalStringOrder content as plain text string.
    Note: For the Order Submit API, at least one of order_json or order_txt is required. If both are present, order_json takes precedence. For the Order Cancel API, neither is needed.
    Sign Calculation:
    sign = MD5(api_key + secret_key + cur_time)

    3.2 Response#

    All responses use JSON format.

    3.2.1 Success Response#

    {
      "status": 200,
      "msg": "ok"
    }
    FieldFormatDetails
    statusInteger200
    msgString"ok"

    3.2.2 Failure Response#

    {
      "status": 400,
      "msg": "Error message"
    }
    FieldFormatDetails
    statusInteger400
    msgStringDescriptive error message

    3.3 The Definition of order_json Field#

    FieldImportanceFormatDetails
    CreateTimeOptionalStringOrder creation time
    DeliveryTypeOptionalStringe.g. Delivery, Take away, Pickup, Dine-in
    OrderIdMandatoryStringMust be unique and match the top-level order_id
    OrderMandatory (≥1)ArrayProduct item list — see sub-fields below
    Order[].o_titleOptionalStringItem section title
    Order[].o_numOptionalStringQuantity
    Order[].o_nameOptionalStringItem name
    Order[].o_amtOptionalStringItem price
    Order[].OrderOption[].o_oNameOptionalStringOption name
    Order[].OrderOption[].o_oAmtOptionalStringOption price
    SubTotalOptionalStringSubtotal amount
    DiscountAmtOptionalStringDiscount amount
    DiscountTaxesOptionalStringTax on discount
    DeliveryChargesOptionalStringDelivery / shipping fee
    DeliveryTaxesOptionalStringTax on delivery fee
    ExtraFeeAmtOptionalStringAdditional fee
    TotalTaxesOptionalStringTotal tax
    TotalOptionalStringGrand total
    PaymentStatusOptionalString"Order Paid" or "Order No Paid"
    CustNameOptionalStringCustomer name
    CustAddrOptionalStringCustomer address
    CustTownOptionalStringCustomer town/city
    CustPhoneOptionalStringCustomer phone number
    RequestTimeOptionalStringRequested delivery/pickup time. Accepted formats: hh:mm yyyy-MM-dd, hh:mm MM-dd-yyyy, hh:mm dd-MM-yyyy
    PaidTypeOptionalStringe.g. Cash on delivery, PayPal, Stripe
    CommentOptionalStringCustomer remarks

    4. Callback#

    After the user confirms or rejects an order on the printer, the printer notifies the website via the Callback URL. The URL can be included in the submitted order JSON or pre-configured on the cloud server.

    Callback Flow#

    Printer ──[Accept/Reject]──▶ CLOUD Server ──[GET callback_url?params]──▶ Your Website

    Callback URL Format#

    Accepted — reply type: time (OK)
    GET callback_url?a=2&o=10004&ak=Accepted&m=OK&dt=21:51&dd=210424&u=testuser&p=test&cur=2151342104 HTTP/1.1
    Accepted — reply type: item (e.g. 10 Minutes)
    GET callback_url?a=2&o=323&ak=Accepted&m=10_Minutes&dt=21:51&dd=210424&u=testuser&p=test&cur=2151342104 HTTP/1.1
    Rejected
    GET callback_url?a=2&o=323&ak=Rejected&m=FOOD_UNAVAILABLE&dt=02:36&dd=210424&u=testuser&p=test&cur=2151342104 HTTP/1.1

    Callback Parameter Reference#

    ParameterDetails
    aRegion (Res) ID set on the device
    oOrder ID from the submitted order
    akAction: Accepted or Rejected
    mDescription of accept/reject action. If accepted with time reply → OK. If accepted with item reply → selected item (e.g. 10_Minutes). If rejected → the reject reason selected by the operator.
    dtTime entered by the operator when accepting
    ddDate entered by the operator. Format: ddmmyy (e.g. 210424 = 2024-04-21)
    uUsername for login on your website
    pPassword for login on your website
    curCurrent timestamp (can be ignored if not needed)

    5. Examples#

    5.1 JSON Order Example#

    Sign Calculation:
    Given:
    API Key = WjU5X3Q3Y2Rvc25q
    Secret Key = nxr8xc8a
    cur_time = 1713748630
    sign = MD5("WjU5X3Q3Y2Rvc25q" + "nxr8xc8a" + "1713748630")
         = MD5("WjU5X3Q3Y2Rvc25qnxr8xc8a1713748630")
         = 60a7d2d9698eb62c0b928467cde123db
    Full JSON Payload:
    {
      "api_key": "WjU5X3Q3Y2Rvc25q",
      "cur_time": "1713748630",
      "sign": "60a7d2d9698eb62c0b928467cde123db",
      "callback_url": "http://goodcom.cn/order/order_callback.php",
      "order_id": "10006",
      "order_json": {
        "Create_time": "15:00 16-08-2022",
        "DeliveryType": "Delivery",
        "OrderId": "10006",
        "Order": [
          {
            "o_title": "Title",
            "o_num": "1",
            "o_name": "Chicken",
            "o_amt": "5.00",
            "OrderOption": [
              { "o_oName": "option1", "o_oAmt": "1.00" },
              { "o_oName": "option2", "o_oAmt": "2.00" }
            ]
          }
        ],
        "SubTotal": "0.00",
        "DiscountAmt": "0.00",
        "DiscountTaxes": "",
        "DeliveryCharges": "0.00",
        "DeliveryTaxes": "",
        "ExtraFeeAmt": "",
        "TotalTaxes": "",
        "Total": "29.10",
        "PaymentStatus": "Order Paid",
        "CustName": "Tom",
        "CustAddr": "Address of the Customer",
        "CustTown": "",
        "CustPhone": "00861234567890",
        "RequestTime": "15:30 16-08-2022",
        "PaidType": "Cash",
        "Comment": "comment"
      },
      "order_txt": ""
    }

    5.2 Example of PHP Code Generating JSON Format Orders#


    5.3 Example of PHP Code Submitting JSON Order to Cloud Server#

    Built on top of Section 5.2:

    5.4 PHP Code Example of Order Cancellation#

    $api_key and $secret_key are defined in Section 5.2.

    5.5 Example of How a Website Receives Callback#

    When an order is submitted with a callback_url (or the URL is pre-configured on the cloud server), the printer sends a GET request to that URL after the order is accepted or rejected.
    The following example shows how order_callback.php reads the callback parameters:
    Callback Parameter Summary (in context of the PHP handler):
    VariableGET ParamDescription
    $resIdaRegion ID set on the device
    $orderIdoOrder ID
    $statusakAccepted or Rejected
    $reasonmAccept message or reject reason (_ replaced with space)
    $timedtAccept time (e.g. 21:51)
    $dateddAccept date in ddmmyy format (e.g. 210424 → 2024-04-21)
    $useruLogin username
    $pwdpLogin password
    $curcurTimestamp (optional, can be ignored)

    End of Goodcom Webhook API Documentation — V1.1
    Modified at 2026-06-22 06:35:31
    Next
    Order Submit
    Built with