Shopify Orders to SAP Business One Sales Orders
First published on: 10/19/2023/10:16 am
Workflow Summary
- This workflow integrates all open orders in Shopify into SAP Business One, including taxes and discounts.
- Documents created in SAP Business One include sales orders, down payment invoices, and incoming payments.
- If required, individual SAP Business One business partner records can be created, including shipping and billing addresses.
- Custom data mappings can be implemented.
Workflow Description
A scheduled job will call Shopify at regular intervals (configurable) to retrieve any newly created orders since the last job run.
The import process will create the sales order in SAP Business One, along with a down payment invoice and incoming payment for a specified business partner. (The business partner will be defined based on the configuration explained in the business partner section below.)
Workflow Diagram
Mapping
Shopify Order Field |
SAP Business One Sales Order Field |
Comments |
---|---|---|
Header |
|
|
created_at |
ORDR.DocDate |
|
created_at |
ORDR.DocDueDate |
|
|
ORDR.CardCode |
Business Partner card code defined in the Business Partner section. |
order_number |
ORDR.NumAtCard |
|
id |
ORDR.U_V33SB_EXTERNALORDERID |
|
|
ORDR.U_V33SB_EXTERNALORDERSRC |
“Shopify” |
Lines |
|
|
line_items.sku |
RDR1.ItemCode |
|
line_items.quantity |
RDR1.Quantity |
|
line_items.price |
RDR1.UnitPrice |
|
line_items.price |
RDR1.Price |
|
|
RDR1.TaxCode |
“Exempt” |
line_items.id |
RDR1.U_V33SB_EXTERNALLINEID |
|
Expenses (Tax and Freight) |
|
|
|
RDR3.ExpnsCode |
‘ShopifyTax’ code |
total_tax |
RDR3.LineTotal |
|
|
RDR3.TaxCode |
“Exempt” |
|
RDR3.ExpnsCode |
‘ShopifyFreight’ code |
shipping_lines.price |
RDR3.LineTotal |
|
|
RDR3.TaxCode |
“Exempt” |
|
RDR3.ExpnsCode |
‘ShopifyDiscount’ code |
total_discounts |
RDR3.LineTotal |
|
|
RDR3.TaxCode |
“Exempt” |
Addresses |
|
|
billing_address.address1 |
RDR12.StreetB |
|
billing_address.address2 |
RDR12.Address3B |
|
billing_address.first_name + billing_address.last_name |
RDR12.Address3B |
|
billing_address.city |
RDR12.CityB |
|
billing_address.zip |
RDR12.ZipCodeB |
|
billing_address.province_code |
RDR12.StateB |
|
billing_address.country_code |
RDR12.CountryB |
|
shipping_address.address1 |
RDR12.StreetS |
|
shipping_address.address2 |
RDR12.Address2S |
|
shipping_address.first_name + shipping_address.last_name |
RDR12.Address3S |
|
shipping_address.city |
RDR12.CityS |
|
shipping_address.zip |
RDR12.ZipCodeS |
|
shipping_address.province_code |
RDR12.StateS |
|
shipping_address.country_code |
RDR12.CountryS |
|
Assumptions
- The starter workflow will retrieve all Shopify orders with a "process" order status.
- The expense codes ‘ShopifyTax’, ‘ShopifyFreight’, and ‘ShopifyDiscount’ will be created by the Saltbox validation workflow.
- The ‘Exempt’ tax code will be created by the Saltbox validation workflow.
- Incoming payment account info will be defaulted automatically
- It can be changed to a bank transfer payment mode.
- The business partner card code can be hard coded.
Optional Workflows
Creating a New Business Partner in SAP Business One
A business partner can be created as part of the order workflow process.
This action will be executed if the Shopify customer doesn't exist in SAP Business One and there's no default SAP Business One card code set for the workflow.
If a default SAP Business One card code is set in the workflow, it will be used as the card code for the sales order, down payment invoice, and incoming payment. This will be used if the customer in the Shopify order isn't found in the SAP Business One business partner master data.
Mapping
Shopify Order Field |
SAP Business One Business Partner Field |
Hardcoded Values/Comments |
---|---|---|
customer.id |
OCRD.U_V33SB_EXTBPID |
|
|
OCRD.CardType |
cCustomer |
|
OCRD.CardCode |
S + customer.id |
|
OCRD.CardName |
(customer.first_name + customer.last_name) |
customer.email |
OCRD.E_mail |
|
|
CRD1.Address |
“Bill To” |
billing_address.address1 |
CRD1.Street |
|
billing_address.zip |
CRD1.ZipCode |
|
billing_address.city |
CRD1.City |
|
billing_address.country |
CRD1.Country |
|
billing_address.providence_code |
CRD1.State |
|
|
CRD1.AdresType |
B |
|
CRD1.Address |
“Ship To” |
shipping_address.address1 |
CRD1.Street |
|
shipping_address.zip |
CRD1.ZipCode |
|
shipping_address.city |
CRD1.City |
|
shipping_address.country |
CRD1.Country |
|
shipping_address.providence_code |
CRD1.State |
|
|
CRD1.AdresType |
S |
Adding a Down Payment Invoice Action
Down payment invoices will be created as part of the order workflow process.
Mapping
Shopify Order Field |
SAP Business One Down Payment Field |
Comments |
---|---|---|
Header |
|
|
created_at |
ODPI.DocDate |
|
created_at |
ODPI.DocDueDate |
|
|
ODPI.CardCode |
Order BP |
|
ORCT.DocType |
“rCustomer” |
total_price |
ODPI .DocTotal |
|
Lines |
|
|
|
DPI1.BaseType |
“17” |
|
DPI1.BaseEntry |
Order DocEntry |
|
DPI1.BaseLine |
Order Line Number |
Adding an Incoming Payment Action
Incoming payments will be created as part of the order workflow process.
The incoming payment will be created against the down payment invoice created in the previous step.
Mapping - Bank Transfers
Shopify Order/Payment Details Field |
SAP Business One Incoming Payment Field |
Comments |
---|---|---|
Payments |
|
|
created_at |
ORCT.DocDate |
|
|
ORCT.DocType |
“rCustomer” |
|
ORCT.CardCode |
Order BP |
|
ORCT.TrsfrAcct |
To be supplied |
total_price |
ORCT.TrsfrSum |
|
created_at |
ORCT.TrsfrDate |
|
Payments_Invoices |
|
|
|
RCT2.InvType |
“203” – “it_DownPayment” |
|
RCT2.DocEntry |
DP DocEntry |
total_price |
RCT2.SumApplied |
|
Mapping - Credit Card Payments
Shopify Orders/Payment Details Field |
SAP Business One Incoming Payment Field |
Comments |
---|---|---|
Payments Header |
|
|
created_at |
ORCT.DocDate |
|
|
ORCT.DocType |
“rCustomer” |
|
ORCT.CardCode |
Order BP |
Payments_Invoices |
|
|
|
RCT2.InvType |
“203” – “it_DownPayment” |
|
RCT2.DocEntry |
DP DocEntry |
Payments_CreditCards Lines |
|
|
credit_card_company |
RCT3.CreditCard |
Result of query GetCreditCardCode |
credit_card_company |
RCT3.CrTypeCode |
Result of query GetCCPaymentMethodCode |
credit_card_number |
RCT3.CrCardNum |
Last 4 digits of credit_card_number |
transaction_id |
RCT3.VoucherNum |
|
transactions.amount |
RCT3.CreditSum |
|
Last modified: 11/15/2023/8:23 pm |