createPaymentMethod

This mutation allows the user to create a payment method.

Sample mutation 1

mutation createPaymentMethod($ordID:UUID!,$input:PaymentMethodCreateInput!){
  createPaymentMethod(orgID:$orgID input:$input){
      id
      type
      status
      network
      last4Digit
      metadata{
        email
        phoneNumber
      }
      billingDetails{
        address1
        address2
        name
        country
        district
        city
        postalCode
      }
  }
}

Sample variable 1

{
  "orgID": "f2f5c627-5421-4c40-9913-edfd09dd98b3",
  "input": {
   "paymentType":"CreditCardCheckout",
    "creditCardData":{
      "keyID":"key1",
      "encryptedData":"1", 
      "billingDetails":{
        "name":"Tony Green",
        "city":"Lemberg",
        "address1":"Shop",
        "address2":"1",
        "country":"PL",
       "district":"MZ",
        "postalCode":"848585",
      },
      "expirationYear":2025,
      "expirationMonth":4,
      "metadata":{
        "email":"[email protected]",
        "phoneNumber":"+146952354765"
      }
    }
  }

}

Sample response 1

{
    "createPaymentMethod": {
			  "id": "93f24c5e-2e87-4e02-ae67-fa4147bd3214",
      "type": "CreditCard",
      "status": "complete",
      "network":"",
     "last4Digit":"4242",
      "metadata":{
        email:"[email protected]",
        phoneNumber:"+146952354765"
      },
      "billingDetails":{
        name:"Tony Green",
        city:"Lemberg",
        address1:"Shop",
        address2:"1",
        country:"PL",
        district:"MZ",
        postalCode:"848585",
      }
   }
  }

Sample mutation 2

mutation createPaymentMethod($orgID:UUID1!,$input:PaymentMethodCreateInput!){
  createPaymentMethod(orgID:$orgID input:$input){
      ... on OnchainPaymentMethodOutput{
      id
      type
      status
    }
  }
}

Sample variable 2

{
  "orgID": "5a198d09-e243-491f-991a-f79e1cecdcc3",
  "input": {
     "paymentType": "CryptoPayment"
  }
}

Sample response 2

{
  "data": {
    "createPaymentMethod": {
      "id": "93f24c5e-2e87-4e02-ae67-fa4147bd3214",
      "type": "CryptoPayment",
      "status": "complete"
    }
  }
}

Arguments

NameTypeDescriptionRequired
orgIDUUID1The organization ID.Yes
inputObjectThe input to create payment method.Yes

Fields

NameTypeDescription
PaymentMethodOutputObjectContains information from CreditCardPaymentMethodOutput, ACHPaymentMethodOutput , CryptoPaymentMethodOutputand WirePaymentMethodOutput.