# Credit Card Webhooks (BETA)

> This request notifies merchants on changes to a existing customer's saved credit card information.

Source: https://help.boltapp.com/api-reference/merchant-callback-reference/webhooks/transactionwebhooksbeta

`POST /webhooks_credit_card`

## OpenAPI definition

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

```json
{
  "openapi": "3.2.0",
  "info": {
    "version": "1.0.0",
    "title": "Merchant Callback API Reference",
    "description": "## About\nThe Merchant Callback API is a general endpoint on your eCommerce server that Bolt calls to receive information necessary for operating the checkout process.\n\n**Note**: You must also reference the [Bolt API](/api-bolt) when building a custom cart integration.\n\n### URL Options\nYou can set the URL(s) for your Merchant Callback API in the [Bolt Merchant dashboard](https://merchant.boltapp.com).\n- **v1**: v1 endpoints are individualized and described in the subsections below with unique URLs (e.g., `/order_shipping_and_tax`)\n- **Universal**: The \"Universal API\" is one endpoint (instead of many) that handles all events described in this spec; the methods and payloads are identical, however you only need to use one URL.\n\nNeed more information? See our [Developer reference articles](/developers/references/) for **environment details**, **error codes**, and more.\n"
  },
  "servers": [
    {
      "url": "https://merchant-url.com/api"
    }
  ],
  "paths": {
    "/webhooks_credit_card": {
      "post": {
        "summary": "Credit Card Webhooks (BETA)",
        "operationId": "TransactionWebhooksBeta",
        "description": "This request notifies merchants on changes to a existing customer's saved credit card information.\n",
        "security": [
          {
            "ApiKeyAuth": [
              "X-API-Key"
            ]
          }
        ],
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/bolt_hmac_param"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/webhooks_credit_card"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/webhooks_transaction"
          },
          "422": {
            "$ref": "#/components/responses/webhooks_transaction_error"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "bolt_hmac_param": {
        "in": "header",
        "name": "X-Bolt-Hmac-Sha256",
        "schema": {
          "type": "string"
        },
        "description": "Bolt sends a signed HMAC for hook verification"
      }
    },
    "requestBodies": {
      "webhooks_credit_card": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "credit_card_deleted"
                  ],
                  "examples": [
                    "credit_card_deleted"
                  ]
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "credit_card"
                  ],
                  "examples": [
                    "credit_card"
                  ]
                },
                "data": {
                  "type": "object",
                  "description": "This is a generic wrapper for the merchant's data. Open to see properties.",
                  "properties": {
                    "user": {
                      "$ref": "#/components/schemas/credit_card_user"
                    },
                    "credit_card": {
                      "$ref": "#/components/schemas/credit_card"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "credit_card_user": {
        "type": "object",
        "description": "The credit card user.",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/consumer_id"
          },
          "first_name": {
            "$ref": "#/components/schemas/first_name"
          },
          "last_name": {
            "$ref": "#/components/schemas/last_name"
          },
          "phones": {
            "$ref": "#/components/schemas/phones_with_country_code"
          },
          "emails": {
            "$ref": "#/components/schemas/emails"
          }
        }
      },
      "consumer_id": {
        "type": "string",
        "description": "The card-holder's unique ID. **Nullable** for Transactions Details.",
        "examples": [
          "b2vghjk2v4c5fgdh3jak"
        ]
      },
      "first_name": {
        "type": "string",
        "description": "The person's first name.",
        "examples": [
          "Charlotte"
        ]
      },
      "last_name": {
        "type": "string",
        "description": "The person's last name.",
        "examples": [
          "Charles"
        ]
      },
      "phones_with_country_code": {
        "type": "array",
        "description": "A list of phone numbers.",
        "items": {
          "type": "object",
          "description": "A phone number with country code.",
          "properties": {
            "id": {
              "$ref": "#/components/schemas/phone_id"
            },
            "number": {
              "$ref": "#/components/schemas/phone"
            },
            "country_code": {
              "$ref": "#/components/schemas/phone_country_code"
            },
            "status": {
              "$ref": "#/components/schemas/phone_status"
            },
            "priority": {
              "$ref": "#/components/schemas/phone_priority"
            }
          }
        }
      },
      "phone_id": {
        "type": "string",
        "description": "This is the ID for the phone number associated with the shopper.",
        "examples": [
          "123"
        ]
      },
      "phone": {
        "type": "string",
        "description": "A phone number without the country code.",
        "examples": [
          "867-5309"
        ]
      },
      "phone_country_code": {
        "type": "string",
        "description": "A phone number's country code.",
        "examples": [
          "1"
        ]
      },
      "phone_status": {
        "type": "string",
        "description": "This is the status of the contact method.",
        "enum": [
          "active",
          "pending",
          "inactive"
        ],
        "examples": [
          "active"
        ]
      },
      "phone_priority": {
        "type": "string",
        "description": "This is the priority of the contact method. This field's contents are not displayed in the transaction details view.",
        "enum": [
          "primary",
          "listed"
        ],
        "examples": [
          "primary"
        ]
      },
      "emails": {
        "type": "array",
        "description": "A list of email addresses. **Nullable** for Transactions Details.",
        "items": {
          "type": "object",
          "description": "An object of user email.",
          "properties": {
            "id": {
              "$ref": "#/components/schemas/email_id"
            },
            "address": {
              "$ref": "#/components/schemas/email"
            },
            "status": {
              "$ref": "#/components/schemas/email_status"
            },
            "priority": {
              "$ref": "#/components/schemas/email_priority"
            }
          }
        }
      },
      "email_id": {
        "type": "string",
        "description": "This is the ID for the email address associated with the shopper.",
        "examples": [
          "123"
        ]
      },
      "email": {
        "type": "string",
        "description": "The person's email address.",
        "examples": [
          "my.email@gmail.com"
        ]
      },
      "email_status": {
        "type": "string",
        "description": "This is the status of the contact method.",
        "enum": [
          "active",
          "pending",
          "inactive"
        ],
        "examples": [
          "active"
        ]
      },
      "email_priority": {
        "type": "string",
        "description": "This is the priority of the contact method. This field's contents are not displayed in the transaction details view.",
        "enum": [
          "primary",
          "listed"
        ],
        "examples": [
          "primary"
        ]
      },
      "credit_card": {
        "type": "object",
        "description": "A credit card.",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/card_id"
          },
          "last4": {
            "$ref": "#/components/schemas/card_last4"
          },
          "bin": {
            "$ref": "#/components/schemas/card_bin"
          },
          "expiration": {
            "$ref": "#/components/schemas/card_expiration"
          },
          "display_network": {
            "$ref": "#/components/schemas/card_network"
          },
          "token_type": {
            "$ref": "#/components/schemas/card_token_type"
          },
          "priority": {
            "$ref": "#/components/schemas/card_priority"
          },
          "status": {
            "$ref": "#/components/schemas/card_status"
          }
        }
      },
      "card_id": {
        "type": "string",
        "description": "The card's ID. **Nullable** for Transactions Details.",
        "examples": [
          "AB3rJKam5DhYE"
        ]
      },
      "card_last4": {
        "type": "string",
        "description": "The card's last 4 digits. **Nullable** for Transactions Details.",
        "examples": [
          "4021"
        ]
      },
      "card_bin": {
        "type": "string",
        "description": "The card's BIN. **Nullable** for Transactions Details.",
        "examples": [
          "402201"
        ]
      },
      "card_expiration": {
        "type": "integer",
        "description": "The card's expiration. **Nullable** for Transactions Details.",
        "examples": [
          1654041600000
        ]
      },
      "card_network": {
        "type": "string",
        "description": "The card's network. **Nullable** for Transactions Details.",
        "enum": [
          "American Express",
          "Diners Club",
          "Discover",
          "JCB",
          "MasterCard",
          "Union Pay",
          "Visa"
        ],
        "examples": [
          "Visa"
        ]
      },
      "card_token_type": {
        "type": "string",
        "description": "The card's token type. **Nullable** for Transactions Details.",
        "enum": [
          "vantiv",
          "applepay",
          "bolt",
          "stripe",
          "plcc"
        ],
        "examples": [
          "bolt"
        ]
      },
      "card_priority": {
        "type": "string",
        "description": "The priority for the card.",
        "enum": [
          "primary",
          "listed"
        ],
        "examples": [
          "primary"
        ]
      },
      "card_status": {
        "type": "string",
        "description": "The card's status. **Nullable** for Transactions Details.",
        "enum": [
          "active",
          "created",
          "inactive",
          "transient"
        ],
        "examples": [
          "active"
        ]
      },
      "error": {
        "type": "object",
        "properties": {
          "code": {
            "$ref": "#/components/schemas/code"
          },
          "data": {
            "$ref": "#/components/schemas/reasons"
          }
        }
      },
      "code": {
        "type": "integer",
        "format": "int64",
        "description": "This is an error code.",
        "examples": [
          2001005
        ]
      },
      "reasons": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/reason"
        }
      },
      "reason": {
        "type": "object",
        "description": "The reason for the error.",
        "properties": {
          "reason": {
            "type": "string",
            "examples": [
              "This product is out of stock."
            ]
          }
        }
      }
    },
    "responses": {
      "webhooks_transaction": {
        "description": "Webhooks Transaction Response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "status"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "succeeded",
                    "failed"
                  ],
                  "examples": [
                    "succeeded"
                  ]
                }
              }
            }
          }
        }
      },
      "webhooks_transaction_error": {
        "description": "Webhooks Transaction Response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "status"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "succeeded",
                    "failed"
                  ],
                  "examples": [
                    "failed"
                  ]
                },
                "error": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Admins and Developers can obtain their Bolt API key from the Bolt Merchant Dashboard."
      }
    }
  }
}
```
