**Workflow**

**Register Account:**
- User should get registered with thier email in fedex.eshipz.com
- Once user login, go to settings -> Integrations -> Sales Channels
- Select salla integration, enter merchant ID in the given input field
- Merchant ID is used to identify the user and his licence key
**Authorization:**
- FedEx platfrom uses oAuth flow to authorize users
- Requested scopes are
- Basic Information
- Products
- Webhooks
- Shipping
- Once user approves FedEx shipping app, FedEx backend will receive "app.store.authorize" event to FedEx backend
- "app.store.authorize" event will have "access_token", "refersh_token" and expiry time.
- Since user is already registered with fedex.eshipz.com those "access_token" and "refresh_token" will be mapped to that record
**Syncing Orders:**
- As soon as customer creates an orders webhook is triggered by salla platfrom, FedEx backend will receive trigger and map orders data to eShipz template
- Orders will be mapped in such a way it's easy to generate label with all the necessary information.
**Creating Shipment:**
- Once Merchant clicks on issuing the policy/إصدار البوليصة on the order, salla will tigger shipment.creating/shipment.created event
- Once FedEx backend receives event, shipment is created by FedEx shimpent api using the licence key entered by the Merchant.
**Shipment Pricing:**
- In Salla shipment pricing is static and it should be handeld by the one who's managing the FedEx application
- Users can define pricing based on the country and city
- Pricing contract with the user will no longer be valid as dynamic pricing is not supported by Salla platform