Skip to content
Navigation

Prices each of a product's prices as the checkout would charge a customer, or a new one, with an optional coupon, quantity and later time, writing nothing; naming a customer needs `customer:read`, and a coupon `discount:read`.

GET
https://api.sherpo.io/merchant/v1/stores/{store}/products/{product}/checkout/simulate

Authorization

  • bearer
    HTTP
    required

Path parameters

  • store
    string
    required

    The store's id.

  • product
    string
    required
    minLength: 1

Query parameters

  • customer
    optional
    string

    An id. null clears it.

    minLength: 1
  • coupon
    optional
    string

    A discount's code, or its id, as the checkout reads a coupon.

    maxLength: 64 · minLength: 1
  • at
    optional
    string

    When to price at; now when absent, never earlier, and a date alone is that day's start in UTC.

    pattern: ^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2}))?$
  • quantity
    optional
    integer

    How many of a one-time price; one when absent.

    maximum: 99 · minimum: 1

Returns

200

Prices each of a product's prices as the checkout would charge a customer, or a new one, with an optional coupon, quantity and later time, writing nothing; naming a customer needs customer:read, and a coupon discount:read.

JSON
  • at
    string
    required

    When the prices were read at.

  • customer
    required

    One of the following:

    • object
    • null
  • product
    object
    required
    • id
      string
      required
  • coupon
    required

    One of the following:

    • string
    • null
  • quantity
    number
    required
  • owned
    required

    What the customer already holds of the product, or null.

    One of the following:

    • object
    • null
  • prices
    array of
    object
    required

    Every live price, and an archived one the customer's plan still renews on, in the checkout's order.

    • price
      object
      required

      The price as the product lists it.

      • id
        string
        required
      • tier
        required

        One of the following:

        • object
        • null
      • kind
        string
        required
      • period
        required

        One of the following:

        • object
        • null
      • title
        required

        One of the following:

        • string
        • null
      • currency
        string
        required
      • exponent
        required

        One of the following:

        • number
        • null
      • amount
        number
        required
    • verdict
      required

      What the checkout would charge for quantity, or why it would refuse the price.

      One of the following:

      • object
      • object
    • mode
      required

      How the checkout offers it, whatever the verdict: a purchase, an upgrade, a renewal, or null when it doesn't.

      One of the following:

      • string
      • null
    • list
      number
      required

      The amount before any discount or credit.

    • discounted
      required

      The amount after the discount that applied, coupon over automatic.

      One of the following:

      • number
      • null
    • discount
      object
      required

      The automatic discount and the coupon that reach the price, and which one applied; their id, name and code are null without discount:read.

      • applied
        required

        One of the following:

        • string
        • null
      • automatic
        required

        One of the following:

        • object
        • null
      • coupon
        required

        One of the following:

        • object
        • null
    • coupon
      required

      The coupon's verdict on this price, or null when none was named.

      One of the following:

      • object
      • null
    • upgrade
      required

      The credit for what the customer already holds of the product, or null when the price isn't an upgrade.

      One of the following:

      • object
      • null
    • minimum
      object
      required

      The payment processor's minimum charge, and the total under it the checkout grants free.

      • amount
        number
        required
      • approximate
        boolean
        required
      • waived
        required

        One of the following:

        • number
        • null
    • recurring
      required

      For a plan, its first charge and what it renews at, or null for a one-time price.

      One of the following:

      • object
      • null
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • detail
    string
    required
  • code
    optional
    string
  • context
    optional
    object
  • reached_core
    optional
    boolean
  • core_answer
    optional
    string

Type to search…

↑↓ navigate↵ selectEsc close