v1

latestOpenAPI 3.0.02026-07-24161215397.4 KB
Payment Details

Add new payment details for user

Add payment details object. When recording payment details for a company, said company must have at least one billing person in order for the card to be recorded.

Required scopes: flex.billing.paymentDetails.create

post/api/v2/organizations/{orgSlug}/payment-details

Path parameters

orgSlugstring required

organization slug

Request body

type'stripe' required

The payment provider type. Currently only Stripe is supported.

method'card' required

The method of the payment details.

datastring required

The token of the card that will be recorded. This can be procured by using Stripe's /tokens API.

isPersonalboolean required

Determines whether the card is recorded for the member themselves or for their company.

memberstring

The member for which the card is recorded.

companystring

The company for which the card is recorded.

Example request

{
  "data": "tok_12EXMPLE34",
  "isPersonal": true,
  "member": "603dfbc260f4054084125d38",
  "company": "603dfbc260f4054084125d39"
}

Response

_idstring

The _id of the payment details.

type'stripe'

The payment provider type. Currently only Stripe is supported.

method'card' | 'ach'

The payment method type. Used to calculate any method-specific processing fees in the summary.

paymentCustomerstring

The _id of the card in Stripe. Same as the _id in the "card" object.

paymentSourcestring

The _id of the card in Stripe. Same as the _id in the "card" object.

locationsstring

An array containing the list of locations for which the payment details are valid.

createdAtstring date-time

The time when the payment details were created

createdBystring

The _id user that created the payment details

Example response

{
  "_id": "603dfbc260f4054084125d34",
  "details": {
    "id": "card_1NISlsEk95fg2DONATjFxjZ1",
    "name": "Test Member",
    "brand": "Visa",
    "funding": "credit",
    "expirationMonth": 2,
    "expirationYear": 2042,
    "country": "US",
    "cvcCheck": "pass",
    "last4": "4242"
  },
  "authorization": {
    "authProvider": "seti_1NIX7tEk95fg2DONRZsfd8zM",
    "status": "not_required"
  },
  "paymentCustomer": "cus_12EXMPLE34",
  "paymentSource": "card_12EXMPLE34",
  "createdAt": "2021-04-21T18:00:00.000Z",
  "createdBy": "603dfbc260f4054084125d30"
}