Store Credits
Update a Store Credit
Storefront API
- Authentication
- Account
- Account / Address
- Account / Credit Cards
- Account / Orders
- Order Status
- Cart
- Cart / Line Items
- Cart / Other
- Cart / Coupons
- Checkout
- Checkout / State
- Checkout / Shipments
- Checkout / Payments
- Checkout / Store Credit
- Stripe
- Products
- Vendors
- Stores
- Taxons
- Countries
- CMS Pages
- Menus
- Wishlists
- Wishlists / Wished Items
- Digital Downloads
Platform API
- Authentication
- Addresses
- Adjustments
- Classifications
- CMS Pages
- CMS Sections
- Countries
- Data Feeds
- Digital Links
- Digital Assets
- Line Items
- Menu Items
- Menus
- Option Types
- Option Values
- Orders
- Payment Methods
- Payments
- Products
- Promotion Actions
- Promotion Categories
- Promotion Rules
- Promotions
- Roles
- Shipments
- Shipping Categories
- Shipping Methods
- States
- Stock Items
- Stock Locations
- Store Credit Categories
- Store Credit Types
- Store Credits
- Tax Categories
- Tax Rates
- Taxonomies
- Taxons
- Users
- Variants
- Vendors
- Webhook Events
- Webhook Subscribers
- Wished Items
- Wishlists
- Zones
Store Credits
Update a Store Credit
Updates a Store Credit
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
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Query Parameters
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
Example:
"2"
Example:
"4"
Example:
"5"
Example:
25
Example:
"USD"
Example:
"1"
Example:
"2"
Example:
10
Example:
"This credit was given as a refund"
Example:
15.5
Example:
"3"
Example:
"Refund"
Was this page helpful?
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"
}
]
}
}
}
}