Customer

Customer, metadata comes from your CRM, payment option comes from FarPay

Get a single customer

Use the https://api.farpay.io/v2/customers/{customer number} e.g. with customer number= 23.

Customer terms

TermElaboration
CustomerIs the person or business, that receives an invoice from your comapny, and can by using the presented payment technology, pay an invoice or subscribe to a payment technology.
Payment intrumentGives the customer the ability to pay an amount to your comapny

Create a new customer

To create a customer, the endpoint accepts both XML and JSON as payload of the customer data. In this example JSON is used.
Remark that the customer object has a minimum set of required properties, for the system to be used fully. They are:

  • CustomerNumber
  • Name
  • Email
{
  "CustomerNumber": "string",
  "Name": "string",
  "Email": "string",
  "PoBox": "string",
  "Street": "string",
  "AdditionalStreet": "string",
  "HouseNumber": "string",
  "PostCode": "string",
  "City": "string",
  "Country": "string",
  "AttachPdfInvoice": false,
  "Language": "Danish"
}

The AttachPdfInvoice is used when you want to distribute the PDF-invoice with the invoice email. Remark that the common log of
monitoring the customer when the invoice is opend, or when downloaded are with this setting inaccurate.

The Language setting should only be used for language variations, meaning of your company communicates in one language, the
customers who read the same language, do not need this property to be set, while others can.

PropertiesDescriptiontype
CustomerNumberUnique customer identifiernumeric value max 15 digits
NameThe given name of the customer255 characters
emailcommuncation to the customer255 characters
PoBoxpost box20 characters
StreetAddress or streetname255 characters
AdditionalStreetAdditional addressline255 characters
HouseNumberSupplementary address info10 characters
PostCodePost district or area20 characters
CountryCountry255 characters
AttachPdfInvoiceCustomer gets PDF-attachements on invoicesboolean
LanguageCommunication langauge"Danish", "English", "Faroese", "Norwegian"

Update an existing customer

The customer can be updated by a PUT from https://api.farpay.io/v2/customers/
Compared to the create, there are some limitations of what can be updated. The updates can be done on:

  • Name
  • All the address properties
  • Email
  • AttachPdfInvoice
  • Language

An example update could be an norewgian customer, now residing in the UK:

{
  "CustomerNumber": "string",
  "Name": "John Smith",
  "PoBox": "2301",
  "Email": "[email protected]",
  "Street": "Marksquare",
  "AdditionalStreet": "Wellington st.",
  "HouseNumber": "4",
  "PostCode": "3422",
  "City": "Bristol",
  "Country": "United Kingdom",
  "AttachPdfInvoice": false,
  "Language": "Norwegian"
}

Delete customer BETA

To delete the customer, the customer and subsequent invoices and payments will be removed from the system.


DELETE https://api.farpay.io/{version}/customers/{customerNumber}

Response

The response will return with a statuscode, corresponding to the outcome of the operation.
Available codes are:

HTTP Statuscodereason
HTTP_OK (200)Customer was successfully deleted
BAD_REQUEST (400)CustomerNumber missing from the URI
NOT_FOUND (404)Customer not found

Send an email for creating a payment agreement

When you want FarPay to send an email to your customer with the ability to create a recurring payment instrument, the
endpoint GET to https://api.farpay.io/v2/customers/{customer number}/agreementRequest?type={type}&email={email}' There are three parmeters that must be set when making this call:

Parameter nameValuesPlaceholder
customer numberthe customer number, that is used in the URLRoute
typemp, card, bs, lsor allUri
emailthe email addressUri

Type values and definition

The type sets what payment instrument shoul be shown, when the customer creates a payment agreement. See values, and the description below.

Valuedescription
mpMobilePay Subscriptions payment agreement.
cardCard agreement - Can be Visa, MasterCard or Dankort
bsBetalingsservice - Direct debit account information, mainly for private customers
lsLeverandørservice - Direct debit account information, business only
allWhen multiple payment types available, the customer selects a favorable.