# API reference

Every endpoint, generated from the OpenAPI document the API serves at `/api/v1/openapi.json`.

Base URL: `https://staging.globalymint.com`. Send an API key as `Authorization: Bearer <key>`.

## Customers

- [List customers (cursor-paginated)](https://staging.globalymint.com/docs/api/customers/list-customers.md): `GET /api/v1/customers`
- [Create a customer](https://staging.globalymint.com/docs/api/customers/create-a-customer.md): `POST /api/v1/customers`
- [Get a customer](https://staging.globalymint.com/docs/api/customers/get-a-customer.md): `GET /api/v1/customers/{id}`
- [Get a customer by your own id](https://staging.globalymint.com/docs/api/customers/get-a-customer-by-your-own-id.md): `GET /api/v1/customers/by-external-id/{externalId}`
- [Create or update a customer by your own id](https://staging.globalymint.com/docs/api/customers/create-or-update-a-customer-by-your-own-id.md): `PUT /api/v1/customers/by-external-id/{externalId}`
- [Customer balance ledger](https://staging.globalymint.com/docs/api/customers/customer-balance-ledger.md): `GET /api/v1/customers/{id}/balance-transactions`
- [List a customer’s subscriptions](https://staging.globalymint.com/docs/api/customers/list-a-customers-subscriptions.md): `GET /api/v1/customers/{id}/subscriptions`
- [List a customer’s invoices](https://staging.globalymint.com/docs/api/customers/list-a-customers-invoices.md): `GET /api/v1/customers/{id}/invoices`

## Checkout

- [Open a hosted checkout session](https://staging.globalymint.com/docs/api/checkout/open-a-hosted-checkout-session.md): `POST /api/v1/checkout-sessions`

## Portal

- [Open a customer portal session](https://staging.globalymint.com/docs/api/portal/open-a-customer-portal-session.md): `POST /api/v1/portal-sessions`

## Pricing tables

- [List pricing tables](https://staging.globalymint.com/docs/api/pricing-tables/list-pricing-tables.md): `GET /api/v1/pricing-tables`
- [Create a pricing table](https://staging.globalymint.com/docs/api/pricing-tables/create-a-pricing-table.md): `POST /api/v1/pricing-tables`
- [Get a pricing table with its plans](https://staging.globalymint.com/docs/api/pricing-tables/get-a-pricing-table-with-its-plans.md): `GET /api/v1/pricing-tables/{id}`
- [Update a pricing table](https://staging.globalymint.com/docs/api/pricing-tables/update-a-pricing-table.md): `PATCH /api/v1/pricing-tables/{id}`
- [Delete a pricing table](https://staging.globalymint.com/docs/api/pricing-tables/delete-a-pricing-table.md): `DELETE /api/v1/pricing-tables/{id}`

## Subscriptions

- [List subscriptions (status-filtered, cursor-paginated)](https://staging.globalymint.com/docs/api/subscriptions/list-subscriptions.md): `GET /api/v1/subscriptions`
- [Create a subscription](https://staging.globalymint.com/docs/api/subscriptions/create-a-subscription.md): `POST /api/v1/subscriptions`
- [Get a subscription](https://staging.globalymint.com/docs/api/subscriptions/get-a-subscription.md): `GET /api/v1/subscriptions/{id}`
- [Update the seat count](https://staging.globalymint.com/docs/api/subscriptions/update-the-seat-count.md): `PATCH /api/v1/subscriptions/{id}`
- [Cancel a subscription (immediately or at period end)](https://staging.globalymint.com/docs/api/subscriptions/cancel-a-subscription.md): `POST /api/v1/subscriptions/{id}/cancel`
- [Pause a subscription](https://staging.globalymint.com/docs/api/subscriptions/pause-a-subscription.md): `POST /api/v1/subscriptions/{id}/pause`
- [Resume a paused subscription](https://staging.globalymint.com/docs/api/subscriptions/resume-a-paused-subscription.md): `POST /api/v1/subscriptions/{id}/resume`
- [Undo a scheduled cancel](https://staging.globalymint.com/docs/api/subscriptions/undo-a-scheduled-cancel.md): `POST /api/v1/subscriptions/{id}/reactivate`
- [Change plan (and optionally seats)](https://staging.globalymint.com/docs/api/subscriptions/change-plan.md): `POST /api/v1/subscriptions/{id}/change-plan`
- [Preview a plan change](https://staging.globalymint.com/docs/api/subscriptions/preview-a-plan-change.md): `POST /api/v1/subscriptions/{id}/change-plan/preview`
- [Add an item (add-on / per-seat item)](https://staging.globalymint.com/docs/api/subscriptions/add-an-item.md): `POST /api/v1/subscriptions/{id}/items`
- [Change an item’s quantity](https://staging.globalymint.com/docs/api/subscriptions/change-an-items-quantity.md): `PATCH /api/v1/subscriptions/{id}/items/{itemId}`
- [Remove an item](https://staging.globalymint.com/docs/api/subscriptions/remove-an-item.md): `DELETE /api/v1/subscriptions/{id}/items/{itemId}`
- [Drop a plan change staged for period end](https://staging.globalymint.com/docs/api/subscriptions/drop-a-plan-change-staged-for-period-end.md): `DELETE /api/v1/subscriptions/{id}/pending-change`
- [A subscription’s invoices with their lines](https://staging.globalymint.com/docs/api/subscriptions/a-subscriptions-invoices-with-their-lines.md): `GET /api/v1/subscriptions/{id}/invoices`

## Invoices

- [List invoices](https://staging.globalymint.com/docs/api/invoices/list-invoices.md): `GET /api/v1/invoices`
- [Generate a draft invoice for a subscription](https://staging.globalymint.com/docs/api/invoices/generate-a-draft-invoice-for-a-subscription.md): `POST /api/v1/invoices`
- [Get an invoice (with line items)](https://staging.globalymint.com/docs/api/invoices/get-an-invoice.md): `GET /api/v1/invoices/{id}`
- [Finalize a draft invoice](https://staging.globalymint.com/docs/api/invoices/finalize-a-draft-invoice.md): `POST /api/v1/invoices/{id}/finalize`
- [Charge a finalized invoice](https://staging.globalymint.com/docs/api/invoices/charge-a-finalized-invoice.md): `POST /api/v1/invoices/{id}/charge`
- [Mark an invoice void](https://staging.globalymint.com/docs/api/invoices/mark-an-invoice-void.md): `POST /api/v1/invoices/{id}/void`
- [Mark an invoice uncollectible](https://staging.globalymint.com/docs/api/invoices/mark-an-invoice-uncollectible.md): `POST /api/v1/invoices/{id}/uncollectible`
- [List refunds on an invoice](https://staging.globalymint.com/docs/api/invoices/list-refunds-on-an-invoice.md): `GET /api/v1/invoices/{id}/refunds`
- [Refund a settled invoice, wholly or in part](https://staging.globalymint.com/docs/api/invoices/refund-a-settled-invoice-wholly-or-in-part.md): `POST /api/v1/invoices/{id}/refunds`
- [Mint a hosted pay-page link for an invoice](https://staging.globalymint.com/docs/api/invoices/mint-a-hosted-pay-page-link-for-an-invoice.md): `POST /api/v1/invoices/{id}/pay-link`
- [Credit notes on an invoice](https://staging.globalymint.com/docs/api/invoices/credit-notes-on-an-invoice.md): `GET /api/v1/invoices/{id}/credit-notes`
- [Issue a credit note](https://staging.globalymint.com/docs/api/invoices/issue-a-credit-note.md): `POST /api/v1/invoices/{id}/credit-notes`
- [Get a credit note](https://staging.globalymint.com/docs/api/invoices/get-a-credit-note.md): `GET /api/v1/credit-notes/{id}`
- [Record a bank-transfer (or other offline) payment](https://staging.globalymint.com/docs/api/invoices/record-a-bank-transfer-payment.md): `POST /api/v1/invoices/{id}/record-payment`
- [Create a one-off invoice (charged to the card on file, or sent with a pay link)](https://staging.globalymint.com/docs/api/invoices/create-a-one-off-invoice.md): `POST /api/v1/invoices/one-off`
- [Download an invoice PDF](https://staging.globalymint.com/docs/api/invoices/download-an-invoice-pdf.md): `GET /api/v1/invoices/{id}/pdf`

## Payments

- [Open a SetupIntent so the customer can save a payment method](https://staging.globalymint.com/docs/api/payments/open-a-setupintent-so-the-customer-can-save-a-payment-method.md): `POST /api/v1/customers/{id}/setup-intent`
- [List a customer’s saved payment methods](https://staging.globalymint.com/docs/api/payments/list-a-customers-saved-payment-methods.md): `GET /api/v1/customers/{id}/payment-methods`
- [Attach a payment method to a customer](https://staging.globalymint.com/docs/api/payments/attach-a-payment-method-to-a-customer.md): `POST /api/v1/customers/{id}/payment-methods`
- [Remove a saved payment method](https://staging.globalymint.com/docs/api/payments/remove-a-saved-payment-method.md): `DELETE /api/v1/customers/{id}/payment-methods/{pmId}`
- [Read the invoice behind a pay link (public)](https://staging.globalymint.com/docs/api/payments/read-the-invoice-behind-a-pay-link.md): `GET /api/v1/pay/{token}`
- [Open the PaymentIntent for a pay link (public)](https://staging.globalymint.com/docs/api/payments/open-the-paymentintent-for-a-pay-link.md): `POST /api/v1/pay/{token}/intent`

## Invoice pay links

- [Download the invoice PDF from a hosted pay link (public)](https://staging.globalymint.com/docs/api/invoice-pay-links/download-the-invoice-pdf-from-a-hosted-pay-link.md): `GET /api/v1/pay/{token}/pdf`

## Usage

- [Ingest a usage event](https://staging.globalymint.com/docs/api/usage/ingest-a-usage-event.md): `POST /api/v1/usage-events`
- [Aggregate usage for a subscription over a period](https://staging.globalymint.com/docs/api/usage/aggregate-usage-for-a-subscription-over-a-period.md): `GET /api/v1/usage-events/aggregate`
- [List meters](https://staging.globalymint.com/docs/api/usage/list-meters.md): `GET /api/v1/meters`
- [Create a meter](https://staging.globalymint.com/docs/api/usage/create-a-meter.md): `POST /api/v1/meters`
- [Get a meter](https://staging.globalymint.com/docs/api/usage/get-a-meter.md): `GET /api/v1/meters/{id}`
- [Update a meter](https://staging.globalymint.com/docs/api/usage/update-a-meter.md): `PATCH /api/v1/meters/{id}`
- [Record usage (one event or a batch of up to 1000)](https://staging.globalymint.com/docs/api/usage/record-usage.md): `POST /api/v1/meter-events`
- [A meter’s aggregate for one customer over [from, to)](https://staging.globalymint.com/docs/api/usage/a-meters-aggregate-for-one-customer-over-from-to.md): `GET /api/v1/meter-events/summary`

## Entitlements

- [List features](https://staging.globalymint.com/docs/api/entitlements/list-features.md): `GET /api/v1/features`
- [Create a feature](https://staging.globalymint.com/docs/api/entitlements/create-a-feature.md): `POST /api/v1/features`
- [Get a feature](https://staging.globalymint.com/docs/api/entitlements/get-a-feature.md): `GET /api/v1/features/{id}`
- [Update a feature (key and type are immutable)](https://staging.globalymint.com/docs/api/entitlements/update-a-feature.md): `PATCH /api/v1/features/{id}`
- [A plan’s grants](https://staging.globalymint.com/docs/api/entitlements/a-plans-grants.md): `GET /api/v1/plans/{id}/entitlements`
- [Replace a plan’s grants](https://staging.globalymint.com/docs/api/entitlements/replace-a-plans-grants.md): `PUT /api/v1/plans/{id}/entitlements`
- [A customer’s entitlement snapshot](https://staging.globalymint.com/docs/api/entitlements/a-customers-entitlement-snapshot.md): `GET /api/v1/customers/{id}/entitlements`
- [Entitlement snapshot by your own customer id](https://staging.globalymint.com/docs/api/entitlements/entitlement-snapshot-by-your-own-customer-id.md): `GET /api/v1/customers/by-external-id/{externalId}/entitlements`
- [The tenant’s default (Free) plan](https://staging.globalymint.com/docs/api/entitlements/the-tenants-default-plan.md): `GET /api/v1/entitlement-settings`
- [Set the default (Free) plan](https://staging.globalymint.com/docs/api/entitlements/set-the-default-plan.md): `PUT /api/v1/entitlement-settings`
- [Spend credits from a pool](https://staging.globalymint.com/docs/api/entitlements/spend-credits-from-a-pool.md): `POST /api/v1/customers/{id}/credits/consume`
- [Add credits to a pool](https://staging.globalymint.com/docs/api/entitlements/add-credits-to-a-pool.md): `POST /api/v1/customers/{id}/credits/grant`
- [Spend credits from a pool](https://staging.globalymint.com/docs/api/entitlements/spend-credits-from-a-pool-post.md): `POST /api/v1/customers/by-external-id/{externalId}/credits/consume`
- [Add credits to a pool](https://staging.globalymint.com/docs/api/entitlements/add-credits-to-a-pool-post.md): `POST /api/v1/customers/by-external-id/{externalId}/credits/grant`

## Catalog

- [List products (cursor-paginated)](https://staging.globalymint.com/docs/api/catalog/list-products.md): `GET /api/v1/products`
- [Create a product](https://staging.globalymint.com/docs/api/catalog/create-a-product.md): `POST /api/v1/products`
- [Get a product](https://staging.globalymint.com/docs/api/catalog/get-a-product.md): `GET /api/v1/products/{id}`
- [Update a product (name, description, portal settings)](https://staging.globalymint.com/docs/api/catalog/update-a-product.md): `PATCH /api/v1/products/{id}`
- [List plans (cursor-paginated)](https://staging.globalymint.com/docs/api/catalog/list-plans.md): `GET /api/v1/plans`
- [Create a plan](https://staging.globalymint.com/docs/api/catalog/create-a-plan.md): `POST /api/v1/plans`
- [Get a plan (with price points)](https://staging.globalymint.com/docs/api/catalog/get-a-plan.md): `GET /api/v1/plans/{id}`
- [Update a plan (name, active and metadata only; pricing is immutable)](https://staging.globalymint.com/docs/api/catalog/update-a-plan.md): `PATCH /api/v1/plans/{id}`
- [Set per-currency price points for a plan](https://staging.globalymint.com/docs/api/catalog/set-per-currency-price-points-for-a-plan.md): `PUT /api/v1/plans/{id}/price-points`
- [Create or update a plan by its code (versioned on a price change)](https://staging.globalymint.com/docs/api/catalog/create-or-update-a-plan-by-its-code.md): `PUT /api/v1/plans/by-code/{code}`
- [Preview a price change to a later version of this plan](https://staging.globalymint.com/docs/api/catalog/preview-a-price-change-to-a-later-version-of-this-plan.md): `GET /api/v1/plans/{id}/price-changes/preview`
- [Schedule a price change for every subscriber of this plan](https://staging.globalymint.com/docs/api/catalog/schedule-a-price-change-for-every-subscriber-of-this-plan.md): `POST /api/v1/plans/{id}/price-changes`
- [List price changes](https://staging.globalymint.com/docs/api/catalog/list-price-changes.md): `GET /api/v1/price-changes`
- [Get a price change with its subscribers](https://staging.globalymint.com/docs/api/catalog/get-a-price-change-with-its-subscribers.md): `GET /api/v1/price-changes/{id}`
- [Cancel a scheduled price change](https://staging.globalymint.com/docs/api/catalog/cancel-a-scheduled-price-change.md): `POST /api/v1/price-changes/{id}/cancel`

## Discounts

- [List coupons](https://staging.globalymint.com/docs/api/discounts/list-coupons.md): `GET /api/v1/coupons`
- [Create a coupon](https://staging.globalymint.com/docs/api/discounts/create-a-coupon.md): `POST /api/v1/coupons`
- [Get a coupon](https://staging.globalymint.com/docs/api/discounts/get-a-coupon.md): `GET /api/v1/coupons/{id}`
- [Update a coupon (what it takes off is immutable)](https://staging.globalymint.com/docs/api/discounts/update-a-coupon.md): `PATCH /api/v1/coupons/{id}`
- [Archive a coupon](https://staging.globalymint.com/docs/api/discounts/archive-a-coupon.md): `DELETE /api/v1/coupons/{id}`
- [List promotion codes](https://staging.globalymint.com/docs/api/discounts/list-promotion-codes.md): `GET /api/v1/promotion-codes`
- [Create a promotion code](https://staging.globalymint.com/docs/api/discounts/create-a-promotion-code.md): `POST /api/v1/promotion-codes`
- [Get a promotion code](https://staging.globalymint.com/docs/api/discounts/get-a-promotion-code.md): `GET /api/v1/promotion-codes/{id}`
- [Update a promotion code](https://staging.globalymint.com/docs/api/discounts/update-a-promotion-code.md): `PATCH /api/v1/promotion-codes/{id}`
- [Archive a promotion code](https://staging.globalymint.com/docs/api/discounts/archive-a-promotion-code.md): `DELETE /api/v1/promotion-codes/{id}`
- [Would this code work? (redeems nothing)](https://staging.globalymint.com/docs/api/discounts/would-this-code-work.md): `POST /api/v1/promotion-codes/validate`
- [Active discounts on a subscription](https://staging.globalymint.com/docs/api/discounts/active-discounts-on-a-subscription.md): `GET /api/v1/subscriptions/{id}/discounts`
- [Apply a coupon or promotion code to a subscription](https://staging.globalymint.com/docs/api/discounts/apply-a-coupon-or-promotion-code-to-a-subscription.md): `POST /api/v1/subscriptions/{id}/discounts`
- [Remove a discount](https://staging.globalymint.com/docs/api/discounts/remove-a-discount.md): `DELETE /api/v1/subscriptions/{id}/discounts/{discountId}`

## Tax rates

- [List tax rates](https://staging.globalymint.com/docs/api/tax-rates/list-tax-rates.md): `GET /api/v1/tax-rates`
- [Create a tax rate](https://staging.globalymint.com/docs/api/tax-rates/create-a-tax-rate.md): `POST /api/v1/tax-rates`
- [Get a tax rate](https://staging.globalymint.com/docs/api/tax-rates/get-a-tax-rate.md): `GET /api/v1/tax-rates/{id}`
- [Update a tax rate (percentage and location are immutable)](https://staging.globalymint.com/docs/api/tax-rates/update-a-tax-rate.md): `PATCH /api/v1/tax-rates/{id}`
- [Archive a tax rate](https://staging.globalymint.com/docs/api/tax-rates/archive-a-tax-rate.md): `DELETE /api/v1/tax-rates/{id}`
- [Preview tax on a basket (writes nothing)](https://staging.globalymint.com/docs/api/tax-rates/preview-tax-on-a-basket.md): `POST /api/v1/tax-rates/calculate`
- [Set a customer’s tax status](https://staging.globalymint.com/docs/api/tax-rates/set-a-customers-tax-status.md): `PUT /api/v1/customers/{id}/tax`

## Webhooks

- [List endpoints](https://staging.globalymint.com/docs/api/webhooks/list-endpoints.md): `GET /api/v1/webhook-endpoints`
- [Register an endpoint](https://staging.globalymint.com/docs/api/webhooks/register-an-endpoint.md): `POST /api/v1/webhook-endpoints`
- [Update an endpoint](https://staging.globalymint.com/docs/api/webhooks/update-an-endpoint.md): `PATCH /api/v1/webhook-endpoints/{id}`
- [Remove an endpoint](https://staging.globalymint.com/docs/api/webhooks/remove-an-endpoint.md): `DELETE /api/v1/webhook-endpoints/{id}`
- [Rotate the signing secret](https://staging.globalymint.com/docs/api/webhooks/rotate-the-signing-secret.md): `POST /api/v1/webhook-endpoints/{id}/rotate-secret`
- [Retire the previous signing secret now](https://staging.globalymint.com/docs/api/webhooks/retire-the-previous-signing-secret-now.md): `POST /api/v1/webhook-endpoints/{id}/end-secret-overlap`
- [Send a test event](https://staging.globalymint.com/docs/api/webhooks/send-a-test-event.md): `POST /api/v1/webhook-endpoints/{id}/test`
- [Replay failed deliveries since a date](https://staging.globalymint.com/docs/api/webhooks/replay-failed-deliveries-since-a-date.md): `POST /api/v1/webhook-endpoints/{id}/replay`
- [Deliveries for an endpoint](https://staging.globalymint.com/docs/api/webhooks/deliveries-for-an-endpoint.md): `GET /api/v1/webhook-endpoints/{id}/deliveries`
- [Replay a delivery](https://staging.globalymint.com/docs/api/webhooks/replay-a-delivery.md): `POST /api/v1/webhook-endpoints/deliveries/{id}/replay`

## API keys

- [List API keys](https://staging.globalymint.com/docs/api/api-keys/list-api-keys.md): `GET /api/v1/api-keys`
- [Create an API key](https://staging.globalymint.com/docs/api/api-keys/create-an-api-key.md): `POST /api/v1/api-keys`
- [Revoke an API key](https://staging.globalymint.com/docs/api/api-keys/revoke-an-api-key.md): `DELETE /api/v1/api-keys/{id}`
- [Roll an API key](https://staging.globalymint.com/docs/api/api-keys/roll-an-api-key.md): `POST /api/v1/api-keys/{id}/roll`

## Settings

- [Get tenant settings](https://staging.globalymint.com/docs/api/settings/get-tenant-settings.md): `GET /api/v1/settings`
- [Update tenant settings](https://staging.globalymint.com/docs/api/settings/update-tenant-settings.md): `PATCH /api/v1/settings`
- [Close the workspace](https://staging.globalymint.com/docs/api/settings/close-the-workspace.md): `DELETE /api/v1/settings`
- [Read the audit log](https://staging.globalymint.com/docs/api/settings/read-the-audit-log.md): `GET /api/v1/audit-log`

## Team

- [List workspace members](https://staging.globalymint.com/docs/api/team/list-workspace-members.md): `GET /api/v1/team/members`
- [Change a member’s role](https://staging.globalymint.com/docs/api/team/change-a-members-role.md): `PATCH /api/v1/team/members/{userId}`
- [Remove a member](https://staging.globalymint.com/docs/api/team/remove-a-member.md): `DELETE /api/v1/team/members/{userId}`
- [List invites](https://staging.globalymint.com/docs/api/team/list-invites.md): `GET /api/v1/team/invites`
- [Invite someone to the workspace](https://staging.globalymint.com/docs/api/team/invite-someone-to-the-workspace.md): `POST /api/v1/team/invites`
- [Revoke a pending invite](https://staging.globalymint.com/docs/api/team/revoke-a-pending-invite.md): `DELETE /api/v1/team/invites/{id}`
- [Preview an invitation (public)](https://staging.globalymint.com/docs/api/team/preview-an-invitation.md): `GET /api/v1/team/invites/{token}`
- [Accept an invitation](https://staging.globalymint.com/docs/api/team/accept-an-invitation.md): `POST /api/v1/team/invites/{token}/accept`

## Integrations

- [Stripe configuration status](https://staging.globalymint.com/docs/api/integrations/stripe-configuration-status.md): `GET /api/v1/gateway-credentials/stripe`
- [Install per-tenant Stripe credentials](https://staging.globalymint.com/docs/api/integrations/install-per-tenant-stripe-credentials.md): `PUT /api/v1/gateway-credentials/stripe`
- [Remove Stripe credentials for one mode](https://staging.globalymint.com/docs/api/integrations/remove-stripe-credentials-for-one-mode.md): `DELETE /api/v1/gateway-credentials/stripe/{mode}`
- [Check the Stripe connection for one mode](https://staging.globalymint.com/docs/api/integrations/check-the-stripe-connection-for-one-mode.md): `POST /api/v1/gateway-credentials/stripe/{mode}/check`

## Onboarding

- [Merchant activation checklist](https://staging.globalymint.com/docs/api/onboarding/merchant-activation-checklist.md): `GET /api/v1/onboarding`

## Dashboard

- [Merchant home-page summary](https://staging.globalymint.com/docs/api/dashboard/merchant-home-page-summary.md): `GET /api/v1/dashboard`
