One-time payments · Mobile

PIN confirmation for every payment

Protocol: JSON v3 · XML 2.9OpenAPI

DCB payment: SMS PIN, confirmation and notification.

The most common DCB flow: the customer creates an invoice, receives an SMS PIN and confirms the charge. Every payment is confirmed separately.

Step 1. Create an invoice

Send the customer phone and amount. The response authorization.type is SMS_PIN when PIN confirmation is available for the number. Invoice creation is covered in the quick start.

Step 2. Confirm the PIN

The customer enters the SMS PIN. Send it to Invoices_Authorize (XML — AuthorizeInvoice). Never store or log the PIN.

POST/api/v3/projects/YOUR_PROJECT_ID/invoices/{invoiceId}/authorizePRODUCTIONReference ↗
Request
curl -X POST "https://pay-api.digitalspb.com/api/v3/projects/YOUR_PROJECT_ID/invoices/{invoiceId}/authorize" \  -H "Content-Type: application/json" \  -H "X-Login: YOUR_LOGIN" \  -H "X-Timestamp: YOUR_TIMESTAMP" \  -H "X-Signature-Version: 3" \  -H "X-Signature: YOUR_SIGNATURE" \  -d '{  "client_ip": "10.20.30.40",  "pin_code": "987656"}'
Read-only example. Runnable examples are available in the Sandbox section.
200
{  "success": true,  "data": {    "invoice_id": "1624505c-0031-00cf-7d54-4cf1ce08cb30",    "status": "authorized"  }}

Step 3. Wait for the notification

The result arrives as a payment.updated event to the project URL. The PIN confirmation response is intermediate: read the result from invoice.payment_status.