Passa al contenuto principale

Cambio merce

I cambi merce vengono gestiti da Flowlyze attraverso un Webhook di Shopify.

Viene recuperato l'URL dello shop a cui appartiene il rimborso (Shop), l'identificativo dell'ordine (OrderId), tutti i fulfillment presenti nell'ordine (Fulfillments) e tutte le transazioni (Transactions) che sono state effettuate sull'ordine fino a quel momento ad eccezione della prima, ovvero quella che fa riferimento alla vendita iniziale.

L'Adapter si occupa di gestire l'invio delle informazioni ad un endpoint di NetSuite configurato per ricevere i dati sui cambi merce.

Configurazione del Flusso Cambio Merce

Oltre alla configurazione base del flusso dati, è necessario aggiungere le seguenti impostazioni nei Settings Override della destinazione:

CampoValoreNote
Base Urlhttps://adapt.flowlyze.comurl degli adapter
Resource Path/api/adp/shopify/egress/sync-exchange-to-ns-apipath dell'adapter per il flusso dei cambi merce.
Headers :: x-api-key**********api key di verifica interazione endpoint
Headers :: x-shopify-graphql-urlhttps://SHOPIFYURL.myshopify.com/url dello shopify con cui connettersi
Headers :: x-shopify-access-tokenshpat_CODICEALFANUMERICOsecret della custom app creata per l'integrazione
Headers :: x-ns-api-urlURL dell'API di NetSuiteURL dell'API di NetSuite a cui inviare i dati relativi al rimborso.
Headers :: x-ns-consumer-keyConsumer KeyValore della consumer key generata per NetSuite
Headers :: x-ns-consumer-secretConsumer SecretValore del consumer secret generato per NetSuite
Headers :: x-ns-token-idAccess Token IdToken di accesso per NetSuite
Headers :: x-ns-token-secretToken SecretToken secret generato per NetSuite
Headers :: x-ns-account-idAccount IdL'Id dell'account (Realm) per NetSuite
informazioni

Come configurare il Webhook su Shopify

  1. Vai alla sezione Settings nel pannello di amministrazione del tuo Shopify.
  2. Seleziona Notifications dal menu a sinistra.
  3. Seleziona la sezione Webhooks.
  4. Clicca su Create Webhook.
  5. Scegli l'evento per cui vuoi ricevere la notifica (es. per questo flusso è necessario selezionare Fulfillment creation).
  6. Seleziona il formato (es. Json).
  7. Inserisci l'url in cui riceverai le notifiche (es. per questo flusso l'url del flusso di Flowlyze).
  8. Seleziona la versione dell'api 'Webhook API version' (es. 2024-10)

Per maggiori informazioni, visita la documentazione ufficiale di Shopify per la creazione di Webhook.

Esempio delle informazioni recuperate

{
"Shop": "https://demoipaas.myshopify.com/",
"OrderId": "gid://shopify/Order/6092762644787",
"Fulfillments": [
{
"Id": "gid://shopify/Fulfillment/5383304970547",
"Name": "#1037-F2",
"Status": "SUCCESS",
"CreatedAt": "2024-10-17T14:52:21+00:00",
"UpdatedAt": "2024-10-17T14:52:21+00:00",
"DeliveredAt": null,
"DisplayStatus": "FULFILLED",
"EstimatedDeliveryAt": null,
"TrackingInfo": [],
"TotalQuantity": 1,
"Location": {
"Id": "gid://shopify/Location/99130769715"
},
"FulfillmentLineItems": {
"Nodes": [
{
"Id": "gid://shopify/FulfillmentLineItem/13217186021683",
"LineItem": {
"RequiresShipping": false,
"Taxable": false,
"IsGiftCard": false,
"Duties": null,
"TaxLines": [],
"Id": "gid://shopify/LineItem/15350206005555",
"Sku": "0135DB",
"Name": "6 Panel Linear Logo Strapback - Darkblue",
"Quantity": 1,
"Title": "6 Panel Linear Logo Strapback",
"VariantTitle": "Darkblue",
"Vendor": "51",
"TotalDiscountSet": {
"ShopMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
}
},
"DiscountedUnitPriceAfterAllDiscountsSet": {
"ShopMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
}
},
"DiscountedTotalSet": {
"ShopMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
}
},
"OriginalTotalSet": {
"ShopMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
}
},
"OriginalUnitPriceSet": {
"ShopMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
}
},
"DiscountedUnitPriceSet": {
"ShopMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
}
},
"Product": {
"Id": "gid://shopify/Product/9325820576051"
},
"Variant": {
"Id": "gid://shopify/ProductVariant/49503958106419",
"SelectedOptions": [
{
"Name": "color",
"Value": "Darkblue"
}
],
"Barcode": "5423930393432",
"Price": 185,
"CompareAtPrice": 185
},
"DiscountAllocations": [],
"CustomAttributes": []
},
"Quantity": 1,
"OriginalTotalSet": {
"ShopMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
}
},
"DiscountedTotalSet": {
"ShopMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 185,
"CurrencyCode": "EUR"
}
}
}
],
"PageInfo": {
"HasNextPage": false,
"EndCursor": "eyJsYXN0X2lkIjoxMzIxNzE4NjAyMTY4MywibGFzdF92YWx1ZSI6MTMyMTcxODYwMjE2ODN9"
}
}
},
{
"Id": "gid://shopify/Fulfillment/5383302316339",
"Name": "#1037-F1",
"Status": "SUCCESS",
"CreatedAt": "2024-10-17T14:50:57+00:00",
"UpdatedAt": "2024-10-17T14:50:57+00:00",
"DeliveredAt": null,
"DisplayStatus": "FULFILLED",
"EstimatedDeliveryAt": null,
"TrackingInfo": [],
"TotalQuantity": 1,
"Location": {
"Id": "gid://shopify/Location/99130769715"
},
"FulfillmentLineItems": {
"Nodes": [
{
"Id": "gid://shopify/FulfillmentLineItem/13217182482739",
"LineItem": {
"RequiresShipping": false,
"Taxable": false,
"IsGiftCard": false,
"Duties": null,
"TaxLines": [],
"Id": "gid://shopify/LineItem/15350204105011",
"Sku": "0135DL",
"Name": "6 Panel Linear Logo Strapback - Darkviolet",
"Quantity": 1,
"Title": "6 Panel Linear Logo Strapback",
"VariantTitle": "Darkviolet",
"Vendor": "51",
"TotalDiscountSet": {
"ShopMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
}
},
"DiscountedUnitPriceAfterAllDiscountsSet": {
"ShopMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
}
},
"DiscountedTotalSet": {
"ShopMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
}
},
"OriginalTotalSet": {
"ShopMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
}
},
"OriginalUnitPriceSet": {
"ShopMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
}
},
"DiscountedUnitPriceSet": {
"ShopMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
}
},
"Product": {
"Id": "gid://shopify/Product/9325820576051"
},
"Variant": {
"Id": "gid://shopify/ProductVariant/49503958171955",
"SelectedOptions": [
{
"Name": "color",
"Value": "Darkviolet"
}
],
"Barcode": "0426728871870",
"Price": 39.9,
"CompareAtPrice": null
},
"DiscountAllocations": [],
"CustomAttributes": []
},
"Quantity": 1,
"OriginalTotalSet": {
"ShopMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
}
},
"DiscountedTotalSet": {
"ShopMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 39.9,
"CurrencyCode": "EUR"
}
}
}
],
"PageInfo": {
"HasNextPage": false,
"EndCursor": "eyJsYXN0X2lkIjoxMzIxNzE4MjQ4MjczOSwibGFzdF92YWx1ZSI6MTMyMTcxODI0ODI3Mzl9"
}
}
}
],
"Transactions": [
{
"AmountSet": {
"ShopMoney": {
"Amount": 145.1,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 145.1,
"CurrencyCode": "EUR"
}
},
"AuthorizationCode": null,
"ProcessedAt": "2024-10-17T14:52:03Z",
"Status": "SUCCESS",
"ErrorCode": null,
"Gateway": "manual",
"Id": "gid://shopify/OrderTransaction/7358143070515",
"Kind": "SALE",
"ReceiptJson": "{}",
"ParentTransaction": null,
"PaymentDetails": null
}
]
}