The Checkout API
This is the API for public use, ie, a registered app can issue a checkout request on SocialPay for any buyer. The buyer user will be implicitly created if not already existent.
Checkout workflow

Basket format
The basket passed in with the checkout request must be compliant with the following JSON schema.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "The SocialPay Basket Schema",
"description": "A basket containing a buyer, seller, and item for a SocialPay checkout.",
"type": "object",
"required": [
"group",
"buyer",
"seller_id",
"item"
],
"properties": {
"group": {
"type": "string",
"description": "Group ID or name on MisGroups"
},
"seller_id": {
"type": "number",
"description": "Seller.ID on SocialPay"
},
"item": {
"$ref": "#/definitions/item"
},
"buyer": {
"$ref": "#/definitions/buyer"
}
},
"definitions": {
"buyer": {
"type": "object",
"oneOf": [
{
"properties": {
"bid": {
"type": "integer",
"description": "Buyer.ID on SocialPay"
}
}
},
{
"properties": {
"xid": {
"type": "number",
"description": "MisAuth.user.ID as number"
},
"first_name": {
"type": "string",
"maxLength": 32
},
"last_name": {
"type": "string",
"maxLength": 32
},
"email": {
"type": "string"
"format": "URI"
},
"birthday": {
"type": "string",
"pattern": "^\d{4}-\d\d-\d\d$"
},
"country": {
"type": "string",
"maxLength": 2
},
"nationality": {
"type": "string",
"maxLength": 2
},
"mobile": {
"type": "string",
"maxLength": 20
},
"address": {
"$ref": "#/definitions/address"
}
},
"required": ["xid","first_name","last_name","email","birthday","country","nationality","address"]
}
]
},
"item": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "product name"
},
"currency": {
"type": "string",
"maxLength": 3,
"description": "3-letter currency code "
},
"amount": {
"type": "integer",
"description": "unit is pence"
}
},
"required": ["name","currency","amount"]
},
"address": {
"type": "object",
"properties": {
"address1": {
"type": "string",
"description": "flat house etc"
},
"address2": {
"type": "string",
"description": "second address line"
},
"city": {
"type": "string"
},
"region": {
"type": "string"
},
"postcode": {
"type": "string"
},
"country": {
"type": "string",
"maxLength": 2
}
},
"required": ["address1","city","region","postcode","country"]
}
}
}