get-card-info
Method: GET
Path: /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.
Storefront SDK Usage
SDK Method: sdk.payments.getCardInfo()
Example:
typescript
const { data, error } = await sdk.payments.getCardInfo({
cardbin: "411111111"
});
if (error) {
console.error("Failed to get card information:", error.message);
} else {
console.log("Card information:", data.card_info);
}TypeScript Definition
typescript
"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"];
500: components["responses"]["InternalServerError"];
504: components["responses"]["GatewayTimeout"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["CardbinInfo"] | CardbinInfo |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["Forbidden"] | Forbidden |
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.
500
The request failed because of an unexpected error.
504
The request timed out.
OpenAPI Definition
json
{
"tags": [
"Payments"
],
"operationId": "get-card-info",
"summary": "Get card information",
"description": "Retrieve card information based on the initial 9 digits (card BIN) of the card number.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/get-card-info",
"description": "API reference for the get-card-info operation"
},
"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",
"required": [
"message",
"success",
"content"
],
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"card_info": {
"$ref": "#/components/schemas/CardbinInfo"
}
},
"required": [
"card_info"
],
"type": "object"
}
}
}
}
},
"links": {
"CreateOrderWithCard": {
"operationId": "create-order",
"description": "Create an order using card payment. Use `card_info.brand` to select the `payment_method` and match a `gateway_reference_id` from `list-payment-methods`."
}
}
},
"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"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "payments",
"x-speakeasy-ignore": false,
"x-speakeasy-name-override": "getCardInfo"
}Auto-generated from OpenAPI spec and TypeScript definitions