Untitled

mail@pastecode.io avatar
unknown
plain_text
6 days ago
1.8 kB
5
Indexable
Never
mutation {
  setGuestEmailOnCart(
    input: {
      cart_id: "lWAheMG0C9uwxD5Uj9lGYdCFR3WViLvk"
      email: "iwona@giat.pl"
    }
  ) {
    cart {
      email
    }
  }
	
	setBillingAddressOnCart(
    input: {
      cart_id: "lWAheMG0C9uwxD5Uj9lGYdCFR3WViLvk"
      billing_address: {
        address: {
          firstname: "Iwona"
          lastname: "Jóźwiak"
          company: "Test Company"
          street: ["Test 15"]
          city: "Test"
          region_id: 1011
          region: "PL-02"
          postcode: "12-345"
          country_code: "PL"
          telephone: "1234567890"
        }
        same_as_shipping: true
      }
    }
  ) {
    cart {
      billing_address {
        firstname
        lastname
        street
        city
        region {
          region_id
        }
        postcode
        country {
          code
          label
        }
        telephone
      }
    }
  }
  
	setShippingMethodsOnCart(
    input: {
      cart_id: "lWAheMG0C9uwxD5Uj9lGYdCFR3WViLvk"
      shipping_methods: [
        {
          carrier_code: "flatrate"
          method_code: "flatrate"
        }
      ]
    }
  ) {
    cart {
      shipping_addresses {
        selected_shipping_method {
          carrier_code
          method_code
        }
      }
    }
  }

  setPaymentMethodOnCart(
    input: {
      cart_id: "lWAheMG0C9uwxD5Uj9lGYdCFR3WViLvk"
      payment_method: {
        code: "paypal_express"
        paypal_express: {
          payer_id: "RS3F3TWHJ9WL2"
          token: "EC-9MR5611926721231H"
        }
      }
    }
  ) {
    cart {
      selected_payment_method {
        code
      }
    }
  }

  placeOrder(
    input: {
      cart_id: "lWAheMG0C9uwxD5Uj9lGYdCFR3WViLvk"
    }
  ) {
    order {
      order_number
    }
  }
}
Leave a Comment