Documentation

There doesn’t seem to be any way to send a single payment request — only a batch payout request. I guess that’s fine; you can always send a batch with a list of one.

Credentials

#!/usr/bin/env bash

curl -v POST https://api-m.sandbox.paypal.com/v1/oauth2/token \
  -H "Accept: application/json" \
  -H "Accept-Language: en_US" \
  -u "$client_id:$secret" \
  -d "grant_type=client_credentials"

Payout

Tested, valid payout script:

#!/usr/bin/env bash

batch_id=$(ksuid)

echo "batch_id = $batch_id"

curl -v -X POST https://api-m.sandbox.paypal.com/v1/payments/payouts \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
  "sender_batch_header": {
    "sender_batch_id": "'$batch_id'",
    "email_subject": "You have a payout!",
    "email_message": "You have received a payout! Thanks for using our service!"
  },
  "items": [
    {
      "recipient_type": "EMAIL",
      "amount": {
        "value": "9.77",
        "currency": "USD"
      },
      "note": "This is a test payment.",
      "receiver": "receiver@example.com",
      "notification_language": "en-US"
    }
  ]
}'