Authorize invoice with PIN
/api/v3/projects/YOUR_PROJECT_ID/invoices/{invoiceId}/authorizeDescription
Authorizes a created invoice using a PIN code (delivered to the customer via SMS).
v4 signature payload: {invoice_id}{pin_code}{client_ip}
XML 2.9 description
Authorizes a created invoice using a PIN code. XML request type: <AuthorizeInvoiceRequest>.
After creating an invoice, the Platform (according to settings) will send an SMS to MSISDN with a PIN code for the user to enter on the Merchant's site. The application should then make this request to authorize the invoice by transferring the PIN code.
HTTP Headers:
Callisto-Protocol-Version: 2SignatureVersion: 3
Request and response
Examples come from OpenAPI and are read-only here. Run requests in the Sandbox section.
/api/v3/projects/YOUR_PROJECT_ID/invoices/{invoiceId}/authorizePRODUCTIONcurl -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"}'{ "success": true, "data": { "invoice_id": "1624505c-0031-00cf-7d54-4cf1ce08cb30", "status": "authorized" }}JSON v3 request fields
Invoices_Authorize| Request fields | Type | Req. | Description |
|---|---|---|---|
client_ip | string | optional | |
pin_code | string | optional | PIN code entered by the customer |
additional_parameters | object | optional | Arbitrary invoice parameters stored with the invoice, the JSON counterpart of the XML |
XML 2.9 request fields
authorizeInvoice| Request fields | Type | Req. | Description |
|---|---|---|---|
AuthorizeInvoiceRequest | object & object | required | |
ProjectID | integer (int32) | required | Project ID in the Platform system. Assigned during project setup. |
ClientIP | string | optional | IP address from which the client makes the request. Mandatory by default (configurable in project settings). |
InvoiceInfo | object | required | +6 |
AdditionalParameters | object | optional | +3 |
Parameter | array<object> | optional | +2 |
name | string | required | |
value | string | required | |
InvoiceID | string | optional | |
MerchantOrderID | string | optional | Order ID in Merchant's system |
AuthorizeInfo | object | required | Authorization data — PIN code entered by the subscriber to confirm the payment or contract. |
PinCode | string | required | PIN code entered by the subscriber to confirm the contract/invoice |
TestInfo | object | optional | Test information for authorization |
SuccessAuthorizationResult | boolean | required | |
Header | object | required | Request header with authentication. Included in every API request. |
Authentication | object | required | Request authentication data. All three fields are mandatory for every request. |
Login | string | required | Merchant Login assigned by the Platform |
NowUtc | string | required | Current UTC time in yyyyMMddHHmmss format. Must not differ from platform system time by more than 20 minutes. |
Signature | string | required | HMAC request signature. Calculated as: LOWERCASE(HMACSHA256(Password, Login + LOWERCASE(HMACSHA256(Password, NowUtc)))) |
RequestAttempt | integer (int32) | optional | Ordinal invoice request number (for idempotency). Starting from 0. |
Gateway | object | optional | +3 |
Signature | string | optional | |
ContractInfo | object | optional | +1 |
DesiredExpirationTimeUtc | string (date-time) | optional |
Parameters and headers
| Name | In | Required | Description |
|---|---|---|---|
projectId | path | yes | Project ID assigned by the platform during onboarding. |
invoiceId | path | yes | Invoice UUID assigned by the platform. |
Responses
exampleFull error codes are in Error codes.