Hey, thanks for your time.
The problem is, I call the price rules api endpoint using POST method and it returns a list of all the existing prices rules instead of the price rule I just created. Basically, it’s returning what would be the response for the GET method using that same endpoint, except, I’m using POST. Any help is appreciated, I’m quite pressed for time. Thanks.
I’m using POST method, my body:
const requestBody = {
price_rule: {
title: ‘TEST10’,
target_type: ‘line_item’,
target_selection: ‘entitled’,
entitled_product_ids: [5419639406749, 8167846412514],
allocation_method: ‘across’,
value_type: ‘percentage’,
value: -10.0,
usage_limit: 1,
starts_at: isoStartDate,
ends_at: isoEndDate,
customer_selection: ‘all’
}
};
the request response is far to big for me to send it here but it’s an array of existing price rules (and my price rule isnt in it), other than that, it’s just typical price rules.
Calling from server, no from client.
endpoint:
https://{domain}/admin/api/2023-07/price_rules.json
X-Request-Id: e54bf548-5fdb-4259-8f53-cdb1e7db694f
Access scopes:
- read/write price rules
- read/write discount codes
- read analytics
(Leave a like if you have the same problem, so that it brings attention to this)
Tell me if any more info is needed, I’ll provide it.
Thanks.