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

# payments

> One charge, from a billing system that is not connected.

## payments.upsert

```ts theme={null}
const [payment, error] = await crm.payments.upsert({
  partyId: contact.id,
  externalId: charge.id,
  amount: 4900,
  currency: "USD",
  chargedAt: charge.createdAt,
});
```

**partyId** `string` *required*

The CRM's id for the customer, from [`contacts.upsert`](https://docs.revenuebee.ai/sdk/upsert-contact) or
[`contacts.resolve`](https://docs.revenuebee.ai/sdk/resolve-contact).

**externalId** `string` *required*

Your billing system's id. Send it again, with `amountRefunded`, when money goes back.

**amount** `number` *required*

Minor units charged.

**amountRefunded** `number`

Minor units given back. 0 when omitted.

**currency** `string` *required*

Three letters, such as `USD`.

**chargedAt** `string` *required*

ISO 8601.

**description** `string`

What it was for.

Returns the payment, with the CRM's `id`.

## payments.delete

```ts theme={null}
await crm.payments.delete({ paymentId: payment.id });
```

**paymentId** `string` *required*

The CRM's `id`, from `payments.upsert`.

One from a connected Stripe account cannot be deleted here: it belongs to Stripe.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.