Skip to content

Create card

Request

The card details.

You can pass either issuerId + corresponding accountIdentifier for the card (e.g. accountIdentifiers.galileoCad) attributes or the cardDetails object.

If issuerId + card accountIdentifier attributes are passed and issuerEventsSubscriber is set to peach, Peach will sync the card status, transactions and balances with the loan ledger seamlessly. Note: these attributes must be passed if issuerEventsSubscriber is set to peach, because Peach will need the identifying information to tie the issuer's events to the proper card.

If cardDetails is passed, the card details will be stored in the Peach system as read-only. The lender is responsible for updating the loan details based on the card usage. Note: if cardDetails is passed without issuerId and accountIdentifier, issuerEventsSubscriber cannot be set to peach.

The card issuerId and accountIdentifier attributes can be updated only if the loan status is originated or pending. After the loan is activated, the issuerId and accountIdentifier information cannot be changed.

Security
oauth2(Required scopes: card:create) or bearerAuth or apiKeyHeader
Path
personIdstring(AnyId)^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$write-onlyrequired

A Borrower's unique identifier, tied to a person or a business. Can be Peach or a lender's external identifier.

loanIdstring(AnyId)^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$write-onlyrequired

The unique identifier of the Loan we wish to retrieve. Can be Peach or lender's external identifier.

Bodyapplication/jsonrequired
Any of:
externalIdstring or null, [ 1 .. 200 ] characters

A lender's identifier for an object.

After the object is successfully created, a lender can use ID or externalId identifiers to fetch the object.

To fetch the object using externalId you need to add ext- to the URL.

Note: Don't add ext- to the identifier value. For example: if the external identifier is ABCDE, then pass externalId=ABCDE and NOT ext-ABCDE when creating the object.

galileoCadstring

Galileo-generated identifier for a specific card.

galileoPrnstring

Unique 12-digit Galileo-generated account identifier.

isExternalboolean

When true (default), Peach does not interact with the card directly; the object is for visualization/filter purposes only. When false, Peach will call out to / receive events from the external card system (e.g. Lithic) and issuerId plus the issuer-specific card token field (e.g. marqetaCardToken, lithicCardToken, or galileoCad) are required.

Default:true
issuerIdstring

The card issuer/vendor unique identifier. The card issuer must be configured in Peach.

lithicAccountTokenstring

Lithic-generated identifier for an account holder (consumer or business).

lithicCardTokenstring

Lithic-generated identifier for a specific card product.

marqetaBusinessTokenstring

Marqeta-generated identifier for a specific business.

marqetaCardProductTokenstring

Marqeta-generated identifier for a specific card product.

marqetaCardTokenstring

Lender or Marqeta-generated unique identifier for the card.

marqetaUserTokenstring

Marqeta-generated identifier for a specific user.

statusstring

The lender-owned status of the card. Peach does not auto-update this field from issuer webhooks. Defaults to active on creation if not provided. This is separate from cardDetails.status which reflects the issuer-driven internal status.

Default:"active"
Enum:"active""inactive""blocked""closed""expired"
cardDetailsobject(CardDetailsWithPanAndCvv)

The card details. The status field here reflects the issuer-driven internal status. Prefer the top-level status field for the lender-owned status.

cardBalancesobject

The card balances. Only applicable to virtualCard type card objects.

typestring

The type of card issued. For loanType installment, only the only allowable value is virtualCard. For loanType lineOfCredit, virtual and credit card are accepted.

Value:"virtualCard"
POST
/people/{personId}/loans/{loanId}/cards
curl -i -X POST \
  'https://sandboxapi.peach.finance/api/people/{personId}/loans/{loanId}/cards' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "externalId": "string",
    "galileoCad": "string",
    "galileoPrn": "string",
    "isExternal": true,
    "issuerId": "string",
    "lithicAccountToken": "string",
    "lithicCardToken": "string",
    "marqetaBusinessToken": "string",
    "marqetaCardProductToken": "string",
    "marqetaCardToken": "string",
    "marqetaUserToken": "string",
    "status": "active",
    "cardDetails": {
      "address": {
        "POBox": "string",
        "addressLine1": "string",
        "addressLine2": "string",
        "city": "string",
        "country": "string",
        "countyOrRegion": "string",
        "postalCode": "string",
        "state": "strin"
      },
      "cardNumberLastFour": "string",
      "expirationMonth": 12,
      "expirationYear": 2025,
      "firstName": "string",
      "fulfillmentStatus": "issued",
      "lastName": "string",
      "network": "visa",
      "nickname": "string",
      "status": "inactive",
      "usageType": "singleUse",
      "pan": "string"
    },
    "cardBalances": {
      "originalAmount": 0.1
    },
    "type": "virtualCard"
  }'

Responses

Success

Bodyapplication/json
messagestring

Description of the server action or error.

statusinteger

HTTP status code.

dataVirtual card (object) or Credit card (object)(Card)
Any of:
Response
{ "message": "string", "status": 0, "data": { "createdAt": "2019-08-24T14:15:22Z", "deletedAt": "2019-08-24T14:15:22Z", "id": "string", "updatedAt": "2019-08-24T14:15:22Z", "externalId": "string", "galileoCad": "string", "galileoPrn": "string", "isExternal": true, "issuerId": "string", "lithicAccountToken": "string", "lithicCardToken": "string", "marqetaBusinessToken": "string", "marqetaCardProductToken": "string", "marqetaCardToken": "string", "marqetaUserToken": "string", "status": "active", "cardDetails": {}, "cardBalances": {}, "type": "virtualCard" } }