Skip to main content

CoinPayment Create Payment 2 API

POST /coinpaymentCreatePayment2

Description

This API endpoint allows users to create a payment through CoinPayment using a simplified response format. By providing details such as payment category, group ID, additional login count, and the cryptocurrency to be used, the endpoint initiates the payment process and returns an error message if any issues arise.

Request Body

The request utilizes GraphQL to perform the coinpaymentCreatePayment2 mutation.

Mutation:

mutation coinpaymentCreatePayment2 (
$category: PaymentCategory!,
$groupId: Int,
$moreLoginCount: Int,
$coin: String!
) {
coinpaymentCreatePayment2 (
category: $category,
groupId: $groupId,
moreLoginCount: $moreLoginCount,
coin: $coin
) {
error
}
}

Variables:

{
"category": "<Payment_Category>",
"groupId": 0,
"moreLoginCount": 0,
"coin": "<Cryptocurrency>"
}
  • category (PaymentCategory Enum): The category of the payment (e.g., subscription, one-time purchase).
  • groupId (Int): The ID of the group associated with the payment.
  • moreLoginCount (Int): The number of additional logins to be included in the payment.
  • coin (String): The cryptocurrency to be used for the payment (e.g., BTC, ETH).

Response:

  • Success (200 OK):

    • If the payment initiation is successful and no errors are encountered, the response will not return additional data.
  • Error (4XX/5XX):

    • If an issue arises during the payment process, the response will return an error message.
    {
    "data": {
    "coinpaymentCreatePayment2": {
    "error": "<Error_Message>"
    }
    }
    }

Note:

Ensure that all required fields are provided and correctly formatted according to the platform's specifications. This API is a simplified version of the CoinPayment integration, focusing primarily on error handling during the payment process.