# Retrieve a tokenized test credit card

> Retrieve a test credit card that can be used to process payments in your Bolt testing environment. The response includes the card's Bolt credit card token.

Source: https://help.boltapp.com/api-reference/embeddable-checkout-v3/testing/testingcreditcardget

`POST /testing/credit-cards`

## OpenAPI definition

This endpoint as it appears in the OpenAPI document, with every schema it references included.

```json
{
  "openapi": "3.2.0",
  "info": {
    "version": "3.3.22",
    "title": "Bolt API Reference",
    "description": "A comprehensive Bolt API reference for interacting with Accounts, Payments, Orders and more.",
    "termsOfService": "https://www.boltapp.com/end-user-terms",
    "contact": {
      "name": "Bolt",
      "email": "merchantsupport@boltapp.com",
      "url": "https://help.boltapp.com/api-bolt/"
    }
  },
  "servers": [
    {
      "url": "https://{environment}.boltapp.com/v3",
      "variables": {
        "environment": {
          "enum": [
            "api",
            "api-sandbox"
          ],
          "default": "api-sandbox"
        }
      }
    }
  ],
  "paths": {
    "/testing/credit-cards": {
      "post": {
        "summary": "Retrieve a tokenized test credit card",
        "operationId": "testingCreditCardGet",
        "x-speakeasy-name-override": "GetCreditCard",
        "description": "Retrieve a test credit card that can be used to process payments in your Bolt testing environment. The response includes the card's Bolt credit card token.",
        "tags": [
          "Testing"
        ],
        "security": [
          {
            "api-key": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "The expected authorization result when using the generated token for a payment.",
                    "enum": [
                      "approve",
                      "decline"
                    ],
                    "examples": [
                      "approve"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully generated test credit card details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/test-credit-card"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/response-4xx"
          },
          "default": {
            "$ref": "#/components/responses/response-default"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "test-credit-card": {
        "required": [
          "network",
          "bin",
          "last4",
          "expiration",
          "token"
        ],
        "type": "object",
        "properties": {
          "network": {
            "$ref": "#/components/schemas/credit-card-network"
          },
          "bin": {
            "type": "string",
            "description": "The Bank Identification Number (BIN). This is typically the first 4 to 6 digits of the account number.",
            "pattern": "^\\d+$",
            "examples": [
              "411111"
            ]
          },
          "last4": {
            "type": "string",
            "description": "The account number's last four digits.",
            "pattern": "^\\d{4}$",
            "examples": [
              "1004"
            ]
          },
          "expiration": {
            "type": "string",
            "format": "date-time",
            "description": "The token's expiration date. Tokens used past their expiration will be rejected.",
            "examples": [
              "2023-10-31T06:00:00Z"
            ]
          },
          "token": {
            "type": "string",
            "description": "The Bolt token associated with the credit card.",
            "examples": [
              "a1B2c3D4e5F6G7H8i9J0k1L2m3N4o5P6Q7r8S9t0"
            ]
          }
        }
      },
      "credit-card-network": {
        "type": "string",
        "description": "The credit card's network.",
        "enum": [
          "visa",
          "mastercard",
          "amex",
          "discover",
          "jcb",
          "dinersclub",
          "unionpay",
          "alliancedata",
          "citiplcc"
        ],
        "x-oapi-codegen-extra-tags": {
          "validate": "required"
        },
        "examples": [
          "visa"
        ]
      },
      "error": {
        "type": "object",
        "required": [
          ".tag",
          "message"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "unauthorized",
              "forbidden",
              "unprocessable_request",
              "not_found"
            ],
            "description": "The type of error returned",
            "examples": [
              "unprocessable_request"
            ]
          },
          "message": {
            "type": "string",
            "description": "A human-readable error message, which might include information specific to the request that was made.",
            "examples": [
              "We were unable to process your request."
            ]
          }
        }
      },
      "field-error": {
        "type": "object",
        "description": "An error that pertains to validation of a specific field in the request.",
        "required": [
          ".tag",
          "message",
          "field"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "invalid_input_parameter"
            ],
            "description": "The type of error returned",
            "examples": [
              "invalid_input_parameter"
            ]
          },
          "message": {
            "type": "string",
            "description": "A human-readable error message, which might include information specific to the request that was made.",
            "examples": [
              "We were unable to process your request."
            ]
          },
          "field": {
            "type": "string",
            "description": "The field (in its hierarchical form) that is failing validation.",
            "examples": [
              "address.phone"
            ]
          }
        }
      }
    },
    "responses": {
      "response-4xx": {
        "description": "An error has occurred, and further details are contained in the response",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/error"
                },
                {
                  "$ref": "#/components/schemas/field-error"
                }
              ]
            }
          }
        }
      },
      "response-default": {
        "description": "An error has occurred, and no further details are provided (e.g. 5xx errors)"
      }
    },
    "securitySchemes": {
      "api-key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "oauth": {
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "/v1/oauth/authorize",
            "refreshUrl": "/v1/oauth/token",
            "tokenUrl": "/v1/oauth/token",
            "scopes": {
              "bolt.account.manage": "This scope grants permissions to perform read/edit/delete actions on Bolt Account data",
              "bolt.account.view": "This scope grants permissions to perform read only actions on Bolt Account data",
              "openid": "This scope grants permissions that enable Bolt Single Sign-On (SSO) by granting a JSON Web Token (JWT) that stores account data."
            }
          }
        },
        "type": "oauth2"
      }
    }
  }
}
```
