Skip to main content

Rimborsi

I rimborsi vengono gestiti da Flowlyze attraverso un Webhook di Shopify.

Le informazioni riguardanti il rimborso includono:

  • gli articoli rimborsati (RefundLineItems): dettagli sugli articoli restituiti.
  • le spedizioni rimborsate (RefundShippingLines): informazioni sulle spese di spedizione rimborsate.
  • le transazioni eseguite (Transactions): dati sulle transazioni di pagamento associate al rimborso.
  • l'ordine associato (Order).
  • il reso associato (Return): informazioni sul reso, se presente.
  • i dazi (Duties): eventuali dazi doganali rimborsati.

Viene recuperato l'URL dello shop a cui appartiene il rimborso (Shop), l'identificativo dell'ordine (OrderId), le informazioni relative al reso associato (Return) 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 aggiunge un tag all'ordine in modo da avere la possibilità di monitorare quanti rimborsi sono stati esportati (IPaaS Refunds Exported: #). Inoltre, si occupa di gestire l'invio delle informazioni ad un endpoint di NetSuite configurato per ricevere i dati sui rimborsi.

Configurazione del Flusso Rimborsi

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

CampoValoreNote
Resource Path/api/adp/shopify/egress/sync-refund-to-ns-apipath dell'adapter per il flusso dei rimborsi.
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
info

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 Refund create).
  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://yourShopName.myshopify.com/",
"OrderId": "gid://shopify/Order/6090290397491",
"Refund": {
"Id": "gid://shopify/Refund/973899563315",
"CreatedAt": "2024-10-15T12:58:16+00:00",
"UpdatedAt": "2024-10-15T12:58:16+00:00",
"Duties": [],
"LegacyResourceId": "973899563315",
"Note": null,
"RefundLineItems": {
"Nodes": [
{
"Id": "gid://shopify/RefundLineItem/593618305331",
"LineItem": {
"RequiresShipping": true,
"Taxable": true,
"IsGiftCard": false,
"Duties": [],
"TaxLines": [],
"Id": "gid://shopify/LineItem/15345811456307",
"Sku": "ABC0015-Black",
"Name": "ABC0015 Product - Black / One size",
"Quantity": 1,
"Title": "ABC0015 Product",
"VariantTitle": "Black / One size",
"Vendor": "Vendor",
"TotalDiscountSet": {
"ShopMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
}
},
"DiscountedUnitPriceAfterAllDiscountsSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"DiscountedTotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"OriginalTotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"OriginalUnitPriceSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"DiscountedUnitPriceSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"Product": {
"Id": "gid://shopify/Product/9320461205811"
},
"Variant": {
"Id": "gid://shopify/ProductVariant/49481263350067",
"SelectedOptions": [
{
"Name": "color",
"Value": "Black"
},
{
"Name": "size",
"Value": "One size"
}
],
"Barcode": null,
"Price": 200,
"CompareAtPrice": 200
},
"DiscountAllocations": [],
"CustomAttributes": []
},
"Location": {
"Id": "gid://shopify/Location/99130769715"
},
"PriceSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"Quantity": 1,
"Restocked": true,
"RestockType": "RETURN",
"SubtotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"TotalTaxSet": {
"ShopMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
}
}
}
],
"PageInfo": {
"HasNextPage": false,
"EndCursor": "eyJsYXN0X2lkIjo1OTM2MTgzMDUzMzEsImxhc3RfdmFsdWUiOjU5MzYxODMwNTMzMX0="
}
},
"RefundShippingLines": {
"Nodes": [],
"PageInfo": {
"HasNextPage": false,
"EndCursor": null
}
},
"TotalRefundedSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"Transactions": {
"Nodes": [
{
"AccountNumber": "•••• •••• •••• 1",
"AuthorizationExpiresAt": null,
"CreatedAt": "2024-10-15T12:58:16+00:00",
"Fees": [],
"FormattedGateway": "(For Testing) Bogus Gateway",
"ManuallyCapturable": false,
"MaximumRefundableV2": null,
"MultiCapturable": true,
"Order": {
"Id": "gid://shopify/Order/6090290397491",
"App": null,
"CustomAttributes": null,
"Metafield": null,
"Tags": null
},
"PaymentDetails": {
"Name": "Mario Rossi",
"ExpirationMonth": 12,
"ExpirationYear": 2025,
"PaymentMethodName": "card",
"Wallet": null,
"AvsResultCode": null,
"Bin": "1",
"CvvResultCode": null,
"Number": "•••• •••• •••• 1",
"Company": "Bogus"
},
"PaymentId": "#1036.3",
"SettlementCurrency": null,
"SettlementCurrencyRate": null,
"ShopifyPaymentsSet": null,
"Test": true,
"TotalUnsettledSet": {
"ShopMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
}
},
"AmountSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"AuthorizationCode": null,
"ProcessedAt": "2024-10-15T12:58:16Z",
"Status": "SUCCESS",
"ErrorCode": null,
"Gateway": "bogus",
"Id": "gid://shopify/OrderTransaction/7354863714611",
"Kind": "REFUND",
"ReceiptJson": "{\"paid_amount\":\"200.00\"}",
"ParentTransaction": {
"Id": "gid://shopify/OrderTransaction/7354787004723",
"AccountNumber": "•••• •••• •••• 1"
}
}
],
"PageInfo": {
"HasNextPage": false,
"EndCursor": "eyJsYXN0X2lkIjo3MzU0ODYzNzE0NjExLCJsYXN0X3ZhbHVlIjo3MzU0ODYzNzE0NjExfQ=="
}
},
"Order": {
"Id": "gid://shopify/Order/6090290397491",
"App": {
"Name": "Online Store",
"Id": "gid://shopify/App/580111"
},
"CustomAttributes": [
{
"Key": "orderSynced",
"Value": "TRUE"
}
],
"Metafield": {
"Id": "gid://shopify/Metafield/39108985159987",
"Key": "listOfRefundProcessed",
"Value": "[\"973899432243\"]",
"Namespace": "refundProcessed"
},
"Tags": [
"IPaaS Refunds Exported: 1"
]
},
"Return": {
"Id": "gid://shopify/Return/5781946675",
"Name": "#1036-R2",
"Status": "CLOSED",
"TotalQuantity": 1,
"Decline": null
},
"OrderAdjustments": {
"Nodes": [],
"PageInfo": {
"HasNextPage": false,
"EndCursor": null
}
}
},
"Return": {
"Id": "gid://shopify/Return/5781946675",
"Name": "#1036-R2",
"Status": "CLOSED",
"TotalQuantity": 1,
"Decline": null,
"Order": {
"Id": "gid://shopify/Order/6090290397491",
"App": {
"Name": "Online Store",
"Id": "gid://shopify/App/580111"
},
"Metafield": null,
"Tags": [
"IPaaS Refunds Exported: 4"
]
},
"ReturnLineItems": {
"Nodes": [
{
"Id": "gid://shopify/ReturnLineItem/10342203699",
"Quantity": 1,
"CustomerNote": null,
"RefundableQuantity": 0,
"RefundedQuantity": 1,
"ReturnReason": "UNKNOWN",
"ReturnReasonNote": "",
"RestockingFee": null,
"FulfillmentLineItem": {
"Id": "gid://shopify/FulfillmentLineItem/13212864905523",
"LineItem": {
"RequiresShipping": true,
"Taxable": true,
"IsGiftCard": false,
"Duties": [],
"TaxLines": [],
"Id": "gid://shopify/LineItem/15345811456307",
"Sku": "ABC0015-Black",
"Name": "ABC0015 Product - Black / One size",
"Quantity": 1,
"Title": "ABC0015 Product",
"VariantTitle": "Black / One size",
"Vendor": "Vendor",
"TotalDiscountSet": {
"ShopMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
}
},
"DiscountedUnitPriceAfterAllDiscountsSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"DiscountedTotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"OriginalTotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"OriginalUnitPriceSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"DiscountedUnitPriceSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"Product": {
"Id": "gid://shopify/Product/9320461205811"
},
"Variant": {
"Id": "gid://shopify/ProductVariant/49481263350067",
"SelectedOptions": [
{
"Name": "color",
"Value": "Black"
},
{
"Name": "size",
"Value": "One size"
}
],
"Barcode": null,
"Price": 200,
"CompareAtPrice": 200
},
"DiscountAllocations": [],
"CustomAttributes": []
},
"Quantity": 1,
"OriginalTotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"DiscountedTotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
}
}
}
],
"PageInfo": {
"HasNextPage": false,
"EndCursor": "eyJsYXN0X2lkIjoxMDM0MjIwMzY5OSwibGFzdF92YWx1ZSI6IjEwMzQyMjAzNjk5In0="
}
},
"ExchangeLineItems": {
"Nodes": [],
"PageInfo": {
"HasNextPage": false,
"EndCursor": null
}
},
"ReturnShippingFees": [],
"ReverseFulfillmentOrders": {
"Nodes": [
{
"Id": "gid://shopify/ReverseFulfillmentOrder/5489066291",
"Status": "OPEN",
"LineItems": {
"Nodes": [
{
"Id": "gid://shopify/ReverseFulfillmentOrderLineItem/9709125939",
"Dispositions": [
{
"Id": "gid://shopify/ReverseFulfillmentOrderDisposition/561447219",
"Location": {
"Id": "gid://shopify/Location/99130769715"
},
"Quantity": 1,
"Type": "RESTOCKED"
}
],
"FulfillmentLineItem": {
"Id": "gid://shopify/FulfillmentLineItem/13212864905523",
"LineItem": {
"RequiresShipping": true,
"Taxable": true,
"IsGiftCard": false,
"Duties": [],
"TaxLines": [],
"Id": "gid://shopify/LineItem/15345811456307",
"Sku": "ABC0015-Black",
"Name": "ABC0015 Product - Black / One size",
"Quantity": 1,
"Title": "ABC0015 Product",
"VariantTitle": "Black / One size",
"Vendor": "Vendor",
"TotalDiscountSet": {
"ShopMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 0,
"CurrencyCode": "EUR"
}
},
"DiscountedUnitPriceAfterAllDiscountsSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"DiscountedTotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"OriginalTotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"OriginalUnitPriceSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"DiscountedUnitPriceSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"Product": {
"Id": "gid://shopify/Product/9320461205811"
},
"Variant": {
"Id": "gid://shopify/ProductVariant/49481263350067",
"SelectedOptions": [
{
"Name": "color",
"Value": "Black"
},
{
"Name": "size",
"Value": "One size"
}
],
"Barcode": null,
"Price": 200,
"CompareAtPrice": 200
},
"DiscountAllocations": [],
"CustomAttributes": []
},
"Quantity": 1,
"OriginalTotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"DiscountedTotalSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
}
},
"TotalQuantity": 1
}
],
"PageInfo": {
"HasNextPage": false,
"EndCursor": "eyJsYXN0X2lkIjo5NzA5MTI1OTM5LCJsYXN0X3ZhbHVlIjoiOTcwOTEyNTkzOSJ9"
}
},
"ReverseDeliveries": {
"Nodes": [],
"PageInfo": {
"HasNextPage": false,
"EndCursor": null
}
},
"ThirdPartyConfirmation": null
}
],
"PageInfo": {
"HasNextPage": false,
"EndCursor": "eyJsYXN0X2lkIjo1NDg5MDY2MjkxLCJsYXN0X3ZhbHVlIjoiNTQ4OTA2NjI5MSJ9"
}
}
},
"Transactions": [
{
"AmountSet": {
"ShopMoney": {
"Amount": 241,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 241,
"CurrencyCode": "EUR"
}
},
"AuthorizationCode": null,
"ProcessedAt": "2024-10-15T12:56:53Z",
"Status": "SUCCESS",
"ErrorCode": null,
"Gateway": "bogus",
"Id": "gid://shopify/OrderTransaction/7354862534963",
"Kind": "REFUND",
"ReceiptJson": "{\"paid_amount\":\"241.00\"}",
"ParentTransaction": {
"Id": "gid://shopify/OrderTransaction/7354787004723",
"AccountNumber": null
},
"PaymentDetails": {
"AvsResultCode": null,
"Bin": "1",
"CvvResultCode": null,
"Number": "•••• •••• •••• 1",
"Company": "Bogus"
}
},
{
"AmountSet": {
"ShopMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
},
"PresentmentMoney": {
"Amount": 200,
"CurrencyCode": "EUR"
}
},
"AuthorizationCode": null,
"ProcessedAt": "2024-10-15T12:58:16Z",
"Status": "SUCCESS",
"ErrorCode": null,
"Gateway": "bogus",
"Id": "gid://shopify/OrderTransaction/7354863714611",
"Kind": "REFUND",
"ReceiptJson": "{\"paid_amount\":\"200.00\"}",
"ParentTransaction": {
"Id": "gid://shopify/OrderTransaction/7354787004723",
"AccountNumber": null
},
"PaymentDetails": {
"AvsResultCode": null,
"Bin": "1",
"CvvResultCode": null,
"Number": "•••• •••• •••• 1",
"Company": "Bogus"
}
}
]
}