Skip to content

Creating a QR Code for FPS

Returns a QR code for payments via Faster payment system (FPS). Both POST and PUT methods can be used

For scenarios using this method, please see “Payment via FPS” and “Payment Token

Request

POST /payin/v1/sites/{siteId}/sbp/qrCodes

PUT /payin/v1/sites/{siteId}/sbp/qrCodes/{qrCodeUid}

Path Parameters

Parameter Required Type Description
siteId Yes string Merchant site identifier
Parameter Required Type Description
siteId Yes string Merchant site identifier
qrCodeUid Yes string Unique identifier of the request in the merchant’s information system

Headers

Both POST and PUT use the same 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
qrCodeUid Yes string Unique identifier of the request in the merchant’s information system
qrCode Yes object QR code parameters
amount No object Operation amount
paymentPurpose No string(140) Goods or service description for the customer
redirectUrl No string(1000) URL to redirect the customer to after payment
tokenizationPurpose No string(140) Payment token description
tokenizationAccount No string(64) Customer unique identifier in the merchant’s system. For requests with qrCode.type=TOKEN
flags No array of strings Additional API commands.
  • CREATE_TOKEN — flag for FPS payment token issue
  • Parameter Required Type Description
    qrCode Yes object QR code parameters
    amount No object Operation amount
    paymentPurpose No string(140) Goods or service description for the customer
    redirectUrl No string(1000) URL to redirect the customer to after payment
    tokenizationPurpose No string(140) Payment token description
    tokenizationAccount No string(64) Customer unique identifier in the merchant’s system. For requests with qrCode.type=TOKEN
    flags No array of strings Additional API commands.
  • CREATE_TOKEN — flag for FPS payment token issue
  • Request Example

    Creating a QR code
    POST /partner/payin/v1/sites/test-01/sbp/qrCodes HTTP/1.1
    Accept: application/json
    Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
    Content-type: application/json
    Host: b2b-api.qiwi.com
    
    {
      "qrCodeUid": "Test12",
      "amount": {
        "value": 1.00,
        "currency": "RUB"
      },
      "qrCode": {
        "type": "DYNAMIC",
        "ttl": 60,
        "image": {
          "mediaType": "image/png",
          "width": 300,
          "height": 300
        }
      },
      "paymentPurpose": "Flower for my girlfriend",
      "redirectUrl": "http://example.com"
    }
    
    Creating a QR code
    PUT /partner/payin/v1/sites/test-01/sbp/qrCodes/Test12 HTTP/1.1
    Accept: application/json
    Authorization: Bearer 5c4b25xx93aa435d9cb8cd17480356f9
    Content-type: application/json
    Host: b2b-api.qiwi.com
    
    {
      "amount": {
        "value": 1.00,
        "currency": "RUB"
      },
      "qrCode": {
        "type": "DYNAMIC",
        "ttl": 60,
        "image": {
          "mediaType": "image/png",
          "width": 300,
          "height": 300
        }
      },
      "paymentPurpose": "Flower for my girlfriend",
      "redirectUrl": "http://example.com"
    }
    

    Response

    The response format for both POST and PUT is the same.

    See also HTTP error codes

    Successful Response Parameters

    Parameter Required Type Description
    qrCodeUid Yes string QR code request identifier.
    qrCode Yes [object] QR code parameters
    createdOn Yes string QR code generation date and time
    amount No object Operation amount
    tokenizationPurpose No string(140) Payment token description.
    Returned if the FPS token issue is requested
    flags No array of strings Additional API commands from the original request
    token No object FPS payment token information.
    Returned if the FPS token issue is requested
    payment No object QR code payment information. Only for type=DYNAMIC
    refunds No array of objects QR code refunds information. Only for type=DYNAMIC

    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

    Response Examples

    {
      "qrCodeUid": "Test12",
      "amount": {
        "currency": "RUB",
        "value": "1.00"
      },
      "qrCode": {
        "type": "DYNAMIC",
        "ttl": 60,
        "image": {
          "mediaType": "image/png",
          "width": 300,
          "height": 300,
          "content": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAA"
        },
        "payload": "https://qr.nspk.ru/AD10006M8KH234K782OQM0L13JI31LQD?type=02&bank=100000000009&sum=200&cur=RUB&crc=C63A",
        "status": "CREATED"
      },
      "createdOn": "2022-08-11T20:10:32+03:00"
    }
    
    {
      "serviceName" : "payin-core",
      "errorCode" : "validation.error",
      "description" : "Validation error",
      "userMessage" : "Validation error",
      "dateTime" : "2022-03-05T11:49:59.166+03:00",
      "traceId" : "fd0e2a08c63ace83"
    }
    
    {
      "serviceName":"payin-core",
      "errorCode":"internal.error",
      "userMessage":"Internal error",
      "description":"Internal error",
      "traceId":"3fb3420ee1795dcf",
      "dateTime":"2020-02-12T21:28:01.813+03:00"
    }