2017-11-29 8 views
0

일부 외부 서비스를 Shopify 상점에 연결해야합니다. Order creation 이벤트에 대한 연결 고리를 설정했지만받을 수는 있지만 들어오는 데이터의 의미에 대한 정보를 찾지 못했습니다. 내가 제어 할 수 있도록 order_id을 저장해야한다는 뜻입니다. order_number이라는 필드가 들어있는 테스트 훅을 받고 있습니다. 누구든지이 필드가 정확한 주문 ID임을 확인할 수 있습니까? 또한 나는 후크 id 분야에서 발생하고 있습니다하지만 난 그 필드가 이미 주문이 생성 될 때 다음, 당신은 주문 객체와 JSON을 받게됩니다 Order creation에 대한은 webhook를 만든 경우하지 order_idShopify 주문 ID 찾기

답변

0

hook_id 것 같다.

{ 
    "id": 820982911946154500, 
    "email": "[email protected]", 
    "closed_at": null, 
    "created_at": "2017-11-29T05:57:26-05:00", 
    "updated_at": "2017-11-29T05:57:26-05:00", 
    "number": 234, 
    "note": null, 
    "token": "123456abcd", 
    "gateway": null, 
    "test": true, 
    "total_price": "793.50", 
    "subtotal_price": "783.50", 
    "total_weight": 0, 
    "total_tax": "0.00", 
    "taxes_included": false, 
    "currency": "USD", 
    "financial_status": "voided", 
    "confirmed": false, 
    "total_discounts": "5.00", 
    "total_line_items_price": "788.50", 
    "cart_token": null, 
    "buyer_accepts_marketing": true, 
    "name": "#9999", 
    "referring_site": null, 
    "landing_site": null, 
    "cancelled_at": "2017-11-29T05:57:26-05:00", 
    "cancel_reason": "customer", 
    "total_price_usd": null, 
    "checkout_token": null, 
    "reference": null, 
    "user_id": null, 
    "location_id": null, 
    "source_identifier": null, 
    "source_url": null, 
    "processed_at": null, 
    "device_id": null, 
    "phone": null, 
    "customer_locale": "en", 
    "app_id": null, 
    "browser_ip": null, 
    "landing_site_ref": null, 
    "order_number": 1234, 
    "discount_codes": [], 
    "note_attributes": [], 
    "payment_gateway_names": [ 
     "visa", 
     "bogus" 
    ], 
    "processing_method": "", 
    "checkout_id": null, 
    "source_name": "web", 
    "fulfillment_status": "pending", 
    "tax_lines": [], 
    "tags": "", 
    "contact_email": "[email protected]", 
    "order_status_url": "https://checkout.shopify.com/24877298/orders/123456abcd/authenticate?key=abcdefg", 
    "line_items": [ 
     { 
      "id": 866550311766439000, 
      "variant_id": null, 
      "title": "Test Product Discount", 
      "quantity": 1, 
      "price": "99.50", 
      "grams": 0, 
      "sku": "", 
      "variant_title": null, 
      "vendor": null, 
      "fulfillment_service": "manual", 
      "product_id": 252236300325, 
      "requires_shipping": true, 
      "taxable": true, 
      "gift_card": false, 
      "name": "Test Product Discount", 
      "variant_inventory_management": null, 
      "properties": [], 
      "product_exists": true, 
      "fulfillable_quantity": 1, 
      "total_discount": "0.00", 
      "fulfillment_status": null, 
      "tax_lines": [] 
     }, 
     { 
      "id": 141249953214522980, 
      "variant_id": null, 
      "title": "ABSTRACT PENDANT, MULTI-COLOURED, ROSE GOLD PLATING", 
      "quantity": 1, 
      "price": "689.00", 
      "grams": 100, 
      "sku": "030711585240", 
      "variant_title": null, 
      "vendor": null, 
      "fulfillment_service": "manual", 
      "product_id": 252560506917, 
      "requires_shipping": true, 
      "taxable": true, 
      "gift_card": false, 
      "name": "ABSTRACT PENDANT, MULTI-COLOURED, ROSE GOLD PLATING", 
      "variant_inventory_management": null, 
      "properties": [], 
      "product_exists": true, 
      "fulfillable_quantity": 1, 
      "total_discount": "5.00", 
      "fulfillment_status": null, 
      "tax_lines": [] 
     } 
    ], 
    "shipping_lines": [ 
     { 
      "id": 271878346596884000, 
      "title": "Generic Shipping", 
      "price": "10.00", 
      "code": null, 
      "source": "shopify", 
      "phone": null, 
      "requested_fulfillment_service_id": null, 
      "delivery_category": null, 
      "carrier_identifier": null, 
      "discounted_price": "10.00", 
      "tax_lines": [] 
     } 
    ], 
    "billing_address": { 
     "first_name": "Bob", 
     "address1": "123 Billing Street", 
     "phone": "555-555-BILL", 
     "city": "Billtown", 
     "zip": "K2P0B0", 
     "province": "Kentucky", 
     "country": "United States", 
     "last_name": "Biller", 
     "address2": null, 
     "company": "My Company", 
     "latitude": null, 
     "longitude": null, 
     "name": "Bob Biller", 
     "country_code": "US", 
     "province_code": "KY" 
    }, 
    "shipping_address": { 
     "first_name": "Steve", 
     "address1": "123 Shipping Street", 
     "phone": "555-555-SHIP", 
     "city": "Shippington", 
     "zip": "40003", 
     "province": "Kentucky", 
     "country": "United States", 
     "last_name": "Shipper", 
     "address2": null, 
     "company": "Shipping Company", 
     "latitude": null, 
     "longitude": null, 
     "name": "Steve Shipper", 
     "country_code": "US", 
     "province_code": "KY" 
    }, 
    "fulfillments": [], 
    "refunds": [], 
    "customer": { 
     "id": 115310627314723950, 
     "email": "[email protected]", 
     "accepts_marketing": false, 
     "created_at": null, 
     "updated_at": null, 
     "first_name": "John", 
     "last_name": "Smith", 
     "orders_count": 0, 
     "state": "disabled", 
     "total_spent": "0.00", 
     "last_order_id": null, 
     "note": null, 
     "verified_email": true, 
     "multipass_identifier": null, 
     "tax_exempt": false, 
     "phone": null, 
     "tags": "", 
     "last_order_name": null, 
     "default_address": { 
      "id": 715243470612851200, 
      "customer_id": 115310627314723950, 
      "first_name": null, 
      "last_name": null, 
      "company": null, 
      "address1": "123 Elm St.", 
      "address2": null, 
      "city": "Ottawa", 
      "province": "Ontario", 
      "country": "Canada", 
      "zip": "K2H7A8", 
      "phone": "123-123-1234", 
      "name": "", 
      "province_code": "ON", 
      "country_code": "CA", 
      "country_name": "Canada", 
      "default": false 
     } 
    } 
} 
+0

그래, 난 정확한 당신이 제공하는 무엇을 수신 해요 :이 개체는이 JSON의 id 재산

예를 가지고있다. 귀하의 케이스에서 "820982911946154500"은 order_id입니까? 나는 이것이 hook_id라고 생각했다. –

+0

주문 ID이다. –