Skip to content

pos-get-card-info ​

Method: GET
Path: /pos/payments/card-info

Tags: Payments

Summary ​

Get card information

Description ​

Retrieve card information based on the initial 9 digits (card BIN) of the card number.

Pos SDK Usage ​

SDK Method: pos.getCardInfo()

Example:

typescript
const { data, error } = await pos.getCardInfo({ cardbin: "411111" });

if (error) {
  console.error("Card lookup failed:", error.message);
} else {
  console.log(`${data.card_info.brand} ${data.card_info.type}`);
}

TypeScript Definition ​

typescript
"pos-get-card-info": {
        parameters: {
            query: {
                /** @description Initial 9 digits of card number (card BIN) */
                cardbin: string;
            };
            header?: never;
            path?: never;
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            card_info: components["schemas"]["CardbinInfo"];
                        };
                    };
                };
            };
            /** @description Invalid card BIN, incomplete or inactive payment-provider configuration, or a rejected gateway lookup (payment-gateway-error). */
            400: components["responses"]["BadRequest"];
            401: components["responses"]["Unauthorized"];
            403: components["responses"]["Forbidden"];
            408: components["responses"]["RequestTimeout"];
            500: components["responses"]["InternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

Component References ​

ReferenceResolves To
components["schemas"]["CardbinInfo"]CardbinInfo
components["responses"]["BadRequest"]BadRequest
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["RequestTimeout"]RequestTimeout
components["responses"]["InternalServerError"]InternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Parameters ​

  • cardbin (query): Initial 9 digits of card number (card BIN)

Responses ​

200 ​

OK

400 ​

Bad request

401 ​

Authentication failed. Codes include token-required, token-expired and token_not_valid for an invalid or expired token.

403 ​

Access denied. token-required requires an authenticated session; permission-denied means the caller cannot access this resource. On POS, session-expired requires signing in again.

408 ​

500 ​

The request failed because of an unexpected error.

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "operationId": "pos-get-card-info",
  "summary": "Get card information",
  "description": "Retrieve card information based on the initial 9 digits (card BIN) of the card number.",
  "parameters": [
    {
      "name": "cardbin",
      "in": "query",
      "description": "Initial 9 digits of card number (card BIN)",
      "required": true,
      "schema": {
        "type": "string",
        "minLength": 9
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "card_info": {
                    "$ref": "#/components/schemas/CardbinInfo"
                  }
                },
                "required": [
                  "card_info"
                ],
                "type": "object"
              }
            },
            "required": [
              "message",
              "success",
              "content"
            ]
          }
        }
      },
      "links": {
        "CreateOrderWithCard": {
          "operationId": "create-pos-order",
          "description": "Create a POS order from a cart."
        }
      }
    },
    "400": {
      "description": "Invalid card BIN, incomplete or inactive payment-provider configuration, or a rejected gateway lookup (payment-gateway-error).",
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "408": {
      "$ref": "#/components/responses/RequestTimeout"
    },
    "500": {
      "$ref": "#/components/responses/InternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-get-card-info"
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    "Payments"
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-name-override": "getCardInfo"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: