ApplyForCredit

Summary

Apply for customer account credit

Resource URL /api/v3/customer-account
HTTP method POST
Content type application/json; charset=utf-8

Input parameters

Parameter name Location Type / Model Description
request Body ApplyForAccountCreditRequest required

Responses

HTTP status code Model Comment
OK(200) ApplyForAccountCreditResponse Apply for customer account credit 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

{
  "accountLimit": 100.00,
  "customer": {
    "salutation": "Mr",
    "firstName": "John",
    "lastName": "Smith",
    "customerNumber": "1006",
    "organizationPersonalNo": "22038422021",
    "category": "Person",
    "currency": "NOK",
    "distributionType": "Paper",
    "email": "email@email.com",
    "address": {
      "street": "Main Street",
      "streetNumber": "1",
      "postalCode": "12345",
      "postalPlace": "Oslo",
      "countryCode": "NO"
    },
    "phone": "+321231237183271",
    "directPhone": "05556644",
    "mobilePhone": "05556644"
  }
}
{
  "account": {
    "accountLimit": 100.0,
    "accountNumber": "0100.0000008",
    "accountProfile": "1",
    "accountStatus": "Ok",
    "customerId": "1006",
    "createdAt": "2016-02-01T15:39:40Z",
    "ocr": "6101000000008000002"
  }
}
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 = {
  "accountLimit": 100.00,
  "customer": {
    "salutation": "Mr",
    "firstName": "John",
    "lastName": "Smith",
    "customerNumber": "1006",
    "organizationPersonalNo": "22038422021",
    "category": "Person",
    "currency": "NOK",
    "distributionType": "Paper",
    "email": "email@email.com",
    "address": {
      "street": "Main Street",
      "streetNumber": "1",
      "postalCode": "12345",
      "postalPlace": "Oslo",
      "countryCode": "NO"
    },
    "phone": "+321231237183271",
    "directPhone": "05556644",
    "mobilePhone": "05556644"
  }
};

client.CustomerAccount.applyForCredit(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 = '{"accountLimit":100.00,"customer":{"salutation":"Mr","firstName":"John","lastName":"Smith","customerNumber":"1006","organizationPersonalNo":"22038422021","category":"Person","currency":"NOK","distributionType":"Paper","email":"email@email.com","address":{"street":"Main Street","streetNumber":"1","postalCode":"12345","postalPlace":"Oslo","countryCode":"NO"},"phone":"+321231237183271","directPhone":"05556644","mobilePhone":"05556644"}}'
request = AfterPayApi::Models::ApplyForAccountCreditRequest.deserialize_object(JSON.parse(requestAsJson))


client.customerAccount.applyForCredit_async(request).then{|response|

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

var request = new ApplyForCreditRequest(){
  AccountLimit = 100.00,
  Customer = new Customer() {
    Salutation = Salutation.Mr,
    FirstName = "John",
    LastName = "Smith",
    CustomerNumber = "1006",
    OrganizationPersonalNo = "22038422021",
    Category = CustomerCategory.Person,
    Currency = "NOK",
    DistributionType = DistributionType.Paper,
    Email = "email@email.com",
    Address = new Address() {
      Street = "Main Street",
      StreetNumber = "1",
      PostalCode = "12345",
      PostalPlace = "Oslo",
      CountryCode = CountryCode.NO
    },
    Phone = "+321231237183271",
    DirectPhone = "05556644",
    MobilePhone = "05556644"
  }
};

var responce = client.CustomerAccountApplyForCredit(request);