Card Products

Retrieve card product information for your company

Overview

The Card Products endpoints allow you to retrieve information about card products available in your company. Card products define the types of cards that can be ordered for users, including physical cards, virtual cards, and their associated configurations.

Note: All endpoints require proper authentication. Make sure to include the Authorization: Bearer {access_token} header and the x-appid: {clientId} header in your requests.

List Card Products

GET /md/api/CardProduct

Retrieves a list of card products. You can filter, sort, and paginate the results using query parameters.

Query Parameters

Use the filter query parameter to filter, sort, and paginate results. The filter should be a JSON object passed as a URL-encoded string.

Parameter Type Description
filter object (JSON) Filter, sorting, and pagination options. See filter options below.

Filter Options

The filter object supports the following properties:

Property Type Description
where object Filter conditions. See where clause examples below.
fields array Array of field names to include in the response
order string Sort order (e.g., "name ASC" or "created DESC")
limit number Maximum number of results to return
skip number Number of results to skip (for pagination)

Where Clause Examples

Common filter conditions for the where clause:

Field Example Description
companyId {"companyId": "your-company-id"} Filter by company ID
status {"status": "active"} Filter by status: "active", "inactive", "deleted", or "archived"
isVirtual {"isVirtual": true} Filter virtual cards (true) or physical cards (false)
default {"default": true} Filter default card products
vendor {"vendor": "marqeta"} Filter by vendor: "marqeta", "dipocket", or "icc"
productType {"productType": "physical"} Filter by product type

Example Requests

Get all active card products for a company:

curl -X GET "https://sandbox.custodia-tech.com/md/api/CardProduct?filter=%7B%22where%22%3A%7B%22companyId%22%3A%22your-company-id%22%2C%22status%22%3A%22active%22%7D%7D" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "x-appid: YOUR_CLIENT_ID"

Using JavaScript (fetch) - Get active card products:

const filter = {
  where: {
    companyId: 'your-company-id',
    status: 'active'
  },
  order: 'name ASC'
};

const filterParam = encodeURIComponent(JSON.stringify(filter));
const response = await fetch(`https://sandbox.custodia-tech.com/md/api/CardProduct?filter=${filterParam}`, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${accessToken}`,
    'x-appid': clientId
  }
});

const cardProducts = await response.json();

Get only virtual card products:

const filter = {
  where: {
    companyId: 'your-company-id',
    status: 'active',
    isVirtual: true
  }
};

const filterParam = encodeURIComponent(JSON.stringify(filter));
const response = await fetch(`https://sandbox.custodia-tech.com/md/api/CardProduct?filter=${filterParam}`, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${accessToken}`,
    'x-appid': clientId
  }
});

const virtualCardProducts = await response.json();

Get default card product:

const filter = {
  where: {
    companyId: 'your-company-id',
    status: 'active',
    default: true
  },
  limit: 1
};

const filterParam = encodeURIComponent(JSON.stringify(filter));
const response = await fetch(`https://sandbox.custodia-tech.com/md/api/CardProduct?filter=${filterParam}`, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${accessToken}`,
    'x-appid': clientId
  }
});

const defaultProduct = await response.json();

Response

Success Response (200 OK)

[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Corporate Physical Card",
    "status": "active",
    "companyId": "your-company-id",
    "vendor": "marqeta",
    "productType": "physical",
    "isVirtual": false,
    "default": true,
    "supportsDigitalWallet": true,
    "startDate": "2024-01-01T00:00:00.000Z",
    "endDate": null,
    "description": "Standard corporate physical card",
    "orderInstructions": {
      "preferredOrderMethod": "direct",
      "address2use": "user"
    },
    "supportedOperations": ["activate", "terminate", "suspend"],
    "paymentNetwork": "visa",
    "created": "2024-01-01T00:00:00.000Z",
    "modified": "2024-01-01T00:00:00.000Z"
  },
  {
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "name": "Virtual Card",
    "status": "active",
    "companyId": "your-company-id",
    "vendor": "marqeta",
    "productType": "virtual",
    "isVirtual": true,
    "default": false,
    "supportsDigitalWallet": true,
    "startDate": "2024-01-01T00:00:00.000Z",
    "endDate": null,
    "description": "Virtual card for online transactions",
    "orderInstructions": {
      "preferredOrderMethod": "direct"
    },
    "supportedOperations": ["activate", "terminate"],
    "paymentNetwork": "visa",
    "created": "2024-01-01T00:00:00.000Z",
    "modified": "2024-01-01T00:00:00.000Z"
  }
]

Get Card Product by ID

GET /md/api/CardProduct/{cardProductId}

Retrieves detailed information about a specific card product by its ID.

Path Parameters

Parameter Type Required Description
cardProductId string Yes The unique identifier of the card product

Query Parameters

Parameter Type Description
filter object (JSON) Optional filter to specify which fields to include (e.g., {"fields": ["id", "name", "status"]})

Example Request

Using cURL:

curl -X GET https://sandbox.custodia-tech.com/md/api/CardProduct/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "x-appid: YOUR_CLIENT_ID"

Using JavaScript (fetch):

const cardProductId = '550e8400-e29b-41d4-a716-446655440000';

const response = await fetch(`https://sandbox.custodia-tech.com/md/api/CardProduct/${cardProductId}`, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${accessToken}`,
    'x-appid': clientId
  }
});

const cardProduct = await response.json();

Response

Success Response (200 OK)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Corporate Physical Card",
  "status": "active",
  "companyId": "your-company-id",
  "vendor": "marqeta",
  "vendorRecordId": "vendor-product-id",
  "productType": "physical",
  "isVirtual": false,
  "default": true,
  "supportsDigitalWallet": true,
  "startDate": "2024-01-01T00:00:00.000Z",
  "endDate": null,
  "description": "Standard corporate physical card",
  "orderInstructions": {
    "preferredOrderMethod": "direct",
    "address2use": "user",
    "expedite": false
  },
  "supportedOperations": ["activate", "terminate", "suspend", "disassociate"],
  "paymentNetwork": "visa",
  "businessPartnerCode": null,
  "paymentManagerCode": null,
  "availableToTeamsIds": [],
  "created": "2024-01-01T00:00:00.000Z",
  "modified": "2024-01-01T00:00:00.000Z"
}

Card Product Fields

The following fields are available in card product responses:

Field Type Description
id string Unique identifier for the card product
name string Name of the card product
status string Status: "active", "inactive", "deleted", or "archived"
companyId string ID of the company this card product belongs to
vendor string Card provider vendor: "marqeta", "dipocket", or "icc"
vendorRecordId string Vendor-specific identifier for this card product
productType string Type of card product (e.g., "physical", "virtual")
isVirtual boolean Whether this is a virtual card (true) or physical card (false)
default boolean Whether this is the default card product for the company
supportsDigitalWallet boolean Whether the card supports digital wallet integration
startDate date Date when the card product becomes available
endDate date Date when the card product expires (null if no expiration)
description string Description of the card product
orderInstructions object Instructions for ordering cards from this product (see below)
supportedOperations array List of supported operations: "activate", "terminate", "suspend", etc.
paymentNetwork string Payment network: "visa", "mastercard", or "diners"
availableToTeamsIds array Array of team IDs that have access to this card product (empty array means available to all teams)

Order Instructions Object

The orderInstructions object contains information about how cards from this product can be ordered:

Field Type Description
preferredOrderMethod string Order method: "direct" (API ordering), "self-serviced-url" (user self-service)
address2use string Default address to use: "user" (user's address) or "business" (company address)
expedite boolean Whether expedited shipping is available
Tip: When ordering cards for users, you can use the card product ID from these endpoints. If you don't specify a card product ID when ordering, the system will use the default card product for the company.

Error Responses

All endpoints may return the following error responses:

Status Code Description Solution
401 Unauthorized Invalid or missing access token Verify your access token is valid and included in the Authorization header
404 Not Found Card product not found (for GET by ID) Verify the card product ID is correct and you have access to it
403 Forbidden Insufficient permissions Verify your access token has the required scopes and permissions