> ## Documentation Index
> Fetch the complete documentation index at: https://docs.megaport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment Webhook Events

> This help topic describes the payment webhook events.

export const Anchor = ({name}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Anchor -';
  if (name === undefined || name === null || name === 'undefined') {
    console.error(`${errorPrefix} \`name\` must have a value — rendering an empty string instead`);
    return <></>;
  }
  const raw = typeof name === 'string' ? name : JSON.stringify(name);
  const id = raw.replace(/\s+/g, '-').replace(/[^A-Za-z0-9_-]/g, '').replace(/-+/g, '-').replace(/^-+|-+$/g, '');
  if (!id) {
    console.error(`${errorPrefix} \`name\` "${name}" sanitizes to an empty id — rendering an empty string instead`);
    return <></>;
  }
  return <a style={{
    scrollMarginTop: 'var(--scroll-mt)'
  }} id={id}></a>;
};

This topic describes the payment events sent by Megaport's webhooks.

<Anchor name="payment-card-registered" />

## payment.card.registered

`payment.card.registered` is sent when a payment card is registered.

The payload of this event has the following structure:

* `company_uid` (string, UUID)
* `metadata` (object)
  * `environment` (string)
* `schema_version` (string)
* `timestamp` (string, date-time)
* `type` (string)
* `data` (object)
  * `auto_pay` (boolean)
  * `billing_market` (string)
  * `last_four_digits` (string)

For example:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "company_uid": "681ef39b-436b-40dd-a914-26391db2689c",
  "metadata": {
    "environment": "production"
  },
  "schema_version": "1",
  "timestamp": "2026-04-23T10:29:12Z",
  "type": "payment.card.registered",
  "data": {
    "auto_pay": true,
    "billing_market": "US",
    "last_four_digits": "1234"
  }
}
```

<Anchor name="payment-card-registration-failed" />

## payment.card.registration.failed

`payment.card.registration.failed` is sent when a payment card registration failed.

The payload of this event has the following structure:

* `company_uid` (string, UUID)
* `metadata` (object)
  * `environment` (string)
* `schema_version` (string)
* `timestamp` (string, date-time)
* `type` (string)
* `data` (object)
  * `billing_market` (string)
  * `failure_reason` (string)
  * `last_four_digits` (string)

For example:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "company_uid": "681ef39b-436b-40dd-a914-26391db2689c",
  "metadata": {
    "environment": "production"
  },
  "schema_version": "1",
  "timestamp": "2026-04-23T10:29:12Z",
  "type": "payment.card.registration.failed",
  "data": {
    "billing_market": "US",
    "failure_reason": "Do Not Honor",
    "last_four_digits": "1234"
  }
}
```

<Anchor name="payment-card-removed" />

## payment.card.removed

`payment.card.removed` is sent when a payment card is removed.

The payload of this event has the following structure:

* `company_uid` (string, UUID)
* `metadata` (object)
  * `environment` (string)
* `schema_version` (string)
* `timestamp` (string, date-time)
* `type` (string)
* `data` (object)
  * `billing_market` (string)
  * `last_four_digits` (string)

For example:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "company_uid": "681ef39b-436b-40dd-a914-26391db2689c",
  "metadata": {
    "environment": "production"
  },
  "schema_version": "1",
  "timestamp": "2026-04-23T10:29:12Z",
  "type": "payment.card.removed",
  "data": {
    "billing_market": "US",
    "last_four_digits": "1234"
  }
}
```

<Anchor name="payment-card-updated" />

## payment.card.updated

`payment.card.updated` is sent when a payment card is updated.

The payload of this event has the following structure:

* `company_uid` (string, UUID)
* `metadata` (object)
  * `environment` (string)
* `schema_version` (string)
* `timestamp` (string, date-time)
* `type` (string)
* `data` (object)
  * `auto_pay` (boolean)
  * `billing_market` (string)
  * `last_four_digits` (string)

For example:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "company_uid": "681ef39b-436b-40dd-a914-26391db2689c",
  "metadata": {
    "environment": "production"
  },
  "schema_version": "1",
  "timestamp": "2026-04-23T10:29:12Z",
  "type": "payment.card.updated",
  "data": {
    "auto_pay": true,
    "billing_market": "US",
    "last_four_digits": "1234"
  }
}
```

<Anchor name="payment-failed" />

## payment.failed

`payment.failed` is sent when a payment failed.

The payload of this event has the following structure:

* `company_uid` (string, UUID)
* `metadata` (object)
  * `environment` (string)
* `schema_version` (string)
* `timestamp` (string, date-time)
* `type` (string)
* `data` (object)
  * `amount` (number, double)
  * `billing_market` (string)
  * `currency` (string)
  * `failure_reason` (string)
  * `payment_date` (string, date-time)
  * `payment_method` (string)
  * `reference` (string)

For example:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "company_uid": "681ef39b-436b-40dd-a914-26391db2689c",
  "metadata": {
    "environment": "production"
  },
  "schema_version": "1",
  "timestamp": "2026-04-23T10:29:12Z",
  "type": "payment.failed",
  "data": {
    "amount": 1000,
    "billing_market": "US",
    "currency": "AUD",
    "failure_reason": "Stripe blocked this charge as too risky.",
    "payment_date": "2026-05-12T03:00:00Z",
    "payment_method": "Credit Card",
    "reference": "007_asdf"
  }
}
```

<Anchor name="payment-succeeded" />

## payment.succeeded

`payment.succeeded` is sent when a payment was successful.

The payload of this event has the following structure:

* `company_uid` (string, UUID)
* `metadata` (object)
  * `environment` (string)
* `schema_version` (string)
* `timestamp` (string, date-time)
* `type` (string)
* `data` (object)
  * `amount` (number, double)
  * `billing_market` (string)
  * `currency` (string)
  * `payment_date` (string, date-time)
  * `payment_method` (string)
  * `reference` (string)

For example:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "company_uid": "681ef39b-436b-40dd-a914-26391db2689c",
  "metadata": {
    "environment": "production"
  },
  "schema_version": "1",
  "timestamp": "2026-04-23T10:29:12Z",
  "type": "payment.succeeded",
  "data": {
    "amount": 1000,
    "billing_market": "US",
    "currency": "AUD",
    "payment_date": "2026-05-12T03:00:00Z",
    "payment_method": "Credit Card",
    "reference": "ch_12345abcdefg"
  }
}
```
