Back to top

Payment API

Payment api description

Acquire access token

Request access token

Create new Access token
GET/oauth/v2/token?client_id={clientId}&client_secret={clientSecret}&grant_type=client_credentials

Example URI

GET https://payment.acpsit.nl/oauth/v2/token?client_id=clientId&client_secret=clientSecret&grant_type=client_credentials
URI Parameters
HideShow
clientId
string (required) 
clientSecret
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "access_token": "NDAzM2MzNjRlMjY2ZmY0ZWM4MjdjOWYxZWMyOGQxZjYyNmVlNTFjYjEzMjQ3MTdhOWFhYjNkOTQ2N2Q0NmRjNw"
}

Payments

Paypal payment creation

Create a new Paypal payment
POST/api/paypal/create

Example URI

POST https://payment.acpsit.nl/api/paypal/create
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "paymentId": "31e5fa51-2475-455d-b0ad-5febd25434c5",
  "returnUrl": "http://www.alphacomm.nl",
  "companyName": "Alphacomm",
  "logo": "http://www.alphacomm.nl/logo.png",
  "autoCapture": false,
  "payer": {
    "id": "1337",
    "firstName": "Eric",
    "lastName": "Schildkamp",
    "street": "Scheepmakerspassage 183",
    "city": "Rotterdam",
    "zipcode": "3011VH",
    "phone": "+31612345678",
    "email": "reen@alphacomm.nl",
    "country": "NL",
    "ipAddress": "127.0.0.1",
    "language": "nl",
    "status": "2",
    "verificationStatus": "3",
    "accountType": "Platinum",
    "dateRegistration": "2016-01-01 13:56:48",
    "dateLastUpdated": "2016-01-01 13:56:48",
    "dateFirstPurchase": "2016-01-01 13:56:48",
    "withdrawalHistory": [
      {
        "datetime": "2016-01-01",
        "id": "1",
        "description": "transaction description",
        "amount": "10000"
      }
    ],
    "cashBalance": "10000",
    "bonusBalance": "10000",
    "openPositionCost": "10000",
    "binaryHistory": [
      {
        "datetime": "2016-01-01",
        "id": "1",
        "description": "transaction description",
        "amount": "10000"
      }
    ],
    "forexHistory": [
      {
        "datetime": "2016-01-01",
        "id": "1",
        "description": "transaction description",
        "amount": "10000"
      }
    ]
  },
  "transaction": {
    "reference": "1337",
    "currency": "EUR",
    "amount": 2000,
    "description": "Financial transaction",
    "lines": [
      {
        "name": "Product 1",
        "description": "euros",
        "sku": "prod-1",
        "quantity": "2",
        "amount": 1000
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "paymentId": {
      "type": "string",
      "description": "Require UUID v4 or v5"
    },
    "returnUrl": {
      "type": "string",
      "description": "absolute url where the payer will be redirected to"
    },
    "companyName": {
      "type": "string",
      "description": "Name will be used to display for payers"
    },
    "logo": {
      "type": "string",
      "description": "absolute url to a png file, size 190x100px"
    },
    "autoCapture": {
      "type": "boolean",
      "description": "this feature will auto capture after payer authorize by PapPal"
    },
    "payer": {
      "type": "object",
      "description": "Object of Payer info",
      "properties": {
        "id": {
          "type": "string",
          "description": "Payer ID"
        },
        "firstName": {
          "type": "string",
          "description": "Payer firstname"
        },
        "lastName": {
          "type": "string",
          "description": "Payer lastname"
        },
        "street": {
          "type": "string",
          "description": "Payer street"
        },
        "city": {
          "type": "string",
          "description": "Payer city"
        },
        "zipcode": {
          "type": "string",
          "description": "Payer zipcode"
        },
        "phone": {
          "type": "string",
          "description": "Payer full phone number, starting with coutry code (+31)"
        },
        "email": {
          "type": "string",
          "description": "Payer email address"
        },
        "country": {
          "type": "string",
          "description": "Country code 2 characters uppercase (ISO 3166-1 alpha2)"
        },
        "ipAddress": {
          "type": "string",
          "description": "Payer IP address"
        },
        "language": {
          "type": "string",
          "description": "Payer Language code 2 characters lowercase (ISO 639-1)"
        },
        "status": {
          "type": "enum",
          "description": "guest, registered, registered-unconfirmed"
        },
        "verificationStatus": {
          "type": "number",
          "description": "1: Identification card/passport present, 2: verified by phone, 3: trusted with other proof of identification"
        },
        "accountType": {
          "type": "string",
          "description": "Customer account type, Example: silver, gold, platinum"
        },
        "dateRegistration": {
          "type": "datetime",
          "description": "Format (ISO 8601) 2016-11-22T11:39:21+0100"
        },
        "dateLastUpdated": {
          "type": "datetime",
          "description": "Format (ISO 8601) 2016-11-22T11:39:21+0100"
        },
        "dateFirstPurchase": {
          "type": "datetime",
          "description": "Format (ISO 8601) 2016-11-22T11:39:21+0100"
        },
        "withdrawalHistory": {
          "type": "array",
          "description": "Array of withdrawal transaction history objects",
          "items": {
            "type": "object",
            "description": "Object of the withdrawal transaction histoy",
            "properties": {
              "datetime": {
                "type": "string",
                "description": "Format (ISO 8601) 2016-11-22T11:39:21+0100"
              },
              "id": {
                "type": "string",
                "description": "transaction ID"
              },
              "description": {
                "type": "string",
                "description": "transaction description"
              },
              "amount": {
                "type": "string",
                "description": "transaction amount"
              }
            },
            "required": [
              "datetime",
              "id",
              "description",
              "amount"
            ]
          }
        },
        "cashBalance": {
          "type": "number",
          "description": "number of cash balance in cents"
        },
        "bonusBalance": {
          "type": "number",
          "description": "number of bonus balance in cents"
        },
        "openPositionCost": {
          "type": "number",
          "description": "number of open position cost in cents"
        },
        "binaryHistory": {
          "type": "array",
          "description": "Array of binary transaction history objects",
          "items": {
            "type": "object",
            "description": "Object of binary transaction history",
            "properties": {
              "datetime": {
                "type": "string",
                "description": "Format (ISO 8601) 2016-11-22T11:39:21+0100"
              },
              "id": {
                "type": "string",
                "description": "transaction ID"
              },
              "description": {
                "type": "string",
                "description": "transaction description"
              },
              "amount": {
                "type": "string",
                "description": "transaction amount"
              }
            },
            "required": [
              "datetime",
              "id",
              "description",
              "amount"
            ]
          }
        },
        "forexHistory": {
          "type": "array",
          "description": "Array of forex transaction history objects",
          "items": {
            "type": "object",
            "description": "Object of forex transaction history",
            "properties": {
              "datetime": {
                "type": "string",
                "description": "Format (ISO 8601) 2016-11-22T11:39:21+0100"
              },
              "id": {
                "type": "string",
                "description": "transaction ID"
              },
              "description": {
                "type": "string",
                "description": "transaction description"
              },
              "amount": {
                "type": "string",
                "description": "transaction amount"
              }
            },
            "required": [
              "datetime",
              "id",
              "description",
              "amount"
            ]
          }
        }
      },
      "required": [
        "id",
        "firstName",
        "lastName",
        "street",
        "city",
        "zipcode",
        "phone",
        "email",
        "country",
        "ipAddress",
        "language",
        "status",
        "verificationStatus",
        "accountType",
        "dateRegistration",
        "dateLastUpdated",
        "dateFirstPurchase",
        "withdrawalHistory",
        "cashBalance",
        "bonusBalance",
        "openPositionCost",
        "binaryHistory",
        "forexHistory"
      ]
    },
    "transaction": {
      "type": "object",
      "description": "Object of payment transaction",
      "properties": {
        "reference": {
          "type": "string",
          "description": "Transaction reference"
        },
        "currency": {
          "type": "string",
          "description": "Currency code 3 characters format (ISO 4217)"
        },
        "amount": {
          "type": "integer",
          "description": "Amount in cents"
        },
        "description": {
          "type": "string",
          "description": "description of the transaction"
        },
        "lines": {
          "type": "array",
          "description": "Array of lines objects",
          "items": {
            "type": "object",
            "description": "Object of transaction line",
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of transaction Item"
              },
              "description": {
                "type": "string",
                "description": "Description of transaction item"
              },
              "sku": {
                "type": "string",
                "description": "Sku of transaction item"
              },
              "quantity": {
                "type": "string",
                "description": "Quantity of transaction item"
              },
              "amount": {
                "type": "integer",
                "description": "Amount in cents"
              }
            },
            "required": [
              "name",
              "description",
              "sku",
              "quantity",
              "amount"
            ]
          }
        }
      },
      "required": [
        "reference",
        "currency",
        "amount",
        "description",
        "lines"
      ]
    }
  },
  "required": [
    "paymentId",
    "returnUrl",
    "companyName",
    "logo",
    "autoCapture",
    "payer",
    "transaction"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "paymentId": "7c8cca84-5745-4f2c-9701-8a685e544986",
  "state": "accepted",
  "redirectUrl": "paymentUrl absolute"
}

Paypal payment status

Get Status Paypal payment
GET/api/paypal/status/{paymentId}

Example URI

GET https://payment.acpsit.nl/api/paypal/status/paymentId
URI Parameters
HideShow
paymentId
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "paymentId": "7c8cca84-5745-4f2c-9701-8a685e544986",
  "state": "captured",
  "timestamp": "2016-11-22T11:39:21+0100"
}

Paypal payment capture

Capture Paypal payment
GET/api/paypal/capture/{paymentId}

Example URI

GET https://payment.acpsit.nl/api/paypal/capture/paymentId
URI Parameters
HideShow
paymentId
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "paymentId": "7c8cca84-5745-4f2c-9701-8a685e544986",
  "state": "captured",
  "timestamp": "2016-11-22T11:39:21+0100"
}

Generated by aglio on 22 Nov 2016