{"title":"Codeunit 30159 Shpfy Draft Orders API, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/30159-shpfy-draft-orders-api/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"codeunit","id":30159,"name":"Shpfy Draft Orders API","app":"Shopify Connector","url":"https://jonas-paprotka.de/ref/codeunit/30159-shpfy-draft-orders-api/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/30159-shpfy-draft-orders-api/source/","path":"src/Apps/W1/Shopify/App/src/Invoicing/Codeunits/ShpfyDraftOrdersAPI.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"codeunit:30103":{"name":"Shpfy Communication Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/30103-shpfy-communication-mgt/"},"codeunit:30157":{"name":"Shpfy Json Helper","url":"https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/"},"table:30102":{"name":"Shpfy Shop","url":"https://jonas-paprotka.de/ref/table/30102-shpfy-shop/"}},"procs":[{"name":"CreateDraftOrder","line":31,"kind":"procedure","access":"internal","params":3,"steps":[[40,"call","CreateDraftOrderGQLRequest",3],[41,"call","SendDraftOrderGraphQLRequest",1]]},{"name":"CompleteDraftOrder","line":50,"kind":"procedure","access":"internal","params":1,"steps":[[58,"ext","codeunit",30103,"ExecuteGraphQL",2]]},{"name":"SetShop","line":66,"kind":"procedure","access":"internal","params":1,"steps":[[70,"ext","codeunit",30103,"SetShop",1]]},{"name":"CreateDraftOrderGQLRequest","line":73,"kind":"procedure","access":"local","params":3,"steps":[[83,"call","AddFieldToGraphQuery",4],[85,"call","AddFieldToGraphQuery",4],[87,"call","AddFieldToGraphQuery",4],[87,"call","GetISOCode",1],[90,"call","AddDiscountAmountToGraphQuery",3],[94,"call","AddShippingAddressToGraphQuery",2],[95,"call","AddBillingAddressToGraphQuery",2],[96,"call","AddNote",2],[98,"call","AddPaymentTerms",2],[100,"call","AddLineItemsToGraphQuery",4]]},{"name":"SendDraftOrderGraphQLRequest","line":108,"kind":"procedure","access":"local","params":1,"steps":[[113,"ext","codeunit",30103,"ExecuteGraphQL",1],[114,"ext","codeunit",30157,"GetValueAsBigInteger",2]]},{"name":"AddShippingAddressToGraphQuery","line":118,"kind":"procedure","access":"local","params":2,"steps":[[122,"call","AddFieldToGraphQuery",4],[124,"call","AddFieldToGraphQuery",4],[126,"call","AddFieldToGraphQuery",4],[128,"call","AddFieldToGraphQuery",4],[130,"call","AddFieldToGraphQuery",4],[132,"call","AddFieldToGraphQuery",4],[134,"call","AddFieldToGraphQuery",4]]},{"name":"AddBillingAddressToGraphQuery","line":139,"kind":"procedure","access":"local","params":2,"steps":[[143,"call","AddFieldToGraphQuery",4],[145,"call","AddFieldToGraphQuery",4],[147,"call","AddFieldToGraphQuery",4],[149,"call","AddFieldToGraphQuery",4],[151,"call","AddFieldToGraphQuery",4],[153,"call","AddFieldToGraphQuery",4],[155,"call","AddFieldToGraphQuery",4]]},{"name":"AddLineItemsToGraphQuery","line":160,"kind":"procedure","access":"local","params":4,"steps":[[175,"ext","codeunit",30103,"EscapeGraphQLData",1],[182,"call","GetISOCode",1],[187,"ext","table",30102,"GetShopWeightUnit",0],[188,"write",30102,"Modify"],[197,"ext","codeunit",30103,"EscapeGraphQLData",1],[204,"call","GetISOCode",1]]},{"name":"AddDiscountAmountToGraphQuery","line":212,"kind":"procedure","access":"local","params":3,"steps":[[216,"ext","codeunit",30103,"EscapeGraphQLData",1],[226,"ext","codeunit",30103,"EscapeGraphQLData",1]]},{"name":"AddPaymentTerms","line":250,"kind":"procedure","access":"local","params":2,"steps":[[257,"call","ShopifyPaymentTermsExists",3],[271,"ext","codeunit",30103,"EscapeGraphQLData",1],[276,"ext","codeunit",30103,"EscapeGraphQLData",1]]},{"name":"AddFieldToGraphQuery","line":315,"kind":"procedure","access":"local","params":4,"steps":[[322,"ext","codeunit",30103,"EscapeGraphQLData",1]]}]}