Anchor to section titled 'undefined'

customerPaymentMethodPaypalBillingAgreementCreate
mutation

Requires write_customers access scope. Also: Requires write_customer_payment_methods scope.

Creates a PayPal billing agreement for a customer.


The billing address.

Anchor to billingAgreementId
billingAgreementId
required

The billing agreement ID from PayPal that starts with 'B-' (for example, B-1234XXXXX).

Anchor to customerId
customerId
required

The ID of the customer.

Anchor to inactive
inactive
default:false

Whether the PayPal billing agreement is inactive.


Was this section helpful?
Anchor to section titled 'CustomerPaymentMethodPaypalBillingAgreementCreatePayload returns'

CustomerPaymentMethodPaypalBillingAgreementCreatePayload returns


The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation customerPaymentMethodPaypalBillingAgreementCreate($billingAgreementId: String!, $customerId: ID!) {
  customerPaymentMethodPaypalBillingAgreementCreate(billingAgreementId: $billingAgreementId, customerId: $customerId) {
    customerPaymentMethod {
      # CustomerPaymentMethod fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "billingAddress": {
    "address1": "<your-address1>",
    "address2": "<your-address2>",
    "city": "<your-city>",
    "company": "<your-company>",
    "countryCode": "AC",
    "firstName": "<your-firstName>",
    "lastName": "<your-lastName>",
    "phone": "<your-phone>",
    "provinceCode": "<your-provinceCode>",
    "zip": "<your-zip>"
  },
  "billingAgreementId": "<your-billingAgreementId>",
  "customerId": "gid://shopify/<objectName>/10079785100",
  "inactive": true
}
input MailingAddressInput {
  address1: String
  address2: String
  city: String
  company: String
  country: String
  countryCode: CountryCode
  firstName: String
  id: ID
  lastName: String
  phone: String
  province: String
  provinceCode: String
  zip: String
}