Saleor Documentation

website·Indexed 36 days ago

https://canary.docs.saleor.io/

Developer documentation for Saleor, a composable, open-source commerce platform. Includes a comprehensive GraphQL API reference covering apps, users, shipping, taxes, and webhooks, as well as guides on setup, cloud configuration, app architecture, and upgrade paths (e.g., 3.15 to 3.16).

Tokens
360.4K
Snippets
1.8K
Records
3.1K
Agent score
45%

What's inside Saleor

  1. Overview of GraphQL in Saleor

    Saleor fully adopts GraphQL for all of its APIs, including webhook subscriptions. This approach provides developers with fine-grained control over data fetching, allowing a single request to retrieve exactly the fields needed. This eliminates over-fetching (receiving unnecessary data) and under-fetching (requiring multiple requests for missing fields), which is particularly beneficial for complex commerce data models.
  2. Handle GiftCardMetadataUpdated events

    The GiftCardMetadataUpdated object is a GraphQL type that implements the Event interface. It is sent as a webhook event whenever the metadata of a gift card is updated. This object provides details about when the event occurred, the version of Saleor that triggered it, the entity that initiated the change, the receiving application, and the specific gift card affected.
    type GiftCardMetadataUpdated implements Event {
      issuedAt: DateTime
      version: String
      issuingPrincipal: IssuingPrincipal
      recipient: App
      giftCard: GiftCard
    }
  3. Handle the AppUpdated event object

    The AppUpdated object is a GraphQL type that implements the Event interface. It is sent as a webhook event whenever an application is updated in Saleor. It provides details about when the event occurred, the Saleor version, the entity that triggered the update, and the application involved.
    type AppUpdated implements Event {
      issuedAt: DateTime
      version: String
      issuingPrincipal: IssuingPrincipal
      recipient: App
      app: App
    }
  4. OrderLine Object Reference

    The OrderLine object represents a specific line item within a Saleor order. It provides comprehensive details about the purchased product variant, quantities, pricing (including taxes and discounts), and associated metadata.
    type OrderLine implements Node, ObjectWithMetadata {
      id: ID!
      productName: String!
      variantName: String!
      productSku: String
      productVariantId: String
      isShippingRequired: Boolean!
      quantity: Int!
      quantityFulfilled: Int!
      taxRate: Float!
      unitPrice: TaxedMoney!
      undiscountedUnitPrice: TaxedMoney!
      unitDiscount: Money!
      unitDiscountReason: String
      unitDiscountValue: PositiveDecimal!
      unitDiscountType: DiscountValueTypeEnum
      totalPrice: TaxedMoney!
      undiscountedTotalPrice: TaxedMoney!
      isPriceOverridden: Boolean
      priceOverrideReason: String
      variant: ProductVariant
      translatedProductName: String!
      translatedVariantName: String!
      allocations: [Allocation!]
      saleId: ID
      quantityToFulfill: Int!
      taxClass: TaxClass
      taxClassName: String
      taxClassMetadata: [MetadataItem!]!
      taxClassPrivateMetadata: [MetadataItem!]!
      voucherCode: String
      isGift: Boolean
      discounts: [OrderLineDiscount!]
      # Metadata fields
      metadata: [MetadataItem!]!
      metafield(key: String!): String
      metafields(keys: [String!]): Metadata
      privateMetadata: [MetadataItem!]!
      privateMetafield(key: String!): String
      privateMetafields(keys: [String!]): Metadata
    }
  5. Handle OrderGrantRefundUpdateError in Saleor API

    The OrderGrantRefundUpdateError object is used to communicate failures during the update of a refund grant. It provides specific details about which field caused the error, a human-readable message, a machine-readable error code, and lists of specific lines (to be added or removed) that contributed to the error.
    type OrderGrantRefundUpdateError {
      field: String
      message: String
      code: OrderGrantRefundUpdateErrorCode!
      addLines: [OrderGrantRefundUpdateLineError!]
      removeLines: [OrderGrantRefundUpdateLineError!]
    }
  6. Handle the AttributeDeleted event object

    The AttributeDeleted object is a GraphQL type that implements the Event interface. It is sent as a webhook event whenever an attribute is deleted in Saleor. It provides metadata about when the event occurred, who triggered it, and details about the deleted attribute.
    type AttributeDeleted implements Event {
      issuedAt: DateTime
      version: String
      issuingPrincipal: IssuingPrincipal
      recipient: App
      attribute: Attribute
    }
  7. Use the PageTypeDeleted object to handle page type deletion events

    The PageTypeDeleted object is a GraphQL type that implements the Event interface. It is sent as a webhook event when a page type is deleted in Saleor. It provides metadata about when the event occurred, who triggered it, and the specific page type that was removed.
    type PageTypeDeleted implements Event {
      issuedAt: DateTime
      version: String
      issuingPrincipal: IssuingPrincipal
      recipient: App
      pageType: PageType
    }
  8. Use the ProductMediaCreated event object

    The ProductMediaCreated object is a GraphQL type that implements the Event interface. It is sent as a webhook event whenever new product media is created in Saleor. It provides metadata about the event trigger, the version of Saleor, and the specific product media object that was created.
    type ProductMediaCreated implements Event {
      issuedAt: DateTime
      version: String
      issuingPrincipal: IssuingPrincipal
      recipient: App
      productMedia: ProductMedia
    }
  9. Understand the AttributeBulkCreateError object

    The AttributeBulkCreateError object is returned when a bulk attribute creation operation fails. It provides details about the specific failure, including the field that caused the error, a human-readable message, and a machine-readable error code. This object is a member of the AttributeBulkCreate and AttributeBulkCreateResult objects.
    type AttributeBulkCreateError {
      path: String
      message: String
      code: AttributeBulkCreateErrorCode!
    }
  10. Use the ProductVariantBackInStock object for back-in-stock events

    The ProductVariantBackInStock object is a GraphQL type that implements the Event interface. It is sent as a webhook event when a product variant is back in stock, providing details about the timing, the triggering principal, the receiving app, and the specific product variant and warehouse involved.
    type ProductVariantBackInStock implements Event {
      issuedAt: DateTime
      version: String
      issuingPrincipal: IssuingPrincipal
      recipient: App
      productVariant(channel: String): ProductVariant
      warehouse: Warehouse
    }
  11. OrderFulfill Object Reference

    The OrderFulfill object is the response type returned by the orderFulfill mutation. It provides details about the fulfillments created for an order and any associated errors. Performing this action requires the MANAGE_ORDERS permission.

    Triggered Webhook Events:

    • FULFILLMENT_CREATED (async): A new fulfillment is created.
    • ORDER_FULFILLED (async): Order is fulfilled.
    • FULFILLMENT_TRACKING_NUMBER_UPDATED (async): Sent when fulfillment tracking number is updated.
    • FULFILLMENT_APPROVED (async): A fulfillment is approved.
    type OrderFulfill {
      fulfillments: [Fulfillment!]
      order: Order
      errors: [OrderError!]!
      orderErrors: [OrderError!]! @deprecated
    }
  12. Reference the ProductVariantBulkError object

    The ProductVariantBulkError object is returned when a bulk product variant operation fails. It provides detailed metadata about the failure, including the specific field, error code, and associated entity IDs (such as warehouses, channels, or attributes) that triggered the error.
    type ProductVariantBulkError {
      field: String
      message: String
      code: ProductVariantBulkErrorCode!
      path: String
      attributes: [ID!]
      values: [ID!]
      warehouses: [ID!]
      stocks: [ID!]
      channels: [ID!]
      channelListings: [ID!]
    }