When a customer completes their purchase, you can send their order and product information to Affirm for A/B testing, which will help you optimize your site. Send this information by adding the Confirmation Page function to your payment confirmation page. We only require orderId, total, productId, and quantity for A/B testing.

[Click here for all the Confirmation Page function parameters](🔗).

To add the confirmation page function, go to **Settings > Checkout > Order Processing > Additional scripts ** and add the code below.  Replace `public_api_key` with your public API key found in the merchant dashboard.

### Required function parameters

#### Order object

**paymentMethod** `string` The payment method chosen by the customer (e.g., Visa). Maximum 150 characters.
**orderId** `string` Your internal unique identifier representing the order. Maximum 500 characters.
**total** `string` The total amount of the transaction, including tax and shipping, stated in USD cents (e.g., $100 = 10000).

#### Product object

**productId** `string` Your internal unique identifier representing the product, such as the SKU or an internal database identifier. Maximum 500 characters.
**quantity** `string` The quantity of the purchased product.