> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/payments/integrations/providers/authorize-net.md).

# Authorize.Net

Connect Authorize.Net to Payments — keys, webhook URL and signing secret.

Authorize.Net is a card payment gateway, common in the United States. Norbix gets its payment and recurring-billing webhooks.

## Get your credentials

1. Sign in to the Authorize.Net Merchant Interface — a [sandbox account](https://developer.authorize.net/hello_world.html) for tests.
2. Open **Account → Settings → Security Settings → API Credentials & Keys**. Copy the **API Login ID**, create a new **Transaction Key**, and create a new **Signature Key**.
3. Save the integration in Cloud once (below) to get its **Webhook URL**.
4. Open **Account → Webhooks → Add Endpoint**, paste the webhook URL and pick the events (see [Webhooks](https://developer.authorize.net/api/reference/features/webhooks.html)). Put the Signature Key into **Webhook Signature Key** in Cloud, type the transaction key again, and **Save**.

## Connect it in Cloud

**Where:** Payments → Integrations → **Add New Integration** → Authorize.Net → **Connect** · `/projects/<project>/payments/integrations/new/authorize-net`

| Field                 | Required | What it does                                                                                                                                                 | Example                 |
| --------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- |
| Merchant Login ID     | yes      | Your API Login ID.                                                                                                                                           | `your-login-id`         |
| Environment           | yes      | `sandbox` or `production` — type the word.                                                                                                                   | `sandbox`               |
| Transaction Key       | yes      | Lets Norbix call Authorize.Net. Secret; encrypted on save and never shown again — type it again whenever you press **Save**.                                 | `your-transaction-key`  |
| Webhook Signature Key | no       | Checks the `X-ANET-Signature` header of each call — needed for payment triggers. It is shown as plain text while you type and is not shown again after save. | `YOURSIGNATUREKEY`      |
| Integration Name      | yes      | The name in your integrations list.                                                                                                                          | `Authorize.Net sandbox` |

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-841ad2da9e0cf2d1d3439ace93b1b482b6c87cb4%2Fauthorize-net-form-1.png?alt=media" alt="New Authorize.Net Integration form filled with example values"><figcaption><p>The filled form (placeholder values).</p></figcaption></figure>

Press **Save**. The page turns into **Editing Authorize.Net integration** with the badges **ENABLED**, **NOT TESTED**, **NOT CONFIRMED**, the integration id (`int_6RKm3W6WckniGLhCDFPTND`) and the **Webhook URL** — `<Hub address>/v3/payments/webhooks/<account id>/<project id>/authorizenet/<integration id>`; outside PROD it ends with `?env=<ENV>`. Copy it with its copy button and paste it at Authorize.Net (see **Get your credentials**). **Received webhooks** at the bottom lists every call Authorize.Net makes to it.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-b5c65dac89930ae4df6922bb7e8812eb2968c36d%2Fauthorize-net-saved-2.png?alt=media" alt="Editing Authorize.Net integration after Save: ENABLED, NOT TESTED, NOT CONFIRMED, the integration id and the Webhook URL"><figcaption><p>After save: the webhook URL to paste at Authorize.Net.</p></figcaption></figure>

Events Norbix accepts from Authorize.Net (pick them at Authorize.Net and in your [trigger](/codemash/cloud/payments/triggers/new.md)): `net.authorize.payment.authcapture.created`, `net.authorize.payment.capture.created`, `net.authorize.payment.refund.created`, `net.authorize.payment.void.created`, `net.authorize.customer.subscription.created`, `net.authorize.customer.subscription.cancelled`.

## Test and set as default

**Test integration** signs in to Authorize.Net with the login id and transaction key. With the made-up values of this example it failed with Authorize.Net's error `E00003` (*The '…transactionKey' element is invalid*). See [Test an integration](/codemash/cloud/payments/integrations/test.md). Payments has no default integration — every enabled integration gets its own calls ([Default integration](/codemash/cloud/payments/integrations/set-default.md)).

## Common errors

| Message                                      | Cause                                                        | Fix                                                         |
| -------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------------- |
| Authorize.Net authentication failed … E00003 | The transaction key is not in Authorize.Net's format.        | Copy a new transaction key, type it, **Save**, test again.  |
| **Received webhooks** shows **400**          | The Signature Key is empty or old.                           | Create a new Signature Key, put it into Cloud and **Save**. |
| Required                                     | A required field is empty — secrets count too on every save. | Fill the field; type every secret again before **Save**.    |

## Do it from code

```ts
const { id } = await norbix.hub.payments.savePaymentsIntegration({
  integration: {
    provider: 'AuthorizeNet',
    integrationName: 'Authorize.Net live',
    isEnabled: true,
    merchantLoginId: 'your-login-id',
    environment: 'production',
    transactionKey: 'your-transaction-key',
    webhookSignatureKey: 'YOURSIGNATUREKEY',
  } as any, // the TS type knows only the shared fields
});
console.log(id); // int_…
```

```sh
norbix hub payments integration save --integration '{"provider":"AuthorizeNet","integrationName":"Authorize.Net live","isEnabled":true,"merchantLoginId":"your-login-id","environment":"production","transactionKey":"your-transaction-key","webhookSignatureKey":"YOURSIGNATUREKEY"}'
```

The client setup is on the [Payments page](/codemash/cloud/payments.md#use-it-from-code). API: [Save Payments Integration](/codemash/api-reference/payments/integrations/save-payments-integration.md)
