Campaign Invoice

A Campaign Invoice is a special payment method in AfterPay. It is similar to the regular Digital Invoice, but instead of the standard 14 days, the invoice deadline is at a certain point in the future. This can work in two ways:

  • Fixed due date – a specific date on which all outstanding invoices must be paid.
    • For example: "Do all your Christmas shopping with AfterPay, and don't pay until January 31st!"
    • If the customer makes several Campaign Invoice purchases during the campaign, the due date will be the same for all of them. (However, they will not be consolidated into a single invoice.)
  • Floating due date – a delay of a specific number of days for each individual invoice.
    • For example: "Shop now, pay in 60 days!"
    • If the customer makes several Campaign Invoice purchases during the campaign, they will all have a different due date, each with the same delay from the purchase date.

Campaigns can remain configured in the AfterPay backend constantly, but only activated for certain periods.

Let's see how this would work with a Campaign Invoice.

Astrid puts a few items into her cart, and goes to checkout. The merchant makes an AvailablePaymentMethods call.

The eCom API responds with two available payment methods: a regular Digital Invoice, and the Campaign Invoice. The campaigns block contains the following parameters

  • campaignNumber - the number of this campaign as configured in the backend.
  • campaignType - Fixed or Floating due date.
  • activeFrom - the start date for the campaign's current activity period.
  • activeTo - the end date for the campaign's current activity period.
  • dueDate - the date on which the customer will have to pay this invoice.
    • Mandatory for Fixed Due Date campaigns.
  • paymentTerm - the length of time that the customer has to pay the invoice, from the Capture date.
    • Mandatory for Floating Due Date campaigns.
  • consumerFeeAmount - the amount that the customer will be charged as a fee for using the Campaign Invoice method.

The merchant's webshop takes this information and displays it to Astrid as one of the payment options. She selects it, and makes her purchase. A fee of 1.23 SEK is added to her invoice for the use of the Campaign. She receives an email about the invoice immediately, but doesn't have to pay until May 1st.

POST https://sandbox.afterpay.io/api/v3/checkout/payment-methods


{
  "customer": {
    "identificationNumber": "800119-3989",
    "salutation": "Mrs",
    "firstName": "Astrid",
    "lastName": "Svensson",
    "email": "astrid.svensson@example.com",
    "customerCategory": "Person",
    "address": {
      "street": "Kungsgatan",
      "streetNumber": "66",
      "postalCode": "11122",
      "postalPlace": "Stockholm",
      "countryCode": "SE"
    },
    "conversationLanguage": "EN"
  },
  "order": {
    "number": "afterpay4",
    "totalGrossAmount": 2085.0,
    "items": [
      {
        "productId": "0001-BLK-M",
        "description": "Leather jacket, Black, size M",
        "grossUnitPrice": 1000.0,
        "quantity": 1.0,
        "vatPercent": 20.0,
        "imageUrl": "https://cdn.afterpay.io/dev-portal/images/black_leather_jacket.jpg",
        "lineNumber": 1
      },
      {
        "productId": "0001-BLK-S",
        "description": "Leather jacket, Black, size S",
        "grossUnitPrice": 1000.0,
        "quantity": 1.0,
        "vatPercent": 20.0,
        "imageUrl": "https://cdn.afterpay.io/dev-portal/images/black_leather_jacket.jpg",
        "lineNumber": 2
      },
      {
        "productId": "0002-GRY-M",
        "description": "Socks, Grey, Size M",
        "grossUnitPrice": 10.0,
        "quantity": 5.0,
        "vatPercent": 20.0,
        "imageUrl": "https://cdn.afterpay.io/dev-portal/images/grey_socks.jpg",
        "lineNumber": 3
      },
      {
        "productId": "0004-BRN-M",
        "description": "Woolen hat, brown, Size M",
        "grossUnitPrice": 30.0,
        "quantity": 1.0,
        "vatPercent": 20.0,
        "imageUrl": "http://cdn.afterpay.io/dev-portal/images/brown_wool_hat.jpg",
        "lineNumber": 4
      },
      {
        "productId": "SHIP",
        "description": "Shipping",
        "type": "ShippingFee",
        "grossUnitPrice": 5.0,
        "quantity": 1.0,
        "vatPercent": 20.0,
        "lineNumber": 5
      }
    ]
  }
}

RESPONSE from eCom API


                        {
  "CheckoutId": "5bb3b78d-7820-4dfc-97e1-758f69ead1b5",
  "Outcome": "Accepted",
  "Customer": {
    "CustomerNumber": "283446246",
    "FirstName": "Astrid",
    "LastName": "Svensson",
    "AddressList": [
      {
        "Street": "Kungsgatan",
        "StreetNumber": "66",
        "PostalCode": "11122",
        "PostalPlace": "Stockholm",
        "CountryCode": "SE"
      }
    ]
  },
  "PaymentMethods": [
    {
      "Type": "Invoice",
      "Title": "Afterpay",
      "Tag": "Special offer for Svensson Astrid. 1.23kr valid 01-05-2019",
      "Logo": "https://cdn.myafterpay.com/logo/AfterPay_logo.svg",
      "Campaigns": {
        "CampaignNumber": 333,
        "CampaignType": 1,
        "ActiveFrom": "2019-03-01T00:00:00+00:00",
        "ActiveTo": "2019-05-01T00:00:00+00:00",
        "DueDate": "2019-05-01",
        "ConsumerFeeAmount": 1.23
      }
    },
    {
      "Type": "Invoice",
      "Title": "Invoice",
      "Tag": "Experience first, pay later",
      "Logo": "https://cdn.myafterpay.com/logo/AfterPay_logo.svg"
    }
  ]
}