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"];
};
};
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
404: components["responses"]["NotFound"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["CardbinInfo"] | CardbinInfo |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["NotFound"] | NotFound |
Parameters
- cardbin (query): Initial 9 digits of card number (card BIN)
Responses
200
OK
400
Bad request
401
Not authorized for given operation on the Resource
404
Requested resource not found
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"
}
}
],
"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": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "payments",
"x-speakeasy-ignore": false,
"x-speakeasy-name-override": "getCardInfo"
}Auto-generated from OpenAPI spec and TypeScript definitions