API · Invoices

Authorize invoice with PIN

Protocol: JSON v3 · XML 2.9POST/api/v3/projects/YOUR_PROJECT_ID/invoices/{invoiceId}/authorize
← All operations

Description

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: 2
  • SignatureVersion: 3

Request and response

Examples come from OpenAPI and are read-only here. Run requests in the Sandbox section.

POST/api/v3/projects/YOUR_PROJECT_ID/invoices/{invoiceId}/authorizePRODUCTION
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"  }}

JSON v3 request fields

Invoices_Authorize
Request fieldsTypeReq.Description
client_ipstringoptional
pin_codestringoptional

PIN code entered by the customer

additional_parametersobjectoptional

Arbitrary invoice parameters stored with the invoice, the JSON counterpart of the XML <AdditionalParameters>/<Parameter name= value=/> block. Parameter names are case-insensitive and must be unique. On cancel/refund/authorize the given values are merged into the ones already stored: names that match are overwritten, the rest are kept.

XML 2.9 request fields

authorizeInvoice
Request fieldsTypeReq.Description
AuthorizeInvoiceRequestobject & objectrequired
ProjectIDinteger (int32)required

Project ID in the Platform system. Assigned during project setup.

ClientIPstringoptional

IP address from which the client makes the request. Mandatory by default (configurable in project settings).

InvoiceInfoobjectrequired+6
AuthorizeInfoobjectrequired

Authorization data — PIN code entered by the subscriber to confirm the payment or contract.

+1
TestInfoobjectoptional

Test information for authorization

+1
Headerobjectrequired

Request header with authentication. Included in every API request.

Authenticationobjectrequired

Request authentication data. All three fields are mandatory for every request.

+3
RequestAttemptinteger (int32)optional

Ordinal invoice request number (for idempotency). Starting from 0.

Gatewayobjectoptional+3

Parameters and headers

NameInRequiredDescription
projectIdpathyesProject ID assigned by the platform during onboarding.
invoiceIdpathyesInvoice UUID assigned by the platform.

Responses

200
Invoice authorizedexample
400
401
403
500
503

Full error codes are in Error codes.