Checkout Developer Portal

The Littlepay Checkout APIs and SDKs provide a simple and secure way to accept online payments from your front of office web and native mobile applications. Easily build secure web and mobile ticketing applications leveraging Littlepay’s network of transit acquirers.

Guides    API Reference

Quickstart

Integrate your back end with Littlepay back end and start collecting customer payments.

1 - Contact us to get your server Api Key

2 - Register to receive webhooks to be updated about important events in the payment lifecycle.
Events of interest include invoice.paid to be notified of customers completing payment, and purchase.provisioning.(not_required|succeeded|failed) to be notified of the status of purchase provisioning.
target_host, target_path, and target_port reference an endpoint on your server where you will receive webhook events.

curl -XPOST https://checkout.sandbox.littlepay.com/merchant/v1/webhooks/subscribe \
 -H 'x-api-key: <SERVER_API_KEY>' \
 -H 'Content-Type: application/json' \ 
 -d '{"participant_id": "test-participant","event_type": "invoice.paid","target_host": "www.test.com","target_path": "/thisisanexample","target_port": "443"}'

Response

{ 
  "secret_key": "30335c26766388a2901c7c3dc8c605ccf83f986349836f169bbd815206e79f0b"
}

Your server should securely store secret_key. Received event messages will contain a signature and secret_key can be used to verify Littlepay as the sender and to verify message integrity.

3 - (Optional) Your server creates a CustomerProfile for the customer.

curl -XPOST https://checkout.sandbox.littlepay.com/merchant/v1/customer-profiles \
 -H 'x-api-key: <SERVER_API_KEY>' \
 -H 'Content-Type: application/json' \
 -d '{"customer_ref":"uniqueRef","contact_details":{"name":"John Doe}}'

Response

{
  "id" : "cp_45eb5345-a50e-4e48-b843-ff9fffd098de",
  "customer_ref": "uniqueRef",
  "status" : "ACTIVE",
  "contact_details": {
    "name": "John Doe"
  }
}

4 - Your server creates an Order, providing the customer_ref, charge and items to be purchased.

curl -XPOST https://checkout.sandbox.littlepay.com/merchant/v1/orders \
 -H 'x-api-key: <SERVER_API_KEY>' \
 -H 'Content-Type: application/json' \
 -d '{"customer_ref":"uniqueRef","charge":{"currency":"GBP","amount":1099},"items":[{"product_id":"f3adb747-a21e-4d9d-b22e-820765038380","quantity":1}]}'

Response

{
  "id" : "or_12432332-c34f-4caf-b055-7a1e864c10a6",
  "participant_id" : "test-participant",
  "client_token": "eyJhdXRoX3Rva2VuIjoiZXlKaGJHY2lPaUpJVXpJMU5pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SnlaWEYxWlhOMFgzUjVjR1VpT2lKRlEwOU5YME5CVWtSZlZFOUxSVTVKVTBGVVNVOU9JaXdpY0dGeWRHbGphWEJoYm5SZmFXUWlPaUpzY0NJc0luQmhlVzFsYm5SZmFXNTBaVzUwWDJsa0lqb2ljR2xmWVdRNVpHVmhNamd0WVRnek5pMDBObVUyTFRnNVptUXRaR0ZqTkdRd1ptTXhNekprSWl3aVkzVnpkRzl0WlhKZmNISnZabWxzWlY5cFpDSTZJbU53WDJGbVpqWTBZamRsTFRFelpUTXROREppTVMwNU9XRmpMV0kxWm1KalpqTTVPRFExWlNJc0ltNWhiV1VpT2lKRlEwOU5YME5CVWtSZlZFOUxSVTVKVTBGVVNVOU9JaXdpWlhod0lqb3hOakUzTWpjeU5qUTRMak0zTW4wLmxLS1dma0xicEJIVnkzaFBCMFJ0bU5kU1dscU9sUDluNVU4VmwyTVNOYWsiLCJodHRwc19hcGkiOiJodHRwczovL2NoZWNrb3V0LnNhbmRib3gubGl0dGxlcGF5LmNvbS9jdXN0b21lci1kZXZpY2UvdjEifQ==",
  "charge" : {
    "currency" : "GBP",
    "amount" : 1099
  },
  "items" :[
    {
      "quantity": 1,
      "product_id" : "f3adb747-a21e-4d9d-b22e-820765038380"
    }
  ],
  "payment_intent_id" : "pi_f44ad9f5-4279-4c89-9e13-916d845cae2b"
}

5 - If you are using a Littlepay Client SDK, you will use this response to initialise the SDK on the frontend. Several SDK platforms are available, see: Javascript SDK, Android SDK, iOS SDK

 

Integration Overview

Updated 7 months ago

Quickstart


Integrate your back end with Littlepay back end and start collecting customer payments.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.