Skip to content

Change wholesale settings

PATCH
/api/v1/commerce/wholesale/settings
curl --request PATCH \
--url https://digize.com/api/v1/commerce/wholesale/settings \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "enabled": true, "applications": true, "defaultListId": "example", "welcome": "example" }'

Turns wholesale on or off, whether shoppers can ask for an account from the portal, the default price list and the portal’s welcome.

Needs the commerce:write permission.

Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
enabled

Whether wholesale prices apply and the wholesale portal answers.

boolean
applications

Whether signed-in shoppers can ask for an account from the portal.

boolean
defaultListId
Any of:
string
<= 64 characters
welcome

What the portal says above its sign-in.

string
<= 1000 characters

Example generated

{
"enabled": true,
"applications": true,
"defaultListId": "example",
"welcome": "example"
}

Done

Media typeapplication/json
object
settings
required
object
enabled
required

Whether wholesale prices apply and the wholesale portal answers.

boolean
applications
required

Whether signed-in shoppers can ask for an account from the portal.

boolean
defaultListId
required
Any of:
string
<= 64 characters
welcome
required

What the portal says above its sign-in.

string
<= 1000 characters
lists
required
Array<object>
object
id
required
string
name
required
string
percentOff
required

Whole percent off retail for variants without a price.

number
minimumOrder
required

The least an order comes to, in minor units.

number
prices
required

Variants with a fixed price on it.

number
accounts
required
number
updatedAt
required
string format: date-time
accounts
required
Array<object>
object
contactId
required
string
name
required
string
email
required
string
company
required
string
status
required
string
Allowed values: pending approved declined
listId
required
string | null
message
required
string | null
requestedAt
required
string format: date-time
decidedAt
required
Any of:
string format: date-time
decidedBy
required
string | null
pending
required

Accounts waiting for approval.

number
portalUrl
required

The wholesale portal’s address.

string

Example

{
"accounts": [
{
"status": "pending"
}
]
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}