# Organization API: Customer Portal: Credit

> The 6 Organization API operations for credit.

Source: https://www.coritan.com/docs/api/reference/organizations/customer-portal/credit/

Part of [Customer Portal](/docs/api/reference/organizations/customer-portal/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/portal/credit`](#op-get-api-v1-orgs-org-slug-portal-credit) | Get my credit balance |
| POST | [`/api/v1/orgs/{org_slug}/portal/credit/topup/charge`](#op-post-api-v1-orgs-org-slug-portal-credit-topup-charge) | Charge a saved payment method and credit the org customer balance (USD) |
| POST | [`/api/v1/orgs/{org_slug}/portal/credit/topup/checkout`](#op-post-api-v1-orgs-org-slug-portal-credit-topup-checkout) | Hosted checkout to buy USD credit for an org customer |
| POST | [`/api/v1/orgs/{org_slug}/portal/credit/topup/confirm-payment`](#op-post-api-v1-orgs-org-slug-portal-credit-topup-confirm-payment) | Finalize a credit top-up PaymentIntent after SCA and credit the balance |
| POST | [`/api/v1/orgs/{org_slug}/portal/credit/topup/pay-intent`](#op-post-api-v1-orgs-org-slug-portal-credit-topup-pay-intent) | Create an in-page Stripe Payment Element intent for a credit top-up |
| POST | [`/api/v1/orgs/{org_slug}/portal/credit/topup/paypal-capture`](#op-post-api-v1-orgs-org-slug-portal-credit-topup-paypal-capture) | Capture PayPal order and credit org customer balance |

### Get my credit balance {#op-get-api-v1-orgs-org-slug-portal-credit}

`GET /api/v1/orgs/{org_slug}/portal/credit`

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `limit` | query | integer | no | Default: `20`. |
| `offset` | query | integer | no | Default: `0`. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Charge a saved payment method and credit the org customer balance (USD) {#op-post-api-v1-orgs-org-slug-portal-credit-topup-charge}

`POST /api/v1/orgs/{org_slug}/portal/credit/topup/charge`

Charge a saved payment method and credit the org customer balance (USD).

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |
| `amount` | query | number or string | yes |
| `payment_method_id` | query | integer | yes |
| `currency` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Hosted checkout to buy USD credit for an org customer {#op-post-api-v1-orgs-org-slug-portal-credit-topup-checkout}

`POST /api/v1/orgs/{org_slug}/portal/credit/topup/checkout`

Hosted checkout to buy USD credit for an org customer.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |
| `amount` | query | number or string | yes |
| `currency` | query | string | no |
| `gateway_name` | query | string | no |
| `return_url` | query | string | no |
| `cancel_url` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Finalize a credit top-up PaymentIntent after SCA and credit the balance {#op-post-api-v1-orgs-org-slug-portal-credit-topup-confirm-payment}

`POST /api/v1/orgs/{org_slug}/portal/credit/topup/confirm-payment`

Finalize a credit top-up PaymentIntent after SCA and credit the balance.

USD credit comes from PaymentIntent metadata ``base_amount``.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |
| `gateway_name` | query | string | yes |
| `payment_intent_id` | query | string | yes |
| `amount` | query | number or string | no |
| `currency` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Create an in-page Stripe Payment Element intent for a credit top-up {#op-post-api-v1-orgs-org-slug-portal-credit-topup-pay-intent}

`POST /api/v1/orgs/{org_slug}/portal/credit/topup/pay-intent`

Create an in-page Stripe Payment Element intent for a credit top-up.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `amount` | query | number or string | yes |  |
| `currency` | query | string | no |  |
| `gateway_name` | query | string | no |  |
| `save_method` | query | boolean | no | Default: `False`. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Capture PayPal order and credit org customer balance {#op-post-api-v1-orgs-org-slug-portal-credit-topup-paypal-capture}

`POST /api/v1/orgs/{org_slug}/portal/credit/topup/paypal-capture`

Capture PayPal order and credit org customer balance.

USD credit is derived from order ``custom_id=topup:<usd>``; optional
``amount`` may assert within $0.02.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |
| `order_id` | query | string | yes |
| `gateway_name` | query | string | yes |
| `amount` | query | number or string | no |
| `currency` | query | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
