Advanced Coupons API
  • REST API
  • coupons/v1
    • Virtual Coupons (Premium)
      • Query a list of virtual coupons
      • Fetch virtual coupon stats
      • Create a virtual coupon
      • Retrieve a virtual coupon
      • Update a virtual coupon
      • Delete a virtual coupon
      • Bulk create virtual coupons
      • Bulk delete virtual coupons
    • Search Customers (Premium)
    • Settings
  • loyalty-program/v1
    • Dashboard
    • Customers
    • Settings
    • My Points
  • wc-loyalty-program/v1
    • Dashboard
    • Customers
    • Settings
  • wc-store-credits/v1
    • Entries
      • Query a list of store credit entries
      • Create a store credit entry
      • Fetch a single store credit entry
      • Update store credit entry
      • Delete store credit entry
    • Customers
      • Get dashboard statistics data
      • Query list of customers with store credits balance
      • Get single customer statistics and sources
Powered by GitBook
On this page

Was this helpful?

  1. wc-store-credits/v1
  2. Entries

Update store credit entry

PreviousFetch a single store credit entryNextDelete store credit entry

Last updated 2 years ago

Was this helpful?

PUT: /wp-json/wc-store-credits/v1/entries‌/{entry_id}

Requirements:

  • Logged-in user

  • user role with manage_woocommerce user capability

Method

Endpoint

PUT

/wp-json/wc-store-credits/v1/entries‌/{entry_id}

Parameters
Required
Type
Default
Description

amount

no

float

-

Entry amount value.

user_id

no

integer

-

Customer ID

type

no

string

-

Entry type: increase or decrease

action

no

string

-

The action or source slug of the entry.

This requires a valid source/action that is registered by code ().

date

no

string

current date & time

Date and time the entry was created

date_format

no

string

Y-m-d H:i:s

Date format of the provided date values.

See:

object_id

no

integer

0

The ID of related object of the entry. This can either be the ID of an order, coupon, user or post.

Update store credit entry amount

PUT: http://example.com/wp-json/wc-store-credits/v1/entry/35

{
    "amount": 50
}

Status: 200 OK

{
  "message": "Successfully updated store credit entry.",
  "data": {
    "key": "35",
    "id": 35,
    "amount_raw": 50,
    "amount": "$50.00",
    "type": "increase",
    "activity": "Refunded order",
    "user_id": 1,
    "date": "2021-11-16 13:12:10",
    "rel_link": "http://acfw.test/my-account/view-order/436/",
    "rel_label": "View Order",
    "note": ""
  },
  "balance_raw": 300.25,
  "balance": "$300.25"
}

Status: 403 Forbidden

{
    "code": "rest_forbidden_context",
    "message": "Sorry, you are not allowed access to this endpoint.",
    "data": {
        "status": 401
    }
}

https://www.php.net/manual/en/datetime.format.php
learn more