Skip to main content

Add/edit payment details

Use the following REST APIs to add or edit payment details and methods such as bank accounts, card details, and so on. Currently, only REST APIs exist to support these functions.

  1. Use the paymentMethodTypes API to retrieve all the supported payment method types on the Marketplace:
{marketplaceBaseUrl}/api/appMarket/v2/paymentMethodTypes
  1. Use the list paymentMethods API to retrieve previously saved payment methods:
{marketplaceBaseUrl}/api/appMarket/v2/paymentMethods
  1. Use the set default payment method API to set a default payment method from the existing list of payment methods:
{marketplaceBaseUrl}/api/appMarket/v2/paymentMethods/defaults 
  1. Use the create new payment method to create a payment method and set it as the default payment method:
{marketplaceBaseUrl}/api/appMarket/v2/paymentMethods

Example: Creating a payment method by providing the payment details for a card.

Method: POST

URL: {marketplaceBaseUrl}/api/appMarket/v2/paymentMethods

Input payload:

{
"companyId": "9faf88c2-9e58-4f5b-a009-5dc9094fe2a0",
"ownerId": "df053b59-7ed7-4b88-9e69-02dd3223a0a3",
"paymentMethodType": "CARD",
"billingAddress": {
"city": "Somerville",
"country": "US",
"state": "MA",
"street1": "50 Grove St.",
"zip": "02114",
"phone": "4158523919"
},
"properties": {
"brand": "VISA",
"cardHolderName": "Vikram",
"expirationMonth": "02",
"expirationYear": "2026",
"number": "4321161213479781",
"securityCode": "123"
}
}

Response:

{
"id": "45759137-b74f-4770-af87-04e56b179979",
"accountDisplay": "1111",
"paymentMethodType": "CARD",
"properties": {
"expirationYear": "2026",
"emailAddress": "dummy@appdirect.com",
"cardHolderName": "Vikram",
"expirationMonth": "02",
"brand": "VISA"
},
"billingAddress": {
"street1": "50 Grove St.",
"city": "Somerville",
"country": "US",
"state": "MA",
"zip": "02114",
"phone": "4158523919"
},
"partyType": "COMPANY",
"partyId": "2201698",
"companyUuid": "9faf88c2-9e58-4f5b-a009-5dc9094fe2a0",
"userUuid": "df053b59-7ed7-4b88-9e69-02dd3223a0a3",
"gatewayKey": "{\"vaultedShopperId\":\"47574695\"}",
"status": "ACTIVE",
"default": true
}

Was this page helpful?