createPayment

This mutation allows the creation of payment for a given invoice.

mutation createPayment($invoiceID:UUID1!,$paymentMethodID: UUID1!,$metadata: CreatePaymentMetadataInput
){
  createPayment(invoiceID:$invoiceID,
  paymentMethodID:$paymentMethodID,
  metadata:$metadata){
    id
    userID
    invoiceID
    processorPaymentID
    paymentMethodID
    status
  }
}'

Sample variable 1

{
  "invoiceID": "af7649f8-5c6e-4de4-b688-20a97b316726",
  "paymentMethodID": "b2f5cdfd-3550-47ab-a5a2-e21731724ea7",
  "metadata": {
    "creditCardData": {
      "keyID": "key1",
      "encryptedData": "1"
    },
    "cryptoData": {
      "name": "",
      "description": "",
      "localPrice": {
        "amount": 1,
        "currency": "Ethereum"
      },
      "billingDetails": {
        "name": "Tony Green",
        "city": "Lemberg",
        "address1": "Shop",
        "address2": "1",
        "country": "PL",
        "district": "MZ",
        "postalCode": "848585"
      },
      "redirectURL": "https://www.google.com",
      "cancelURL": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent"
    },
    "destinationAddress": "0xd79e8c99cb47e0813f2f2b71e840183027991bbd"
  }
}

Sample response 1

{
  "data": {
    "createPayment": {
      "id": "1718a465-5870-4391-bc86-e2b0a0c489b2",
      "userID": "196f2a18-30d8-4781-a372-83cdc966004f",
      "invoiceID": "af7649f8-5c6e-4de4-b688-20a97b316726",
      "paymentMethodID": "b2f5cdfd-3550-47ab-a5a2-e21731724ea7",
      "circlePaymentID": "a38b78b8-9ad5-4515-86ec-0f8d225dc128",
      "status": "pending"
    }
  }
}

Sample variable 2

{
  "invoiceID": "bcad0b34-1311-4199-83fc-e86814853803",
  "paymentMethodID": "9ce04603-6477-4aff-96f4-b432898df41c",
  "metadata": {
    "destinationAddress": "0x454d25d3f512ADe0f1C488ADaEcCC334759D211E",
    "onChainPaymentData": {
      "billingDetails": {
        "name": "",
        "address1": "",
        "address2": "",
        "district": "",
        "country": "",
        "postalCode": "",
        "city": ""
      }
    }
  }
}

Sample response 2

{
  "data": {
    "createPayment": {
      "id": "5b09ce13-c9e1-498d-9c8a-3985de4b8348",
      "userID": "548b1c10-b609-4e3b-bb07-d9fdb9ff9ef8",
      "invoiceID": "bcad0b34-1311-4199-83fc-e86814853803",
      "paymentMethodID": "9ce04603-6477-4aff-96f4-b432898df41c",
      "status": "pending"
    }
  }
}

Arguments

NameTypeDescriptionRequired
invoiceIDUUID1The invoice ID.Yes
paymentMethodIDUUID1The payment method ID.Yes
metadataObjectContains information from CreatePaymentMetadataInputYes

Returns

NameTypeDescription
PaymentObjectContains all the information from Payment.