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"
    }
  }
}

Sample variable 3

{
  "invoiceID": "42b3c8d8-6a39-4e4a-b2e7-b165f55d29f4",
  "paymentMethodID": "d2ab6406-6be8-4a5f-8ee6-8a9568ae027c",
  "metadata": {
    "destinationAddress": "0x454d25d3f512ADe0f1C488ADaEcCC334759D211E",
    "cryptoPaymentData": {
      "billingDetails": {
        "name": "",
        "address1": "",
        "address2": "",
        "district": "",
        "country": "",
        "postalCode": "",
        "city": ""
      }
    }
  }
}

Sample response 3

{
  "data": {
    "createPayment": {
      "id": "9e7a6b4d-d0da-4e92-ade9-0f6ffc6babeb",
      "userID": "73337e7b-724d-4e9a-9a69-2167f7266383",
      "invoiceID": "42b3c8d8-6a39-4e4a-b2e7-b165f55d29f4",
      "paymentMethodID": "d2ab6406-6be8-4a5f-8ee6-8a9568ae027c",
      "status": "pending",
      "offchainSignatureInfo": {
        "value": {
          "highestBid": 0.1826,
          "highestBidder": "0x454d25d3f512ADe0f1C488ADaEcCC334759D211E",
          "nftContractAddress": "0xd7d7479c46E5fC12DbD4b99D82c80ce865cB9994",
          "tokenId": 0,
          "quantityOf1155": 1,
          "paymentCurrency": "0x0000000000000000000000000000000000000000",
          "chainId": 11155111,
          "expirationTime": 1696650651
        },
        "auctionId": "23f4bc9c-0f71-4f44-9988-2b4a53b9970c",
        "tokenOwnerAddress": "0x0000000000000000000000000000000000000000",
        "paymentSettlementAddress": "0x245D767b2E5cf2CEdE3001856d9D9987289eb415",
        "taxSettlementAddress": "0x245D767b2E5cf2CEdE3001856d9D9987289eb415",
        "platformSettlementAddress": "0xC0d66432E3Fd40DA54AAdcfF899ADD9186253731",
        "platformFeePercentage": 200,
        "commissionAddress": "0x0000000000000000000000000000000000000000",
        "commissionFeePercentage": 0,
        "signature": "0xbb1d93f65c720eb4d8e41219b202f23940b72b7989be4714e82e854f9db6458a7a6c948937e806ae44ad6feede915098b7249792f5b1bea5e3b7696719b55ac11b",
        "signer": "0x42575708A12Ee553892AE3A77913Fa3e40ea4641",
        "buyerAddress": "0x454d25d3f512ADe0f1C488ADaEcCC334759D211E"
      }
    }
  }
}

Arguments

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

Returns

NameTypeDescription
PaymentObjectContains all the information from Payment.