Skip to content

Creating a Payment

Creates payment transaction.

For scenarios using this method, please see “Partner Form Payment” and “Payment Token

Request

PUT /payin/v1/sites/{siteId}/payments/{paymentId}

Path Parameters

Parameter Required Type Description
siteId Yes string Merchant site identifier
paymentId Yes string Unique payment identifier in the merchant’s system

Headers

Header Required Type Description
Authorization Yes string API access key. Bearer [access-token]
Content-type Yes string Request content. application/json
Accept No string Response content. application/json

Body Parameters

Parameter Required Type Description
paymentMethod Yes object Payment method
amount Yes object Amount of the operation
billId No string(256) Unique order number in the merchant’s system related to the payment. It is generated by the merchant or automatically on QIWI side if not specified in the request
callbackUrl No string(256) Notification URL
comment No string(255) Service description for the customer
flags No array of strings Additional API commands.
  • SALE — use one-step authorization scenario.
  • BIND_PAYMENT_TOKENissue a payment token.
  • deviceData No object Information on the client’s device where payment was initiated
    customer No object Customer information
    receiverData No object Payment recipient information
    customFields No object Additional information for the operation: contractdId, etc

    Request Example

    Creating a payment
    PUT /partner/payin/v1/sites/test-01/payments/1811 HTTP/1.1
    Accept: application/json
    Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
    Content-type: application/json
    Host: b2b-api.qiwi.com
    
    {
      "billId": "string",
      "amount": {
        "currency": "RUB",
        "value": 200.00
      },
      "paymentMethod" : {
        "type" : "CARD",
        "pan" : "4444443616621049",
        "expiryDate" : "12/19",
        "cvv2" : "123",
        "holderName" : "CARDHOLDER NAME",
        "cardTokenPaymentType" : "INSTALLMENT",
        "firstTransaction" : {
          "paymentId" : "testPaymentId28"
        }
      },
      "callbackUrl": "https://example.com/callbacks",
      "comment": "Example payment",
      "customer": {
        "account": "string",
        "address": {
          "city": "Moscow",
          "country": "Russian Federation",
          "details": "Severnoe chertanovo microdistrict 1a 1",
          "region": "Moscow city"
        },
        "email": "customer@example.com",
        "phone": "+79991234567"
      },
      "deviceData": {
        "datetime": "2017-09-03T14:30:00+03:00",
        "fingerprint": "TW96aWxsYS81LjAgKHBsYXRmb3JtOyBydjpnZWNrb3ZlcnNpb24p",
        "ip": "127.0.0.1",
        "screenResolution": "1280x1024",
        "timeOnPage": 1440,
        "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion"
      },
      "customFields": {
        "cf1": "Some data"
      },
      "flags": [
        "SALE"
      ]
    }
    

    Response

    See also HTTP error codes

    Successful Response Parameters

    Parameter Required Type Description
    paymentId Yes string Payment identifier
    createdDateTime Yes string Payment creation date
    amount Yes object Operation amount
    capturedAmount Yes object Captured amount
    refundedAmount Yes object Refunded amount
    paymentMethod Yes object Payment method
    status Yes string Invoice status
    paymentCardInfo Yes object Information on the card that was used for payment
    credentialOnFile No object Saved Card Information, if a saved card was used for the payment
    customer No object Customer data: account, email, phone
    callbackUrl No string(256) Notification URL. If not set in the request, the value set on the Merchant Portal will be used
    flags No array of strings Additional API commands. Possible values: TEST, AFT
    customFields No object Additional information for the operation
    settlementAmount No object Merchant’s settlement amount (when settlement currency differs from the currency of the payment authorization)
    requirements No object Requirements for customer’s additional verification
    createdToken No object Payment token information

    Error Parameters

    Parameter Required Type Description
    serviceName Yes string Name of the service that produced the error
    errorCode Yes string Error code
    description Yes string Error description for the merchant
    userMessage Yes string Error description for the customer
    dateTime Yes string Error date and time
    traceId Yes string Error Log unique ID
    cause No object Description for the field validation error

    Response Examples

    {
      "paymentId" : "223E",
      "createdDateTime" : "2024-03-01T17:10:31.284+03:00",
      "amount" : {
        "currency" : "RUB",
        "value" : "200.00"
      },
      "capturedAmount" : {
        "currency" : "RUB",
        "value" : "0.00"
      },
      "refundedAmount" : {
        "currency" : "RUB",
        "value" : "0.00"
      },
      "paymentMethod" : {
        "type" : "CARD",
        "maskedPan" : "444444******1049"
      },
      "customer" : { },
      "deviceData" : { },
      "requirements" : {
        "threeDS" : {
          "pareq" : "eJyrrgUAAXUA+Q==",
          "acsUrl" : "https://test.paymentgate.ru/acs/auth/start.do"
        }
      },
      "status" : {
        "value" : "WAITING",
        "changedDateTime" : "2024-03-01T17:10:32.607+03:00"
      },
      "paymentCardInfo": {
        "issuingCountry": "810",
        "issuingBank": "QiwiBank",
        "paymentSystem": "VISA",
        "fundingSource": "CREDIT",
        "paymentSystemProduct": "P|Visa Gold"
      },
      "callbackUrl": "https://example.com/callbacks",
      "customFields" : {
        "cf1": "Some data"
      },
      "flags" : [ ]
    }
    
    {
      "serviceName":"payin-core",
      "errorCode":"validation.error",
      "description":"Validation error",
      "userMessage":"Validation error",
      "dateTime":"2022-11-13T16:49:59.166+03:00",
      "traceId":"fd0e2a08c63ace83",
      "cause":{
        "paymentToken": [
          "Exchange token error. Token disabled, please create new one"
        ]
      }
    }
    
    {
      "serviceName":"payin-core",
      "errorCode":"internal.error",
      "userMessage":"Internal error",
      "description":"Internal error",
      "traceId":"3fb3420ee1795dcf",
      "dateTime":"2020-02-12T21:28:01.813+03:00"
    }