> For the complete documentation index, see [llms.txt](https://docs.rishvi.co.uk/linnworks/llms.txt).
> Use it to discover all available pages before exploring further.

# Assign Payment Method by Subsource

Automatically assign payment methods to selected Linnworks orders based on matching order source and subsource values.

Manually updating payment methods across orders can be time-consuming, especially when different sales channels or marketplace subsources require specific payment method values. The *Assign Payment Method by Subsource* macro helps automate this process by checking selected orders against configured source and subsource rules, then assigning the correct payment method where a match is found.

This macro processes the selected orders, compares each order’s source and subsource with the configured values, identifies the matching payment method, and updates the order totals information automatically.

With this automated approach, your team can reduce manual order edits, improve payment data consistency, and ensure orders are assigned the correct payment method based on their sales channel details.

> Automatically assign the correct payment method to selected orders based on source and subsource matching rules.

## **Configure the Macro**

Once the app is installed, you need to set up the macro configuration so the system knows which orders to process, which sources and subsources to check, and which payment methods should be applied.

This configuration can be updated anytime if your channel mapping or payment method rules change.

### **Steps to Configure**

<Tabs>
  <Tab title="Step 1">
    **Go to Apps > Macro Configuration and click + Add new configuration.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779107390560-tzzvrxbk63c-pasted-image-1779107386490.png?fm=auto&auto=compress%2Cformat" width="1368" height="568" alt="" priority={true} fetchPriority="high" />
  </Tab>

  <Tab title="Step 2">
    **Select the Assign Payment Method macro and click Create Configuration.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779108901961-uk09rdk2ltb-pasted-image-1779108897329.png?fm=auto&auto=compress%2Cformat" width="1026" height="454" alt="" priority={true} fetchPriority="high" />

    This creates a new configuration where you can define the required parameters and schedule settings.
  </Tab>

  <Tab title="Step 3">
    **In the Macro Configuration screen, add the configuration name and parameter values.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779108971005-s2i02gc1bbl-pasted-image-1779108966376.png?fm=auto&auto=compress%2Cformat" width="602" height="521" alt="" />
  </Tab>

  <Tab title="Step 4">
    **Make sure to enable the macro to continue with the Rule Engine configuration.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779109118677-y6f84qp6ug8-pasted-image-1779109115212.png?fm=auto&auto=compress%2Cformat" width="1271" height="24" alt="" style="width: 1271px; height: auto; cursor: pointer;" />
  </Tab>

  <Tab title="Step 5">
    **Go to Orders > Rules engine and click + Add new rule.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779109174645-64djusrcpwk-pasted-image-1779109170592.png?fm=auto&auto=compress%2Cformat" width="1536" height="680" alt="" />
  </Tab>

  <Tab title="Step 6">
    **Enter the rule name and click Create.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779109357142-ev19yeux3ji-pasted-image-1779109352324.png?fm=auto&auto=compress%2Cformat" width="266" height="161" alt="" style="width: 266px; height: auto; cursor: pointer; margin: 0 auto;" />
  </Tab>

  <Tab title="Step 7">
    **Click Add new, select Condition, set the condition as required, and save it.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779109431730-gpm6hmkp56l-pasted-image-1779109426880.png?fm=auto&auto=compress%2Cformat" width="1536" height="358" alt="" />

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779110939722-ivausb025l-pasted-image-1779110935404.png?fm=auto&auto=compress%2Cformat" width="536" height="300" alt="" style="width: 536px; height: auto; cursor: pointer; margin: 0 auto;" />
  </Tab>

  <Tab title="Step 8">
  **Add the macro action and click Save.**

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779109895316-v8xbkxclo2-pasted-image-1779109891074.png?fm=auto&auto=compress%2Cformat" width="1536" height="296" alt="" style="width: 1536px; height: auto; cursor: pointer; margin: 0 auto;" />

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779110897607-xivydk20ex-pasted-image-1779110894128.png?fm=auto&auto=compress%2Cformat" width="546" height="223" alt="" style="width: 546px; height: auto; cursor: pointer; margin: 0 auto;" />
  </Tab>

  <Tab title="Step 9">
    Review the saved rule setup.

    <Image src="https://blob-cdn.documentation.ai/org-87fb0951-1e07-4f5d-a887-8a7327c7777d/doc-98941d2e-0032-424f-8414-3034ac5fa6ee/1779110394170-31js9q4j1ms-pasted-image-1779110390052.png?fm=auto&auto=compress%2Cformat" width="1314" height="576" alt="" />

    Verify the condition and action are connected correctly

    Click Save in the bottom-right corner to save the rule
  </Tab>
</Tabs>

## **Key Benefits**

Assigning payment methods manually can lead to inconsistent order data and additional operational work. This macro helps standardise payment method assignment using configured source and subsource rules.

<Columns cols="2">
  <Card title="Automate Payment Assignment" icon="alarm-check" horizontal="false" target="_self">
    Automatically updates the payment method on selected orders when the configured source and subsource match.
  </Card>

  <Card title="Reduce Manual Order Edits" icon="boxes" horizontal="false" target="_self">
    Removes the need to manually open each order and change the payment method one by one.
  </Card>

  <Card title="Improve Payment Data Accuracy" icon="bell" horizontal="false" target="_self">
    Helps ensure orders from specific channels or subsources use the correct payment method.
  </Card>

  <Card title="Support Multi-Channel Rules" icon="bar-chart-big-icon" horizontal="false" target="_self">
    Allows multiple source, subsource, and payment method combinations to be configured using comma-separated values.
  </Card>

  <Card title="Save Operational Time" icon="lucide-fast-forward" horizontal="false" target="_self">
    Quickly applies payment method updates across multiple selected orders in a single macro run.
  </Card>

  <Card title="Log Processing Activity" icon="lucide-message-circle-x" horizontal="false" target="_self">
    Logs macro start, processed order numbers, errors, and completion for easier tracking.
  </Card>
</Columns>

### How It Works

The macro checks each selected order and compares its source and subsource against the configured mapping list. If a match is found, it assigns the corresponding payment method.

<Steps>
  <Step title="Step 1" icon="airplay-icon" title-type="p">
    The macro starts execution and writes **Macro started** to the log.
  </Step>

  <Step title="Step 2" icon="airplay-icon" title-type="p">
    It retrieves all available Linnworks payment methods using the Orders API.
  </Step>

  <Step title="Step 3" icon="airplay-icon" title-type="p">
    The macro splits the configured **Source**, **SubSource**, and **PaymentMethods** values into separate lists.
  </Step>

  <Step title="Step 4" icon="airplay-icon" title-type="p">
    It loops through each selected order ID provided in the **OrderIds** parameter.
  </Step>

  <Step title="Step 5" icon="airplay-icon" title-type="p">
    For each order, the macro retrieves the order details and logs the Linnworks order number.
  </Step>

  <Step title="Step 6" icon="airplay-icon" title-type="p">
    It checks whether the order source and subsource match one of the configured source and subsource pairs.
  </Step>

  <Step title="Step 7" icon="airplay-icon" title-type="p">
    When a match is found, the macro finds the configured payment method by name.
  </Step>

  <Step title="Step 8" icon="airplay-icon" title-type="p">
    The macro updates the order payment method ID and payment method name in the order totals information.
  </Step>

  <Step title="Step 9" icon="airplay-icon" title-type="p">
    The updated totals information is saved back to the order using **SetOrderTotalsInfo**.
  </Step>
</Steps>

### **Usage of App**

This macro is designed to update selected Linnworks orders based on source and subsource mapping rules. It is useful when different marketplaces, channels, or subsources require specific payment method values.

<Card title="OrderIds" horizontal="false" target="_self">
  Defines the selected Linnworks order IDs that should be processed by the macro.
</Card>

<Card title="Source" horizontal="false" target="_self">
  Defines one or more order source values to check. Multiple values should be entered as comma-separated values.
</Card>

<Card title="SubSource" horizontal="false" target="_self">
  Defines one or more order subsource values to check. Each value must align with the matching source value by position.
</Card>

<Card title="PaymentMethods" horizontal="false" target="_self">
  Defines one or more Linnworks payment method names to assign. Each value must align with the matching source and subsource by position.
</Card>

<Card title="Mapping Logic" horizontal="false" target="_self">
  The first Source value maps to the first SubSource value and the first PaymentMethods value. The second value maps to the second value, and so on.
</Card>

<Card title="Order Update Behaviour" horizontal="false" target="_self">
  Orders are updated only when their source and subsource match a configured pair and the payment method exists in Linnworks.
</Card>

### **Key Points to Remember**

- The macro processes only the orders included in **OrderIds**

- **Source**, **SubSource**, and **PaymentMethods** must be comma-separated lists

- Values are matched by their position in each list

- Payment method names must already exist in Linnworks

- Source and subsource values must match the order values exactly after trimming configured values

- If no matching rule is found, the order is not updated

- If the payment method name is not found, the order is not updated for that rule

Once configured correctly, the macro helps keep payment method assignment consistent across selected orders.

### **What You Can Expect**

- **Selected orders are checked automatically**\
  Each provided order ID is retrieved and reviewed by the macro

- **Source and subsource rules are applied**\
  The macro compares order source and subsource values with the configured mapping

- **Payment methods are assigned when matched**\
  Matching orders receive the corresponding Linnworks payment method

- **Unmatched orders are skipped**\
  Orders that do not match the configured source and subsource values are left unchanged

- **Processing is logged**\
  The macro logs the start, each processed order number, errors, and completion

### **Overall Impact**

This macro improves payment method consistency, reduces manual order updates, and supports cleaner order data across different channels and subsources.

### What To Do After the Macro Runs

After the macro has completed, review a sample of processed orders to confirm that payment methods were assigned correctly.

### **Steps to Follow**

<Steps>
  <Step title="Step 1" title-type="p">
    Open Linnworks and locate the orders included in the **OrderIds** parameter.
  </Step>

  <Step title="Step 2" title-type="p">
    Check the order source and subsource values.
  </Step>

  <Step title="Step 3" title-type="p">
    Confirm that the payment method matches the configured rule.
  </Step>

  <Step title="Step 4" title-type="p">
    Review the macro logs for processed order numbers and any error messages.
  </Step>

  <Step title="Step 5" title-type="p">
    If an order was not updated, verify the source, subsource, payment method name, and list alignment in the macro parameters.
  </Step>
</Steps>

### **Why This Matters**

Correct payment method assignment helps:

- Improve order data consistency

- Reduce manual corrections

- Support reporting by payment method

- Keep marketplace-specific workflows organised

- Avoid incorrect payment method values on selected orders

### Best Practices

To get the most value from this macro, maintain clean and accurate source, subsource, and payment method mappings.

### **Recommended Guidelines**

- **Keep list values aligned**\
  Make sure each source value has a matching subsource and payment method at the same position.

- **Use exact payment method names**\
  The configured payment method name must match an existing Linnworks payment method.

- **Avoid extra commas**\
  Extra or missing values can cause incorrect mapping or missed updates.

- **Test with a small order set first**\
  Run the macro on a small group of orders before using it on larger batches.

- **Review logs after execution**\
  Check the macro logs to confirm which orders were processed.

- **Update mappings when channel rules change**\
  If marketplace or payment rules change, update the macro parameters accordingly.

> Accurate mapping between source, subsource, and payment method is essential for reliable automated payment assignment.

### **Example Scenario**

To better understand how this works, here’s a simple example:

Configured values:

- **Source** = Amazon,eBay,Shopify

- **SubSource** = Amazon UK,eBay UK,Online Store

- **PaymentMethods** = Amazon Pay,PayPal,Shopify Payments

Orders found in Linnworks:

- **Order A** source is **Amazon** and subsource is **Amazon UK** → Payment method set to **Amazon Pay**

- **Order B** source is **eBay** and subsource is **eBay UK** → Payment method set to **PayPal**

- **Order C** source is **Shopify** and subsource is **Online Store** → Payment method set to **Shopify Payments**

- **Order D** source is **Amazon** and subsource is **Amazon DE** → No update

### **What This Means**

- Each source/subsource pair maps to the payment method in the same list position

- Orders are updated only when the configured pair matches

- Orders without a matching pair remain unchanged

## **Final Summary**

The *Assign Payment Method by Subsource* macro automatically updates selected Linnworks orders with the correct payment method based on configured source and subsource rules.

By applying consistent payment method mappings, reducing manual edits, and updating only matching orders, this macro helps improve order accuracy and streamline multi-channel order management.
