Create Payment Method

Introduction

This endpoint is used to create a new payment method for a Subscriber using either a Credit Card or a Bank Account and to create a new record in the PaymentMethod table in the database.

Comparison

Compared to the older model, the new input model requires just a few parameters, as explained in detail below.

Note: For the time being, both the old and new endpoints are in the Billing API.

Billing API (OLD)
Billing API (NEW)

URL

/Billing/{subscriptionId}/PaymentMethods

/Billing/PaymentMethods

Method

POST

POST

Input Example

{
   "PaymentMethod":{
      "PaymentMethodId":0,
      "ExternalPaymentMethodId":"10203992",
      "PaymentMethodType":1,
      "PaymentMethodTypeName":"CreditCard",
      "PlatformSpecificTypeName":null,
      "AccountHolder":"EARL HROZA",
      "CreditCard":{
         "CardType":2,
         "CreditCardType":2,
         "CreditCardNumber":"XXXXXXXXXXXX1111",
         "ExpirationYear":2028,
         "ExpirationMonth":2,
         "CardSecurityCode":"",
         "CardOwner":"john smith",
         "LastFourDigits":"1111"
      },
      "BankAccount":null,
      "PayPalInfo":null,
      "OfflinePayment":null,
      "BillingAddress":{
         "AddressId":1700202,
         "BillingSystemAddressId":null,
         "PrimaryAddress":null,
         "AlternateAddresses":null,
         "CountryName":null,
         "CityName":null,
         "DistrictName":null,
         "ProvinceOrTerritory":null,
         "PhoneNumber":null,
         "ZipCode":null,
         "AddressName":null
      },
      "PaymentSource":null,
      "TermsAndConditionsAccepted":true,
      "ExternalToken":"10203992",
      "ExternalCustomerId":null,
      "IsDefault":false
   },
   "BillingAddressId":1700202,
   "ValidateAddress":null,
   "AccountInfo":{
      "SubscriptionId":245316,
      "SubscriberId":4784,
      "RegistrationId":0
   }
}

Credit Card example:

{
  "HolderName": "Clark Kent",
  "CreditCard": {
    "CreditCardExpirationMonth": "06",
    "CreditCardExpirationYear": "12",
    "CreditCardNumber": "4111********1111",
    "CreditCardType": 1
  },
  "BillingAddressId": 1859629,
  "BillingSystemPaymentMethodId": "test",
  "PaymentGatewayToken": "ASFWE234234",
  "PaymentGatewayCustomerId": "HKUSDYISD"
  "SubscriptionId": 20,
  "PaymentMethodType": 1
}

BankAccount example:

{
  "HolderName": "Bruce Wayne",
  "BankAccount": {
    "BankAccountNumber": "123456",
    "BankAccountType": 1,
    "BankName": "Gotham City Bank",
    "BankRoutingNumber": "3456324"
  },
  "BillingAddressId": 0,
  "SubscriptionId": 20,
  "PaymentMethodType": 2
}

Create Payment Method

POST /Billing/PaymentMethods

This endpoint is used to create a new payment method for a Subscriber using either a Credit Card or a Bank Account and to create a new record in the PaymentMethod table in the database.

Note: The parameters marked with an asterisk (*) are mandatory and must be included in the input model.

Headers

Name
Type
Description

Authorization*

String

JSON Web Token used for security purposes

X-SourceSystem*

String

To identify the consumer or the Source System

X-MediaGroupCode*

String

Media Group Code of the Tenant

X-ClientCode*

String

Client Code of the Tenant

X-PaperCode*

String

Paper Code of the Tenant

Request Body

Name
Type
Description

SubscriptionId*

Integer

Unique identifier of the Subscription in Naviga System

BillingAddressId

Integer

Unique identifier of the current Subscriber Billing address in Naviga System.

BillingSystemPaymentMethodId

String

Unique identifier of the payment method in Naviga System.

(Used by the data team.)

HolderName*

String

For a Bank Account payment method, it’s the Subscriber’s name, and for a Credit Card payment method, it’s the Credit Card name.

CreditCard.CreditCardType

Integer

Represents the credit card type. Possible values: American Express (1), Visa (2), MasterCard (3), Diners (4), Discover (5).

CreditCard.CreditCardNumber

String

Masked Credit Card number.

Required if Payment Method is Credit Card.

CreditCard.CreditCardExpirationYear

Integer

Credit card expiration year.

Required if Payment Method is Credit Card.

CreditCard.CreditCardExpirationMonth

Integer

Credit card expiration month.

Required if Payment Method is Credit Card.

BankAccount.BankAccountNumber

String

Bank account number.

Required if Payment Method is Bank Account.

BankAccount.BankName

String

Name of the bank.

Required if Payment Method is Bank Account.

BankAccount.BankAccountType

Integer

Represents the bank account type.

Required if Payment Method is Bank Account.

Possible values: CheckingsAccount(1), SavingsAccount (2), CorporateCheckingsAccount(3).

PaymentMethodType

Integer

Represents the payment method type.

Possible values: CreditCard(1), BankAccount(2), MerchantAcceptedPayment(3), Coupon(4), PayPal(5), PayPalExpress(6), iTunes(7), GooglePlay(8), ApplePay(9), AmazonInApp(10), SubscribeWithGoogle(11), GooglePay(12), ExternalPayment(13), Piano(14)

PaymentGatewayCustomerId

String

Unique identifier of the Payment Method’s owner in the Payment Gateway Systems.

Required if Payment Method is Credit Card.

Note: This parameter is not managed by all payment gateways; however, Stripe, Braintree, and NavigaPay do.

PaymentGatewayToken

String

Unique identifier of the Payment Method in the Payment Gateway Systems (Payway, AuthorizeNET, Stripe, Braintree, NavigaPay, etc).

Required (and mandatory) if Payment Method is Credit Card.

PaymentMethod.CreditCard.CardOwner

String

Credit card Owner name.

Required if Payment Method is Credit Card.

BankAccount.BankRoutingNumber

String

Bank account routing number.

Required if Payment Method is Bank Account.

{
  "Code": 200,
  "Errors": [],
  "Result": {
    "PaymentMethodId": 789507
  },
  "SessionId": null,
  "RequestId": null
}

Last updated

Logo

COPYRIGHT © 2024 NAVIGA