Integrating with the API

Custom integrations are possible using ChargeAfter's omnichannel/send-link API.

Sample flows are as follows:

Flow On The Customer's Device

Flow On The Merchant's Device (in-store only)

omnichannel/send-link Overview

πŸ“˜

A private API key (provided by ChargeAfter) must be included as a bearer token in the Authorization header for API calls to work. See Authentication.

ChargeAfter's omnichannel/send-link API is invoked on the server side (communicating server to server).

Request Sample

Parameters are explained in the code sample below with additional parameter descriptions here .

curl https://api-sandbox.ca-dev.co/v2/omnichannel/send-link \
    -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer private-api-key' \
    -d '{
   
    channel: "call_center", //"in_store", "in_home", "e_commerce"
    flow: "apply", // or "checkout"
    storeId: "", // Optional store id
    posType: "", // Optional POS type: "GenericConsumerDevice", "GenericMerchantDevice", "SelfServiceTerminal"
    posId: "", // Optional POS identifier
          
    consumerDetails: { 
        firstName: "John", 
        lastName: "Doe",
        email: "[email protected]",  
        mobilePhoneNumber: "2124445555", 
        merchantConsumerId: "merchant-internal-consumer-id",
        shippingAddress: {
            line1: "3 My Street",
            line2: "My Building, 4th floor",
            city: "New York",
            zipCode: "10019",
            state: "NY"
        },
        billingAddress: {
            line1: "3 My Street",
            line2: "My Building, 4th floor",
            city: "New York",
            zipCode: "10019",
            state: "NY"
        }
    },
      
    createCharge: false, // Optional. If true, it will create a Charge on approval.
    
    sendUsing: "email", // Send an email (from ChargeAfter domain) with a link to launch the experience
      // "redirectUrl" - Return a link to launch the experience (Merchant is responsible to send the URL)
    
    // Required if flow == "checkout"
    cartDetails: {
        items: [
            {
                name: "Awesome Product",
                price: 1999.0,
                sku: "AWSMPRDCT",
                quantity: 2,
                leasable: true,
                productCategory: "Product category",
                warranty: {
                    name: "Awesome Warranty",
                    price: 100.0,
                    sku: "AWSMWRNTY"
                }
            }
        ],
        discounts: [
            {
                name: "Birthday discount",
                amount: 20
            }
//If no discount amount, then this should not be added to the cartDetails.
        ],
        taxAmount: 199.0,
        shippingAmount: 19.0,
        totalAmount: 4296.0
    },
      
    currency: "USD", 	// Optional. The merchant may provide the checkout amount currency code (ISO 4217). Default currency is "USD".
    
    merchantOrderId: "", // Optional field for merchant use,
    correlationId: "", // Optional id. Is reflected in responses and postbacks.
      
    requestedLoanAmount: 300, // Optional field to suggest a desired loan amount.
      
    tags: {}, // Optional key-value object. Each tag has a name and optional primitive value.
      // Tags are reflected in responses and postbacks, used in rules and analytics.
    
    finalPostbackURL: "https://yourFinalPostBackURL.com", // Required for Checkout flow, Optional for Apply
    dataUpdatePostbackURL: "https://yourDataUpdatePostBackURL.com", // Optional
    postbackAuthKey: "<UUID>", // A bearer authentication key that will be passed in postback calls
    redirectOnSuccessURL: "https://merchant.com/financing/approved", // Merchant page to show if financing was approved
    redirectOnFailureURL: "https://merchant.com/financing/declined", // Merchant page to show if financing was not approved
}

Request Parameters

Required Request Parameters

Error Codes for redirectOnFailureURL

When the redirectOnFailureURL is called, the specific error code and the associated message is provided via the querystring section.

  • code - the error code
  • message - text that describes the error
codemessageType of action causing the error
BILLING_SHIPPING_MISMATCHBilling and shipping address must be the sameMerchant-driven
MISSING_CHECKOUT_DATASome of the required data is missingMerchant-driven
CREATE_CHECKOUT_FAILEDCheckout creation or merchant settings fetch failedMerchant-driven
PENDINGApplication is pendingLender-driven
BACK_TO_STOREConsumer clicked the Back to Store buttonCustomer-driven
CONSUMER_CANCELLEDConsumer intentionally closed the Checkout UICustomer-driven

Postbacks

Postbacks are described in finalPostbackURLand dataUpdatePostbackURL.

Response Sample

{
	success: "true",
  tags: {}, // as specified in the request
  correlationId: "", // as specified in the request
  statusTrackingId: "<UUID>"
}

omnichannel/send-link Status

To retrieve the updated status of a specific omnichannel/send-link session, use the status Request.