Skip to main content

Update pricing during a session

Update pricing for all delivery types

You can update pricing information during a session, instead of using the pre-configured pricing rules. Use the price field when creating and/or updating a session:

mutation {
  session(
    input: {
        price: [{}]
    }
  )
  {
    id
  }
}

The SessionPriceInput type has two fields: provider and price.

The provider field allows you to select a provider to whom the session pricing applies. If left blank, it will apply to all available providers.

To check the list of available providers, see ProviderEnum.

mutation {
  session(
    input: {
        price: [{
            provider: "Red Ivorp"
        }]
    }
  )
  {
    id
  }
}

To update the price, set the currency and the amount in the price field. In this example, the new price of €4.5 will apply to the provider Red Ivorp.

mutation {
  session(
    input: {
        price: [{
            provider: "Red Ivorp",
            price: {
                currency: EUR,
                amount: 4.5,
            }
        }]
    }
  )
  {
    id
  }
}

Update pricing for a specific delivery type

Instead of updating pricing for all deliveries, you can create a new pricing for either home delivery or pickup point delivery. The price field is available for both homeDelivery and pickupPoint:

mutation {
  session(
    input: {
        homeDelivery: {
            enabled: true,
            price: [{
                price: {
                    amount: 4,
                    currency: USD
                }
            }]
        }
    }
  )
  {
    id
  }
}
mutation {
  session(
    input: {
        pickupPoint: {
            enabled: true,
            price: [{
                price: {
                    amount: 4,
                    currency: USD
                }
            }]
        }
    }
  )
  {
    id
  }
}