Optional: Adding your first Payment Method

📘

No Payment Method

If no Payment Method is created, the customer will automatically be treated as a manual payment customer. This means the invoices will still be created, but Upodi expects the invoice to be paid outside of Upodi.

Step 1: To post a Credit Card or any other payment method to a customer requires that you first setup your desired Payment Service Provider (PSP) in Upodi. Head over to the Payment Provider setup page and setup your connection to your PSP.

Step 2: Tokenize the customers' credit card towards your chosen PSP. This process varies a lot between the different PSP's so read the Credit Cards found in this section of our documentation. If your payment method is of a Direct Debit type (Betalingsservice, SEPA etc.) read this section about Direct Debit processes for our different PSP's.

Step 3: Post the token to your Upodi Customer:

curl -X POST \
  https://api.upodi.io/v3/paymentmethods/{CustomerID goes here} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {Base64EncodedUpodiAPIKey}' \
  -H 'Content-Type: application/json' \
  -d '{
  "type" : 64,  # type 64 is a credit card token
  "makedefault" : "true",
  "puretoken" : { 
    "token" : "card_2445669082",
    "paymentgateway" : "stripe" # Stripe in this example
  }
}'
UpodiService Upodi = new UpodiService("{APIKey}");

upodi.PaymentMethods.CreatePaymentMethod(customerId, new CreatePaymentMethodRequest
    {
    Type = Upodi.Enums.PaymentMethodTypeEnum.PureTokenBased,
    MakeDefault = true,
    TokenBased = new CardToken
        {
        PaymentGateway = "Payment Service Provider",
        Token = "{Token}"
      }
  });