## Overview

[Processing orders (authorize, void, refund)](🔗) in Commerce Cloud updates the order status in the Affirm dashboard. While you can process orders in the dashboard, we strongly recommend using Commerce Cloud to keep your order statuses synced with Affirm.

### Set up your order management functions

To set up your order management functions, you will need to import XML files from the downloaded cartridge and enable each job (function). These files are included in `affirm.zip` which should have been uploaded in the previous steps (If not, go to the "Import the XML files from the Metadata directory" section and complete the steps). Please note that some of these functions may not be available in older versions of the cartridge.

1\. Go to **Administration > Operations > Jobs**. 2\. Verify that each imported job was created.



3\. For each job (shown above), check the enabled box and set the interval.



4\. Check the _Scope_ in the _Job Steps_ tab to make sure your site is included.



Process transactions in the Dashboard

[Click here for information on processing transactions](🔗)

## External Interfaces

### Affirm REST API

Commutation between Affirm service and Salesforce Commerce Cloud Platform is based on Affirm REST API. All outside traffic from Salesforce Commerce Cloud instance is handled by HTTPS protocol. In the Salesforce Commerce Cloud Platform each API call to Affirm is wrapped into Service that is handling monitoring and logging functionality.

[Affirm integration documentation](🔗) [Promotional Messaging](🔗)




## Processing transactions

When a customer completes a checkout with Affirm as the payment method, Affirm authorizes a charge for the amount of the order. The charge enters a pending state on the customer's Affirm account. Authorized charges expire if you do not capture them before the capture deadline, which is a period **specified in your partnership agreement with Affirm**. If you did not define your authorization timing requirements because of inventory, pre-orders, or shipping time in your onboarding form, please contact your Client Success Manager.

After Affirm authorizes a charge, you can perform the following actions on it in Salesforce Commerce Cloud:

  • [Capture](🔗)

  • [Void](🔗)

  • [Refund](🔗)

### Capture

Capturing a charge does the following:

  • Charges the authorized amount to the customer's Affirm account.

  • Begins the customer's billing cycle.

  • Triggers the transfer process of funds from Affirm to the merchant.

Merchants typically capture a charge after fulfilling the order. We recommend auto-capturing if you usually fulfill orders within 5 business days so that the customer receives their purchase before their first bill.

1\. On the main page, go to **Business Manager > Merchant Tools > Ordering > Orders**. 2\. Click on the order. 3\. Set **Shipping Status** to **Shipped**.

A manually run or periodically running job will capture the charge.

### Void & Refund

If you have not captured a charge yet, you can cancel its authorization by voiding it. If you have already captured a charge, you can reverse it and refund the amount to the customer's Affirm account. Voiding or refunding a charge is irreversible and Affirm is unable to reinstate those funds.

  1. On the main page, go to **Business Manager > Merchant Tools > Ordering > Orders**.

  2. Click on the order.

  3. Set Order **Status** to **Canceled**.

A batch job based on the Affirm Status of the order before cancelation will refund or void the charge.

### Set up recurring jobs

SFCC performs the above actions based on either manual or recurring jobs.

To create recurring jobs:

1\. [Configure Affirm services and jobs](🔗). 2\. In the **Business Manager **main page, go to **Administration > Operations > Schedules (deprecated)**. 3\. Click on the order management function (job).

sfcc_job.png


4\. Click **Recurring Interval**. 5\. Enter your timing preferences. 6\. Click **Run**.

sfcc_run_job.png





### View processed transactions

Go to **Business Manager > Merchant Tools > Ordering** to view all processed orders. For orders bought with Affirm as the payment method:

**Attributes tab**

The Attributes tab contains the Affirm payment details.

SFCC_attributes_tab.png


**Payments tab**

  • Order Payment shows as _Not paid_ (pre-capture).

  • If you configure auto-capture, _Payment_ shows as _Paid_.

    sfcc_payments_tab.png