xclade
Admin APIStore credit accounts

Get a Store Credit Account

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

GET
/admin/store-credit-accounts/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

The store credit account's ID.

Query Parameters

fields?string

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. The fields and relations to retrieve separated by commas.

Learn more in the API reference.

id?id|

Filter by the store credit account's ID.

customer_id?customer_id|

Filter by customer ID(s) to retrieve their store credit accounts.

transaction_group_id?transaction_group_id|

Filter by the associated transaction group's ID.

currency_code?currency_code|

Filter by currency code(s) to retrieve store credit accounts in specific currencies.

created_at?

Filter by a store credit account's creation date.

updated_at?

Filter by a store credit account's update date.

$and?

An array of filters to apply on the entity, where each item in the array is joined with an "and" condition.

$or?

An array of filters to apply on the entity, where each item in the array is joined with an "or" condition.

limit?number

Limit the number of items returned in the list.

offset?number

The number of items to skip when retrieving a list.

order?string

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 -.

Response Body

application/json

application/json

text/plain

application/json

application/json

application/json

application/json

curl -X GET "https://{tenant}.api.myxclade.com/admin/store-credit-accounts/string"
{
  "store_credit_account": {
    "customer": {
      "id": "string",
      "has_account": true,
      "groups": [
        {
          "id": "string",
          "name": "string",
          "customers": [
            {}
          ],
          "metadata": {},
          "created_at": "2019-08-24T14:15:22Z",
          "updated_at": "2019-08-24T14:15:22Z"
        }
      ],
      "email": "user@example.com",
      "default_billing_address_id": "string",
      "default_shipping_address_id": "string",
      "company_name": "string",
      "first_name": "string",
      "last_name": "string",
      "addresses": [
        {
          "id": "string",
          "address_name": "string",
          "is_default_shipping": true,
          "is_default_billing": true,
          "customer_id": "string",
          "company": "string",
          "first_name": "string",
          "last_name": "string",
          "address_1": "string",
          "address_2": "string",
          "city": "string",
          "country_code": "us",
          "province": "us-ca",
          "postal_code": "string",
          "phone": "string",
          "metadata": {},
          "created_at": "2019-08-24T14:15:22Z",
          "updated_at": "2019-08-24T14:15:22Z"
        }
      ],
      "phone": "string",
      "metadata": {},
      "created_by": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "deleted_at": "2019-08-24T14:15:22Z"
    },
    "id": "string",
    "customer_id": "string",
    "currency_code": "usd",
    "credits": 0,
    "debits": 0,
    "balance": 0,
    "transaction_groups": [
      {
        "id": "string",
        "code": "string",
        "credits": 0,
        "debits": 0,
        "balance": 0,
        "account": {},
        "metadata": {}
      }
    ],
    "metadata": {},
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}

{
  "message": "Discount must be set to dynamic",
  "type": "not_allowed"
}

"Unauthorized"
{
  "message": "Entity with id 1 was not found",
  "type": "not_found"
}
{
  "code": "unknown_error",
  "message": "The request conflicted with another request. You may retry the request with the provided Idempotency-Key.",
  "type": "QueryRunnerAlreadyReleasedError"
}
{
  "code": "invalid_request_error",
  "message": "Discount with code TEST already exists.",
  "type": "duplicate_error"
}

{
  "code": "api_error",
  "message": "An error occured while hashing password",
  "type": "database_error"
}