CreateContract

Summary

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

Resource URL /api/v3/checkout/{checkoutId}/contract
HTTP method POST
Content type application/json; charset=utf-8

Input parameters

Parameter name Location Type / Model Description
checkoutId Path required
request Body CreateContractRequest required

Responses

HTTP status code Model Comment
OK(200) CreateContractResponse Create contract response
BadRequest (400) array of ResponseMessage Request failed. Check response model for list of Errors.
Unauthorized (401) API user is unauthorized. Make sure X-Auth-Key header is sent.
InternalServerError (500) Request failed due internal error. Retry request later.

Examples

{
  "paymentInfo": {
    "type": "Invoice",
    "directDebit": {
      "bankCode": "GENODEM1GTL",
      "bankAccount": "DE20478601250040154100"
    }
  }
}
{
  "requireCustomerConfirmation": true,
  "contractList": [
    {
      "contractType": "DirectDebit",
      "contractContent": "CustNo : \r\nSSN: SSN198411090111\r\nAddress: Ice road\r\nPostalcode: 10088\r\nPostalPlace: North pole\r\nBalance: 720.00\r\nNoticeFee: \r\nInterestRate: 5.50\r\nElectronice communication: ",
      "contractNumber": "00000000000001"
    }
  ]
}
var AfterPayApi = require("./afterPay.js");
var apiKeyAuthentication = require("./api_key_filter");

var key = 'CHANGE_ME';
var client = new AfterPayApi().addFilter(apiKeyAuthentication.create(key));
var request = {
  "paymentInfo": {
    "type": "Invoice",
    "directDebit": {
      "bankCode": "GENODEM1GTL",
      "bankAccount": "DE20478601250040154100"
    }
  }
};
var checkoutId = "4e343877-d722-4a8f-a639-93d12984b2ad";

client.Checkout.createContract(checkoutId, request, 
  function(err, response, httpRequest, httpResponse) {
  });
$LOAD_PATH.unshift File.dirname(__FILE__)
require 'after_pay.rb'
require 'json'

client = AfterPayApi::AfterPay.new(AfterPayApi::ApiKeyCredentials.new('YOUR_API_KEY'))

requestAsJson = '{"paymentInfo":{"type":"Invoice","directDebit":{"bankCode":"GENODEM1GTL","bankAccount":"DE20478601250040154100"}}}'
request = AfterPayApi::Models::CreateContractRequest.deserialize_object(JSON.parse(requestAsJson))

checkoutId = "68b2cd5d-c1de-4d7d-b65d-e4e73c94a576";

client.checkout.createContract_async(checkoutId, request).then{|response|

}.execute.wait
var key = "CHANGE_ME";
var client = new CheckoutApi(new Configuration() { DefaultHeader = new Dictionary<string, string>() { { "X-Auth-Key", key} } });

var request = new CreateContractRequest(){
  PaymentInfo = new Payment() {
    Type = PaymentMethodType.Invoice,
    DirectDebit = new DirectDebit() {
      BankCode = "GENODEM1GTL",
      BankAccount = "DE20478601250040154100"
    }
  }
};
var checkoutId = "7379cb0f-c26d-4ecc-b31b-5d07a018f1c7";

var responce = client.CheckoutCreateContract(checkoutId, request);