Set a customer's store credit limit per order
PUT
/api/subscriptions/credits/balances/max-per-order
const url = 'https://api.usegro.co/api/subscriptions/credits/balances/max-per-order';const options = { method: 'PUT', headers: { Authorization: 'Bearer <token>', 'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json' }, body: '{"profile_id":"example","currency_code":"example","max_per_order":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.usegro.co/api/subscriptions/credits/balances/max-per-order \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "profile_id": "example", "currency_code": "example", "max_per_order": 1 }'The most store credit one of this customer’s orders can use, in the currency’s main unit, not cents. It replaces the store’s credits_max_per_order setting for this customer. Send max_per_order: null to remove it and use the store default again. currency_code defaults to the currency the customer holds credit in.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
profile_id
required
string
currency_code
string
max_per_order
required
number
Example generated
{ "profile_id": "example", "currency_code": "example", "max_per_order": 1}Responses
Section titled “Responses”Media typeapplication/json
object
data
object
data
required
object
updated_at
string
currency_code
required
string
balance
required
number
max_per_order
number
Example generated
{ "data": { "data": { "updated_at": "example", "currency_code": "example", "balance": 1, "max_per_order": 1 } }}