HomeGuidesChangelogDiscussions
Log In
Guides

Payments API

This document specifies how a payment session can be created, captured and processed using the Juice Payments API.

Creating a payment session

To create a payment session you would need to obtain an Auth token from https://docs.spendjuice.org/v1.0/reference/websessioncontrollerauth

curl --location --request POST ‘curl -X POST "https://api.spendjuice.com/payment-sessions/payment-sessions’ 
-H "accept: application/json" -H "authorization: Bearer {token}" -H "content-type: application/json"
  --data-raw ‘{
    "amount": 0,
    "currency": "USD",
    "description": "string",
    "direction": "string",
    "metadata": {
      "order": {
        "identifier": "string",
        "items": [
          {
            "name": "string",
            "type": "string"
          }
        ]
      }
    },
    "payment_method": {
      "id": "string",
      "type": "string"
    },
    "reference": "string",
    "user": {
      "billing_address": {
        "city": "string",
        "country": "string",
        "line1": "string",
        "line2": "string",
        "state": "string",
        "zip_code": "string"
      },
      "business_id": "string",
      "email": "string",
      "first_name": "string",
      "last_name": "string",
      "phone": "string"
    },
    "user_id": "string"
  }’