data-src=../../../../../includes/commerce-only.md

setNegotiableQuotePaymentMethod mutation

The setNegotiableQuotePaymentMethod mutation defines which payment method to apply to the cart. The negotiable quote must be in the UPDATED state to successfully apply the payment method.

Supported online payment methods include:

The following offline payment methods are also supported:

Title
Code
Bank Transfer Payment
banktransfer
Cash on Delivery
cashondelivery
Check / Money order
checkmo
No Payment Information Required
free
Purchase Order
purchaseorder

This mutation requires a valid customer authentication token.

Syntax

{
    setNegotiableQuotePaymentMethod(
        input: SetNegotiableQuotePaymentMethodInput!
    ): SetNegotiableQuotePaymentMethodOutput
}

Reference

The setNegotiableQuotePaymentMethod reference provides detailed information about the types and fields defined in this mutation.

Example usage

The following example sets the payment method .

Request:

mutation {
  setNegotiableQuotePaymentMethod(
    input: {
      quote_uid: "xCA4wSZEHsb5QbFiKfoq5k1Dk8vIPBgb"
      payment_method: { code: "checkmo" }
    }
  ) {
    quote {
      uid
      name
      status
      available_payment_methods {
        code
        title
      }
      selected_payment_method {
        code
        title
        purchase_order_number
      }
      items {
        product {
          sku
          name
        }
      }
    }
  }
}

Response:

{
  "data": {
    "setNegotiableQuotePaymentMethod": {
      "quote": {
        "uid": "xCA4wSZEHsb5QbFiKfoq5k1Dk8vIPBgb",
        "name": "April 22 request",
        "status": "UPDATED",
        "available_payment_methods": [
          {
            "code": "checkmo",
            "title": "Check / Money order"
          }
        ],
        "selected_payment_method": {
          "code": "checkmo",
          "title": "Check / Money order",
          "purchase_order_number": null
        }
      }
    }
  }
}