chore(docs): Generated References (automated) (#9961)

Generated the following references:
- `api_key`
- `cart`
- `cart_models`
- `core_flows`
- `customer`
- `fulfillment`
- `inventory_next`
- `js_sdk`
- `medusa_config`
- `modules`
- `order`
- `order_models`
- `payment`
- `pricing`
- `product`
- `promotion`
- `region`
- `stock_location_next`
- `tax`
- `tax_provider`
- `types`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
github-actions[bot]andOli Juhl authored and GitHub committed 2024-11-11 08:17:50 +00:00
1 parent 6ead7bf92d
commit fc01ae68c0
527 files changed
+407512 -404288

No files matched your search

@@ -2,10 +2,24 @@ import { TypeList } from "docs-ui"
# capture
This method captures a payment. It sends a request to the
[Capture Payment](https://docs.medusajs.com/api/admin#payments\_postpaymentsidcapture) API route.
The API route uses the `capturePayment` method of the payment provider associated with the payment's collection.
## Example
```ts
sdk.admin.payment.capture("paycol_123", {})
.then(({ payment }) => {
console.log(payment)
})
```
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminCapturePayment](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCapturePayment/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="capture"/>
<TypeList types={[{"name":"id","type":"`string`","description":"The payment's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminCapturePayment](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCapturePayment/page.mdx)","description":"The capture's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"amount","type":"`number`","description":"Custom amount to capture. If not specified, the\npayment's amount is captured.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the payment.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="capture"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminPaymentResponse","type":"[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"payment","type":"[AdminPayment](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPayment/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's total amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The ISO 3 character currency code of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the associated payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"refunds","type":"[AdminRefund](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRefund/page.mdx)[]","description":"The associated refunds.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"payment_collection","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)","description":"The associated payment collection.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"payment_session","type":"[AdminPaymentSession](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentSession/page.mdx)","description":"The payment session from which the payment is created.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"authorized_amount","type":"`number`","description":"The authorized amount of the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart_id","type":"`string`","description":"The ID of the associated cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"The ID of the associated order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_edit_id","type":"`string`","description":"The ID of the associated order edit.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the associated customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"The data relevant for the payment provider to process the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the payment was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the payment was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_at","type":"`string` \\| `Date`","description":"When the payment was captured.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"When the payment was canceled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_amount","type":"`number`","description":"The sum of the associated captures' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refunded_amount","type":"`number`","description":"The sum of the associated refunds' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captures","type":"[BaseCapture](../../../../../types/interfaces/types.BaseCapture/page.mdx)[]","description":"The associated captures.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="capture"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The payment's details.","expandable":false,"children":[{"name":"AdminPaymentResponse","type":"[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"payment","type":"[AdminPayment](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPayment/page.mdx)","description":"The payment's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's total amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The ISO 3 character currency code of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the associated payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"refunds","type":"[AdminRefund](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRefund/page.mdx)[]","description":"The associated refunds.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"payment_collection","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)","description":"The payment collection this payment belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_session","type":"[AdminPaymentSession](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentSession/page.mdx)","description":"The associated payment session.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"authorized_amount","type":"`number`","description":"The authorized amount of the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart_id","type":"`string`","description":"The ID of the associated cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"The ID of the associated order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_edit_id","type":"`string`","description":"The ID of the associated order edit.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the associated customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"The data relevant for the payment provider to process the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the payment was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the payment was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_at","type":"`string` \\| `Date`","description":"When the payment was captured.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"When the payment was canceled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_amount","type":"`number`","description":"The sum of the associated captures' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refunded_amount","type":"`number`","description":"The sum of the associated refunds' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captures","type":"[BaseCapture](../../../../../types/interfaces/types.BaseCapture/page.mdx)[]","description":"The associated captures.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="capture"/>
@@ -2,10 +2,52 @@ import { TypeList } from "docs-ui"
# list
This method retrieves a paginated list of payments. It sends a request to the
[List Payments](https://docs.medusajs.com/api/admin#payments\_getpayments) API route.
## Example
To retrieve the list of payments:
```ts
sdk.admin.payment.list()
.then(({ payments, count, limit, offset }) => {
console.log(payments)
})
```
To configure the pagination, pass the `limit` and `offset` query parameters.
For example, to retrieve only 10 items and skip 10 items:
```ts
sdk.admin.payment.list({
limit: 10,
offset: 10
})
.then(({ payments, count, limit, offset }) => {
console.log(payments)
})
```
Using the `fields` query parameter, you can specify the fields and relations to retrieve
in each payment:
```ts
sdk.admin.payment.list({
fields: "id,*payment_collection"
})
.then(({ payments, count, limit, offset }) => {
console.log(payments)
})
```
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
## Parameters
<TypeList types={[{"name":"query","type":"[AdminPaymentFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentFilters/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).",Line truncated
<TypeList types={[{"name":"query","type":"[AdminPaymentFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentFilters/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by payment ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by payment ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in tLine truncated
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminPaymentsResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminPaymentsResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminPaymentsResponse","type":"[AdminPaymentsResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminPaymentsResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminPaymentsResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminPaymentsResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The paginated list of payments.","expandable":false,"children":[{"name":"AdminPaymentsResponse","type":"[AdminPaymentsResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminPaymentsResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
@@ -2,10 +2,52 @@ import { TypeList } from "docs-ui"
# listPaymentProviders
This method retrieves a paginated list of payment providers. It sends a request to the
[List Payment Providers](https://docs.medusajs.com/api/admin#payments\_getpaymentspaymentproviders) API route.
## Example
To retrieve the list of payment providers:
```ts
sdk.admin.payment.listPaymentProviders()
.then(({ payment_providers, count, limit, offset }) => {
console.log(payment_providers)
})
```
To configure the pagination, pass the `limit` and `offset` query parameters.
For example, to retrieve only 10 items and skip 10 items:
```ts
sdk.admin.payment.listPaymentProviders({
limit: 10,
offset: 10
})
.then(({ payment_providers, count, limit, offset }) => {
console.log(payment_providers)
})
```
Using the `fields` query parameter, you can specify the fields and relations to retrieve
in each payment provider:
```ts
sdk.admin.payment.listPaymentProviders({
fields: "id,is_enabled"
})
.then(({ payment_providers, count, limit, offset }) => {
console.log(payment_providers)
})
```
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
## Parameters
<TypeList types={[{"name":"query","type":"[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`number`","description":"The maximum number of items to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`string`","description":"The field to sort by and in which order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_enabled","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`number`","description":"The maximum number of items to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`string`","description":"The field to sort by and in which order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_enabled","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`number`","description":"The maximum number of items to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`string`","description":"The field to sort by and in which order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_enabled","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)[]","description":"An array of filters to apply on the entity, where eaLine truncated
<TypeList types={[{"name":"query","type":"[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`number`","description":"The maximum number of items to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`string`","description":"The field to sort by and in which order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by payment provider ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_enabled","type":"`boolean`","description":"Whether the payment provider is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminGetPaymentProvidersParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPaymentProvidersParams/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or"Line truncated
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminPaymentProviderListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminPaymentProviderListResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminPaymentProviderListResponse","type":"[AdminPaymentProviderListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminPaymentProviderListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listPaymentProviders"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminPaymentProviderListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminPaymentProviderListResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The paginated list of payment providers.","expandable":false,"children":[{"name":"AdminPaymentProviderListResponse","type":"[AdminPaymentProviderListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminPaymentProviderListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listPaymentProviders"/>
@@ -2,10 +2,24 @@ import { TypeList } from "docs-ui"
# refund
This method refunds a payment. It sends a request to the
[Refund Payment](https://docs.medusajs.com/api/admin#payments\_postpaymentsidrefund) API route.
The API route uses the `refundPayment` method of the payment provider associated with the payment's collection.
## Example
```ts
sdk.admin.payment.refund("paycol_123", {})
.then(({ payment }) => {
console.log(payment)
})
```
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminRefundPayment](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRefundPayment/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_reason_id","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"note","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="refund"/>
<TypeList types={[{"name":"id","type":"`string`","description":"The payment's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminRefundPayment](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRefundPayment/page.mdx)","description":"The refund's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"amount","type":"`number`","description":"Custom amount to refund. If not specified, the\npayment's amount is refunded.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_reason_id","type":"`null` \\| `string`","description":"The ID of the refund's reason.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"note","type":"`null` \\| `string`","description":"A note to attach to the refund.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the payment.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="refund"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminPaymentResponse","type":"[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"payment","type":"[AdminPayment](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPayment/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's total amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The ISO 3 character currency code of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the associated payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"refunds","type":"[AdminRefund](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRefund/page.mdx)[]","description":"The associated refunds.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"payment_collection","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)","description":"The associated payment collection.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"payment_session","type":"[AdminPaymentSession](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentSession/page.mdx)","description":"The payment session from which the payment is created.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"authorized_amount","type":"`number`","description":"The authorized amount of the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart_id","type":"`string`","description":"The ID of the associated cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"The ID of the associated order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_edit_id","type":"`string`","description":"The ID of the associated order edit.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the associated customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"The data relevant for the payment provider to process the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the payment was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the payment was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_at","type":"`string` \\| `Date`","description":"When the payment was captured.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"When the payment was canceled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_amount","type":"`number`","description":"The sum of the associated captures' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refunded_amount","type":"`number`","description":"The sum of the associated refunds' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captures","type":"[BaseCapture](../../../../../types/interfaces/types.BaseCapture/page.mdx)[]","description":"The associated captures.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="refund"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The payment's details.","expandable":false,"children":[{"name":"AdminPaymentResponse","type":"[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"payment","type":"[AdminPayment](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPayment/page.mdx)","description":"The payment's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's total amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The ISO 3 character currency code of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the associated payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"refunds","type":"[AdminRefund](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRefund/page.mdx)[]","description":"The associated refunds.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"payment_collection","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)","description":"The payment collection this payment belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_session","type":"[AdminPaymentSession](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentSession/page.mdx)","description":"The associated payment session.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"authorized_amount","type":"`number`","description":"The authorized amount of the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart_id","type":"`string`","description":"The ID of the associated cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"The ID of the associated order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_edit_id","type":"`string`","description":"The ID of the associated order edit.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the associated customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"The data relevant for the payment provider to process the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the payment was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the payment was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_at","type":"`string` \\| `Date`","description":"When the payment was captured.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"When the payment was canceled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_amount","type":"`number`","description":"The sum of the associated captures' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refunded_amount","type":"`number`","description":"The sum of the associated refunds' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captures","type":"[BaseCapture](../../../../../types/interfaces/types.BaseCapture/page.mdx)[]","description":"The associated captures.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="refund"/>
@@ -2,10 +2,38 @@ import { TypeList } from "docs-ui"
# retrieve
This method retrieves a payment's details. It sends a request to the
[Get Payment](https://docs.medusajs.com/api/admin#payments\_getpaymentsid)
API route.
## Example
To retrieve a payment by its ID:
```ts
sdk.admin.payment.retrieve("pay_123")
.then(({ payment }) => {
console.log(payment)
})
```
To specify the fields and relations to retrieve:
```ts
sdk.admin.payment.retrieve("pay_123", {
fields: "id,*payment_collection"
})
.then(({ payment }) => {
console.log(payment)
})
```
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminPaymentFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentFilters/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[BasePaymentFilters](../../../../../types/interfaces/types.BasePaymentFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separateLine truncated
<TypeList types={[{"name":"id","type":"`string`","description":"The payment's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the payment.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminPaymentResponse","type":"[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"payment","type":"[AdminPayment](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPayment/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's total amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The ISO 3 character currency code of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the associated payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"refunds","type":"[AdminRefund](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRefund/page.mdx)[]","description":"The associated refunds.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"payment_collection","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)","description":"The associated payment collection.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"payment_session","type":"[AdminPaymentSession](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentSession/page.mdx)","description":"The payment session from which the payment is created.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"authorized_amount","type":"`number`","description":"The authorized amount of the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart_id","type":"`string`","description":"The ID of the associated cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"The ID of the associated order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_edit_id","type":"`string`","description":"The ID of the associated order edit.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the associated customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"The data relevant for the payment provider to process the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the payment was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the payment was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_at","type":"`string` \\| `Date`","description":"When the payment was captured.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"When the payment was canceled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_amount","type":"`number`","description":"The sum of the associated captures' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refunded_amount","type":"`number`","description":"The sum of the associated refunds' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captures","type":"[BaseCapture](../../../../../types/interfaces/types.BaseCapture/page.mdx)[]","description":"The associated captures.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The payment's details.","expandable":false,"children":[{"name":"AdminPaymentResponse","type":"[AdminPaymentResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"payment","type":"[AdminPayment](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPayment/page.mdx)","description":"The payment's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The payment's total amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The ISO 3 character currency code of the payment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the associated payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"refunds","type":"[AdminRefund](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRefund/page.mdx)[]","description":"The associated refunds.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"payment_collection","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)","description":"The payment collection this payment belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_session","type":"[AdminPaymentSession](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentSession/page.mdx)","description":"The associated payment session.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"authorized_amount","type":"`number`","description":"The authorized amount of the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart_id","type":"`string`","description":"The ID of the associated cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"The ID of the associated order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_edit_id","type":"`string`","description":"The ID of the associated order edit.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the associated customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"The data relevant for the payment provider to process the payment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the payment was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the payment was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_at","type":"`string` \\| `Date`","description":"When the payment was captured.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"When the payment was canceled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captured_amount","type":"`number`","description":"The sum of the associated captures' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refunded_amount","type":"`number`","description":"The sum of the associated refunds' amounts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"captures","type":"[BaseCapture](../../../../../types/interfaces/types.BaseCapture/page.mdx)[]","description":"The associated captures.","optional":true,"defaultValue":"","expandable":true,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>