--- title: SalesAgreement - Customer API description: A contract between a merchant and a customer to do business. Shopify creates a sales agreement whenever an order is placed, edited, or refunded. A sales agreement has one or more sales records, which provide itemized details about the initial agreement or subsequent changes made to the order. For example, when a customer places an order, Shopify creates the order, generates a sales agreement, and records a sale for each line item purchased in the order. A sale record is specific to a type of order line. Order lines can represent different things such as a purchased product, a tip added by a customer, shipping costs collected at checkout, and more. api_version: 2025-10 api_name: customer type: interface api_type: graphql source_url: html: https://shopify.dev/docs/api/customer/latest/interfaces/salesagreement md: https://shopify.dev/docs/api/customer/latest/interfaces/salesagreement.md --- # Sales​Agreement interface A contract between a merchant and a customer to do business. Shopify creates a sales agreement whenever an order is placed, edited, or refunded. A sales agreement has one or more sales records, which provide itemized details about the initial agreement or subsequent changes made to the order. For example, when a customer places an order, Shopify creates the order, generates a sales agreement, and records a sale for each line item purchased in the order. A sale record is specific to a type of order line. Order lines can represent different things such as a purchased product, a tip added by a customer, shipping costs collected at checkout, and more. ## Fields * happened​At [Date​Time!](https://shopify.dev/docs/api/customer/latest/scalars/DateTime) non-null The date and time when the agreement occurred. * id [ID!](https://shopify.dev/docs/api/customer/latest/scalars/ID) non-null The unique ID for the agreement. * reason [Order​Action​Type!](https://shopify.dev/docs/api/customer/latest/enums/OrderActionType) non-null The reason the agreement was created. * sales [Sale​Connection!](https://shopify.dev/docs/api/customer/latest/connections/SaleConnection) non-null The sales associated with the agreement. *** ## Types implemented in * [Order​Agreement](https://shopify.dev/docs/api/customer/latest/objects/OrderAgreement) OBJECT An agreement associated with an order placement. * happened​At [Date​Time!](https://shopify.dev/docs/api/customer/latest/scalars/DateTime) non-null The date and time when the agreement occurred. * id [ID!](https://shopify.dev/docs/api/customer/latest/scalars/ID) non-null The unique ID for the agreement. * order [Order!](https://shopify.dev/docs/api/customer/latest/objects/Order) non-null The order associated with the agreement. * reason [Order​Action​Type!](https://shopify.dev/docs/api/customer/latest/enums/OrderActionType) non-null The reason the agreement was created. * sales [Sale​Connection!](https://shopify.dev/docs/api/customer/latest/connections/SaleConnection) non-null The sales associated with the agreement. * [Order​Edit​Agreement](https://shopify.dev/docs/api/customer/latest/objects/OrderEditAgreement) OBJECT An agreement related to an edit of the order. * happened​At [Date​Time!](https://shopify.dev/docs/api/customer/latest/scalars/DateTime) non-null The date and time when the agreement occurred. * id [ID!](https://shopify.dev/docs/api/customer/latest/scalars/ID) non-null The unique ID for the agreement. * reason [Order​Action​Type!](https://shopify.dev/docs/api/customer/latest/enums/OrderActionType) non-null The reason the agreement was created. * sales [Sale​Connection!](https://shopify.dev/docs/api/customer/latest/connections/SaleConnection) non-null The sales associated with the agreement. * [Refund​Agreement](https://shopify.dev/docs/api/customer/latest/objects/RefundAgreement) OBJECT An agreement for refunding all or a portion of the order between the merchant and the customer. * happened​At [Date​Time!](https://shopify.dev/docs/api/customer/latest/scalars/DateTime) non-null The date and time when the agreement occurred. * id [ID!](https://shopify.dev/docs/api/customer/latest/scalars/ID) non-null The unique ID for the agreement. * reason [Order​Action​Type!](https://shopify.dev/docs/api/customer/latest/enums/OrderActionType) non-null The reason the agreement was created. * refund [Refund!](https://shopify.dev/docs/api/customer/latest/objects/Refund) non-null The refund that's associated with the agreement. * sales [Sale​Connection!](https://shopify.dev/docs/api/customer/latest/connections/SaleConnection) non-null The sales associated with the agreement. * [Return​Agreement](https://shopify.dev/docs/api/customer/latest/objects/ReturnAgreement) OBJECT An agreement between the merchant and customer for a return. * happened​At [Date​Time!](https://shopify.dev/docs/api/customer/latest/scalars/DateTime) non-null The date and time when the agreement occurred. * id [ID!](https://shopify.dev/docs/api/customer/latest/scalars/ID) non-null The unique ID for the agreement. * reason [Order​Action​Type!](https://shopify.dev/docs/api/customer/latest/enums/OrderActionType) non-null The reason the agreement was created. * return [Return!](https://shopify.dev/docs/api/customer/latest/objects/Return) non-null The return associated with the agreement. * sales [Sale​Connection!](https://shopify.dev/docs/api/customer/latest/connections/SaleConnection) non-null The sales associated with the agreement. *** ```json { "happenedAt": "", "id": "", "reason": "", "sales": { "first": "", "after": "", "last": "", "before": "", "reverse": "" } } ```