Hey! These docs are for version 1.0, which is no longer officially supported. Click here for the latest version, 2.0!

createpaymentmethod object

Used for the /paymentmethods/:customerid/ POST request.

See /paymentmethods/:customerid/ request. The given payment method need to be configured with a matching payment gateway before the payment method is accepted and processed.

{
  "type" : int /* PureTokenBased = 64, FI = 128, LS = 256, Upodi card token = 8 */,
  "makedefault" : "boolean", /* will make the payment method default on the customer */
  "puretoken" : { /* Optional. Only define properties if type=64 (token) is defined. */
    "token" : "string",
    "paymentgateway" : "string" /* Optional. Only define properties if type=64 (token) is defined. Example stripe, epay, quickpay etc. */
  },
  "fi" : { /* Optional. Only define properties if type=128 (FI) is defined. */
    "ficustomernumber" : "string"
  },
  "creditcard" : { /* Optional. Only define properties if type=8 (Upodi.js token) is defined. */
    "cardtoken" : "string"
  },
  "ls" : { /* Optional. Leverandør Service. Only define properties if type=256 (FI) is defined. */
    "bankregnumber" : "integer", /* 4 numbers long, example 9890 */
    "bankaccountnumber" : "integer", /* 10 numbers long */
    "cvrnumber" : "integer" /*8 numbers long */
  }
}

Example
The following outlines an example where the POST /paymentmethods/:customerid/ will create a default payment method on a customer, as a Stripe token.

{
  "type" : 64,
  "makedefault" : "true",
  "puretoken" : { 
    "token" : "card_2445249082",
    "paymentgateway" : "stripe"
  }
}