Home > API > Checkout > Create contract

Create contract

Creates an installment and/or direct debit contract that can be displayed for the customer.

PATH:

/api/v3/checkout/{checkoutId}/contract

PATH PARAMETERS:

checkoutId
required

string

REQUEST BODY SCHEMA:

paymentInfo
required

paymentInfo object

Payment info

type
required

string

Enum: Invoice Account Installment Consolidatedinvoice DirectDebitInvoice

Payment method

contractId

string

Contract ID

directDebit

directDebit object

Direct debit information

bankCode

string <= 11 characters

Direct debit swift, BIC, SortCode

bankAccount
required

string <= 34 characters

Direct debit bank account

token

string <= 50 characters

Unique string provided by AfterPay if the merchant is using tokenization.Contact your Integration Manager for more details.

campaign

campaign object

Campaign information

campaignNumber
required

integer

Campaign number

invoice

undefined

Invoice information. Reserved for future use.

account

account object

Used when consumer has chosen flexible installment plan (minimum amount to pay)

profileNo
required

integer

Account Profile number

consolidatedInvoice

consolidatedInvoice object

Consolidate invoice information

invoiceDate

string

Date when invoice will be created

installment

installment object

Installment information

profileNo
required

integer

Installment profile number

numberOfInstallments

integer

Number of installments

customerInterestRate

number

Customer interest rate

RESPONSES:

200 OK

RESPONSE SCHEMA:

contractId

string

Contract ID

requireCustomerConfirmation

boolean

RequireCustomerConfirmation

contractList

array of contractList

Contract list

Array () [
contractType

string

Enum: Invoice Installment DirectDebit Account

Contract type

contractContent

string <= 4096 characters

Contract content

contractNumber

string <= 50 characters

Contract number


]
400 Model validation failed.

RESPONSE SCHEMA:

Array () [
type

string

Enum: BusinessError TechnicalError NotificationMessage

Message type

code

string <= 100 characters

Confirmation or error code

message

string <= 4096 characters

Message content

customerFacingMessage

string <= 4096 characters

Message to display to customer

actionCode

string

Enum: Unavailable AskConsumerToConfirm AskConsumerToReEnterData OfferSecurePaymentMethods RequiresSsn AskConsumerToIdentify

Possible next action to make

fieldReference

string <= 100 characters

Reference to field that caused an error

]
401 Authorization has been denied for this request.
500 Internal server error.

Path

post

/api/v3/checkout/{checkoutId}/contract

Request samples

  • {
    • "paymentInfo": { ...
      • "type": "string",
      • "contractId": "string",
      • "directDebit": { ...
        • "bankCode": "string",
        • "bankAccount": "string",
        • "token": "string"
        },
      • "campaign": { ...
        • "campaignNumber": 1
        },
      • "invoice": X,
      • "account": { ...
        • "profileNo": 1
        },
      • "consolidatedInvoice": { ...
        • "invoiceDate": "string"
        },
      • "installment": { ...
        • "profileNo": 1,
        • "numberOfInstallments": 1,
        • "customerInterestRate": 1.00
        }
      }
  • }

Response samples

200400
  • {
    • "contractId": "string",
    • "requireCustomerConfirmation": true,
    • "contractList": [ ...
      • {
        • "contractType": "string",
        • "contractContent": "string",
        • "contractNumber": "string"
        }
      ]
    }
  • [
      ...
      • {
        • "type": "string",
        • "code": "string",
        • "message": "string",
        • "customerFacingMessage": "string",
        • "actionCode": "string",
        • "fieldReference": "string"
        }
    ]