服務網站 https://1shop.tw/

串接代碼

{
  "openapi": "3.1.0",
  "info": {
    "title": "1Shop Order API",
    "description": "This API provides access to order details from 1Shop.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "<https://api.1shop.tw/v1>"
    }
  ],
  "paths": {
    "/order/{order_number}": {
      "get": {
        "description": "Fetches details of an order using its order number.",
        "operationId": "GetOrder",
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "description": "The order number of the order.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appid",
            "in": "query",
            "description": "The app ID.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "8gn5aDpoKkADyjOxv47GYeXE"
            }
          },
          {
            "name": "secret",
            "in": "query",
            "description": "The secret key.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "{API Key}"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with order details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "OrderResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "integer",
            "description": "0 represents success, any other value represents failure."
          },
          "data": {
            "type": "object",
            "properties": {
              "order": {
                "$ref": "#/components/schemas/Order"
              },
              "cart": {
                "$ref": "#/components/schemas/Cart"
              },
              "receipt": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Receipt"
                }
              },
              "shipping_tracking": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ShippingTracking"
                }
              }
            }
          },
          "msg": {
            "type": "string",
            "description": "Message indicating the result of the operation."
          }
        }
      },
      "Order": {
        "type": "object",
        "properties": {
          "order_number": { "type": "string", "description": "The order number." },
          "order_ip": { "type": "string", "description": "The IP address from which the order was created." },
          "name": { "type": "string", "description": "The name of the person who placed the order." },
          "gender": { "type": "string", "description": "The gender of the person (none, male, female)." },
          "total_price": { "type": "integer", "description": "The total price of the order." },
          "payment": { "type": "string", "description": "The payment method used." },
          "logistic": { "type": "string", "description": "The logistic method used." },
          "create_date": { "type": "string", "format": "date-time", "description": "The date and time when the order was created." },
          "progress_status": { "type": "string", "description": "The status of the order." },
          "payment_status": { "type": "string", "description": "The payment status of the order." },
          "logistic_status": { "type": "string", "description": "The logistic status of the order." },
          "payment_date": { "type": "string", "format": "date-time", "description": "The date and time when the payment was made." },
          "tag": { "type": "string", "description": "A custom tag for the order." },
          "page_title": { "type": "string", "description": "The title of the page where the order was placed." },
          "page_prefix": { "type": "string", "description": "The prefix of the page where the order was placed." },
          "note": { "type": "string", "description": "Customer's note for the order." },
          "shop_note": { "type": "string", "description": "Shop's note for the order." },
          "email": { "type": "string", "description": "The email address of the person who placed the order." },
          "country": { "type": "string", "description": "The country code (ISO 3166-1 alpha-2) of the person who placed the order." },
          "phone": { "type": "string", "description": "The phone number of the person who placed the order." },
          "zip_code": { "type": "string", "description": "The postal code of the person who placed the order." },
          "county_and_city": { "type": "string", "description": "The county and city of the person who placed the order." },
          "area": { "type": "string", "description": "The area of the person who placed the order." },
          "address": { "type": "string", "description": "The address of the person who placed the order." },
          "address_oversea": { "type": "string", "description": "The overseas address, if provided by the customer." },
          "cvs_store_id": { "type": "string", "description": "The ID of the convenience store for pickup." },
          "cvs_store_name": { "type": "string", "description": "The name of the convenience store for pickup." },
          "cvs_store_address": { "type": "string", "description": "The address of the convenience store for pickup." },
          "payment_third_party": { "type": "string", "description": "The third party used for payment." },
          "payment_third_party_no": { "type": "string", "description": "The third party payment transaction number." },
          "logistics_third_party": { "type": "string", "description": "The third party used for logistics." },
          "logistics_third_party_no": { "type": "string", "description": "The third party logistics transaction number." },
          "logistics_shipping_no": { "type": "string", "description": "The shipping number for convenience store pickup." },
          "shop_url": { "type": "string", "description": "The URL of the shop or sales page." },
          "order_url": { "type": "string", "description": "The URL of the order." },
          "regular_time": { "type": "integer", "description": "The number of periods for regular payments." },
          "custom_fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": { "type": "string", "description": "The label of the custom field." },
                "value": { "type": "string", "description": "The value of the custom field." }
              }
            }
          }
        }
      },
      "Cart": {
        "type": "object",
        "properties": {
          "sub_total": { "type": "integer", "description": "The subtotal of the cart, including all single products, bundles, and charges." },
          "logistic_fee": { "type": "integer", "description": "The logistic fee." },
          "payment_fee": { "type": "integer", "description": "The payment fee." },
          "refund": { "type": "integer", "description": "The refund amount." },
          "total_price": { "type": "integer", "description": "The total price of the cart." },
          "products": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product_type": { "type": "string", "description": "The type of the product (single, bundle, charge)." },
                "quantity": { "type": "integer", "description": "The quantity of the product." },
                "per_cost": { "type": "integer", "description": "The cost per unit of the product." },
                "line_total": { "type": "integer", "description": "The total cost for the quantity of the product." },
                "name": { "type": "string", "description": "The name of the product." },
                "sku": { "type": "string", "description": "The SKU of the product." },
                "label": { "type": "string", "description": "A description or label for the product." },
                "inventory_status": { "type": "integer", "description": "The inventory status of the product (0: in stock, 1: pre-order)." },
                "bundle": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": { "type": "string", "description": "The name of the product in the bundle." },
                      "sku": { "type": "string", "description": "The SKU of the product in the bundle." },
                      "quantity": { "type": "integer", "description": "The quantity of the product in the bundle." },
                      "label": { "type": "string", "description": "A description or label for the product in the bundle." },
                      "inventory_status": { "type": "integer", "description": "The inventory status of the product in the bundle (0: in stock, 1: pre-order)." }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Receipt": {
        "type": "object",
        "properties": {
          "third_party": { "type": "string", "description": "The third party used for issuing the receipt." },
          "status": { "type": "integer", "description": "The status of the receipt (0: waiting, 1: issued, 2: voided)." },
          "type": { "type": "integer", "description": "The type of receipt (0: personal, 1: donation, 2: company)." },
          "carruer_type": { "type": "integer", "description": "The carrier type for personal receipts (0: member carrier, 1: mobile barcode, 2: citizen certificate)." },
          "carruer_num": { "type": "string", "description": "The carrier number for mobile barcode or citizen certificate." },
          "love_code": { "type": "string", "description": "The love code for donations." },
          "tax_type": { "type": "integer", "description": "The tax type (1: taxable, 2: zero tax rate, 3: tax-free, 4: mixed taxable and tax-free)." },
          "email": { "type": "string", "description": "The email associated with the receipt." },
          "sales_amount": { "type": "integer", "description": "The total sales amount." },
          "invoice_number": { "type": "string", "description": "The invoice number." },
          "invoice_date": { "type": "string", "format": "date-time", "description": "The date of the invoice." },
          "random_number": { "type": "string", "description": "The random number for the invoice." },
          "invoice_remark": { "type": "string", "description": "Remarks for the invoice." },
          "create_date": { "type": "string", "format": "date-time", "description": "The creation date of the receipt." },
          "receipt_title": { "type": "string", "description": "The title of the receipt." },
          "tax_num": { "type": "string", "description": "The tax number for companies." },
          "address": { "type": "string", "description": "The address associated with the receipt." },
          "invoice_date": { "type": "string", "format": "date-time", "description": "The date the invoice was issued." },
          "phone": { "type": "string", "description": "The phone number associated with the receipt." }
        }
      },
      "ShippingTracking": {
        "type": "object",
        "properties": {
          "provider": { "type": "string", "description": "The logistics provider." },
          "url": { "type": "string", "description": "The URL for tracking the shipment." },
          "tracking_number": { "type": "string", "description": "The tracking number for the shipment." },
          "shipping_date": { "type": "string", "format": "date-time", "description": "The shipping date." },
          "create_date": { "type": "string", "format": "date-time", "description": "The creation date of the shipping record." },
          "store_arrived_date": { "type": "string", "format": "date-time", "description": "The date the shipment arrived at the store." }
        }
      }
    }
  }
}