1.2. Server-to-Server Sale by SBP

Introduction

Sale is a type of transaction, in which Payer receives goods or services from Connecting Party in exchange for money or other assets. Server-to-Server integration allows Connecting Party to offer a Payer the option to pay via SBP QR Code, directly received and displayed to Payer by Connecting Party.

SBP Sale Flow

skinparam roundcorner 20
skinparam sequenceArrowThickness 1
skinparam maxmessagesize 1200
skinparam sequenceParticipant underline
actor Payer
participant "Connecting Party" as A
participant SBC as B
autonumber
Payer -> A: Checkout
activate A
A -> B: /api/v2/sale/
activate B
B --> A: Order ID
A -> B: Get Status by Order ID
B --> A: Return qr-code
A --> Payer: Send qr-code to Payer
Payer -> A: Scan qr-code
B -> B: Process\nSale
group Get Final Status
== Receive Connecting Party Callback ==
A <- B: Callback with Final Status
A --> B: HTTP 200
deactivate B
== Order Status Request ==
A -> B: Get Status by Order ID
activate B
B --> A: Final Status
deactivate B
end
A --> Payer: Show result
deactivate Payer
deactivate A

(2) To implement sale request see /api/v2/sale/.
(4,11) To implement order status request see /api/v2/status/. Status should be requested multiple times with 3-5 seconds interval until QR code or final status is received.
(6) Connecting party sends received QR code to Payer.
(7) Payer scans the QR code to pay.
(9) To implement callback with final status handling see Connecting Party Callback.