PATCH
/
api
/
v2
/
platform
/
store_credits
/
{id}
curl --request PATCH \
  --url http://{defaultHost}/api/v2/platform/store_credits/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "store_credit": {
    "user_id": "2",
    "category_id": "4",
    "created_by_id": "5",
    "amount": 25,
    "amount_used": 10,
    "memo": "This credit was given as a refund",
    "currency": "USD",
    "amount_authorized": 15.5,
    "originator_id": "3",
    "originator_type": "Refund",
    "type_id": "1",
    "store_id": "2",
    "public_metadata": {},
    "private_metadata": {}
  }
}'
{
  "data": {
    "id": "9",
    "type": "store_credit",
    "attributes": {
      "amount": "500.0",
      "amount_used": "0.0",
      "memo": "The user is awarded",
      "deleted_at": null,
      "currency": "CAD",
      "amount_authorized": "0.0",
      "originator_type": null,
      "created_at": "2022-11-08T19:35:40.170Z",
      "updated_at": "2022-11-08T19:35:40.405Z",
      "public_metadata": {
        "loyalty_reward": true
      },
      "private_metadata": {},
      "display_amount": "$500.00",
      "display_amount_used": "$0.00"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "119",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "120",
          "type": "user"
        }
      },
      "store_credit_category": {
        "data": {
          "id": "21",
          "type": "store_credit_category"
        }
      },
      "store_credit_type": {
        "data": {
          "id": "22",
          "type": "store_credit_type"
        }
      },
      "store_credit_events": {
        "data": [
          {
            "id": "10",
            "type": "store_credit_event"
          }
        ]
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Query Parameters

include
string

Select which associated resources you would like to fetch, see: <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>

Body

application/json
store_credit
object
required

Response

200
application/vnd.api+json
Record updated
data
object
required