Store Credit Accounts API Routes

GET /store/store-credit-accounts#

List Customer's Store Credit Accounts

Retrieve the logged-in customer's store credit accounts. The store credit accounts can be filtered by fields such as id. The store credit accounts can also be sorted or paginated.

Plugin: This API route is only available when the loyalty plugin is installed in the MedusaGo application.

Authentication: cookie session, JWT bearer token.

Header parameters

x-publishable-api-keystring
Publishable API Key created in the Medusa Admin.
x-medusa-localestringOptional
The locale in BCP 47 format to retrieve localized content.
Example: en-US

Query parameters

currency_codestringOptional
Filter by the store credit account's currency code.
Example: usd
created_atobjectOptional
Filter by a store credit account's creation date. Accepts the filter operators.
updated_atobjectOptional
Filter by a store credit account's update date. Accepts the filter operators.
limitnumberOptional
Limit the number of items returned in the list.
offsetnumberOptional
The number of items to skip when retrieving a list.
orderstringOptional
The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.
fieldsstringOptional
Comma-separated fields that should be included in the returned data. If a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.
$andobject[]Optional
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
$orobject[]Optional
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
localestringOptional
The locale in BCP 47 format to retrieve localized content.
Example: en-US
with_deletedbooleanOptional
Whether to include deleted records in the result.

Request examples

Responses

200 OK

limitnumber
The maximum number of store credit accounts to return.
offsetnumber
The number of store credit accounts to skip before retrieving the results.
countnumber
The total number of store credit accounts available.
store_credit_accountsobject[]
The list of store credit accounts.
estimate_countnumberOptional
The store credit account's estimate count.

400, 401, 404, 409, 422, 500: an error response is returned.


POST /store/store-credit-accounts/claim#

Claim a Store Credit Account

Claim a store credit account as the logged-in customer. The store credit account must not belong to another customer, and it must have amount available to claim. This is typically used to claim anonymous store credit accounts, such as those created for guest users or through gift cards.

Plugin: This API route is only available when the loyalty plugin is installed in the MedusaGo application.

Authentication: cookie session, JWT bearer token.

Header parameters

x-publishable-api-keystring
Publishable API Key created in the Medusa Admin.
x-medusa-localestringOptional
The locale in BCP 47 format to retrieve localized content.
Example: en-US

Query parameters

localestringOptional
The locale in BCP 47 format to retrieve localized content.
Example: en-US

Request body (application/json)

codestring
The store credit account's code.

Request examples

Responses

200 OK

store_credit_accountobject
The store credit account's details.

400, 401, 404, 409, 422, 500: an error response is returned.


GET /store/store-credit-accounts/{id}#

Get Customer's Store Credit Account

Retrieve logged-in customer's store credit account by its ID. You can expand the store credit account's relations or select the fields that should be returned.

Plugin: This API route is only available when the loyalty plugin is installed in the MedusaGo application.

Authentication: cookie session, JWT bearer token.

Path parameters

idstring
The store credit account's ID.

Header parameters

x-publishable-api-keystring
Publishable API Key created in the Medusa Admin.
x-medusa-localestringOptional
The locale in BCP 47 format to retrieve localized content.
Example: en-US

Query parameters

localestringOptional
The locale in BCP 47 format to retrieve localized content.
Example: en-US

Request examples

Responses

200 OK

store_credit_accountobject
The store credit account's details.

400, 401, 404, 409, 422, 500: an error response is returned.

Found a problem with this page?Report Issue
Edited Nov 14·Edit this page