Skip to main content
POST
/
v1
/
checkout
/
payment-resources
Creates a payment resource for a single-item purchase
curl --request POST \
  --url https://api.paypal.com/v1/checkout/v1/checkout/payment-resources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'PayPal-Request-Id: <paypal-request-id>' \
  --data '
{
  "integration_mode": "LINK",
  "type": "BUY_NOW",
  "reusable": "MULTIPLE",
  "return_url": "<string>",
  "line_items": [
    {
      "name": "<string>",
      "product_id": "<string>",
      "description": "<string>",
      "unit_amount": {
        "currency_code": "<string>",
        "value": "<string>"
      },
      "taxes": [
        {
          "type": "PERCENTAGE",
          "value": "<string>",
          "name": "<string>"
        }
      ],
      "shipping": [
        {
          "type": "FLAT",
          "value": "<string>"
        }
      ],
      "collect_shipping_address": true,
      "customer_notes": [
        {
          "required": true,
          "label": "<string>"
        }
      ],
      "variants": {
        "dimensions": [
          {
            "name": "<string>",
            "primary": true,
            "options": [
              {
                "label": "<string>",
                "unit_amount": {
                  "currency_code": "<string>",
                  "value": "<string>"
                }
              }
            ]
          }
        ]
      },
      "adjustable_quantity": {
        "maximum": 50
      }
    }
  ]
}
'
{
  "integration_mode": "LINK",
  "type": "BUY_NOW",
  "id": "<string>",
  "payment_link": "<string>",
  "links": [
    {
      "href": "<string>",
      "rel": "<string>",
      "method": "GET"
    }
  ],
  "create_time": "<string>",
  "update_time": "<string>",
  "status": "ACTIVE",
  "reusable": "MULTIPLE",
  "return_url": "<string>",
  "line_items": [
    {
      "name": "<string>",
      "product_id": "<string>",
      "description": "<string>",
      "unit_amount": {
        "currency_code": "<string>",
        "value": "<string>"
      },
      "taxes": [
        {
          "type": "PERCENTAGE",
          "value": "<string>",
          "name": "<string>"
        }
      ],
      "shipping": [
        {
          "type": "FLAT",
          "value": "<string>"
        }
      ],
      "collect_shipping_address": true,
      "customer_notes": [
        {
          "required": true,
          "label": "<string>"
        }
      ],
      "variants": {
        "dimensions": [
          {
            "name": "<string>",
            "primary": true,
            "options": [
              {
                "label": "<string>",
                "unit_amount": {
                  "currency_code": "<string>",
                  "value": "<string>"
                }
              }
            ]
          }
        ]
      },
      "adjustable_quantity": {
        "maximum": 50
      }
    }
  ],
  "code_snippets": {
    "single": {
      "body": "<string>"
    },
    "stacked": [
      {
        "framework": "HTML",
        "head": "<string>",
        "body": "<string>",
        "button_placement": "<string>"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Oauth 2.0 authentication.

Headers

PayPal-Request-Id
string
required

The server stores keys for 6 hours.

Required string length: 1 - 108
Content-Type
string

The media type. Required for operations with a request body. The value is application/<format>, where format is json.

Required string length: 1 - 255
PayPal-Auth-Assertion
string

An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion.

Body

application/json

Create payment resource details.

integration_mode
enum<string>
required

Determines how the payment resource is presented to customers. Currently, only LINK is supported, which generates a PayPal-hosted payment page with a shareable URL. This value is immutable after creation.

Available options:
LINK
Required string length: 1 - 20
type
enum<string>
required

The type of payment resource. Once a payment resource is created, this field cannot be changed.

Available options:
BUY_NOW
Required string length: 1 - 20
reusable
enum<string>
default:MULTIPLE

Indicates if the payment resource can be used multiple times or only once.

Available options:
MULTIPLE
Required string length: 1 - 20
return_url
string<uri>

URL to which the customer is redirected after completing the transaction.

Required string length: 1 - 1024
line_items
Line Item of Payment Resource · object[]

List of individual item in payment resource.

Required array length: 1 - 20 elements

Response

Payment resource generated successfully.

Detailed response for Payment resource, which include code snippets for payment resources.

integration_mode
enum<string>
required

Determines how the payment resource is presented to customers. Currently, only LINK is supported, which generates a PayPal-hosted payment page with a shareable URL. This value is immutable after creation.

Available options:
LINK
Required string length: 1 - 20
type
enum<string>
required

The type of payment resource. Once a payment resource is created, this field cannot be changed.

Available options:
BUY_NOW
Required string length: 1 - 20
id
string

Unique identifier for the payment resource (link or button).

Required string length: 1 - 127

The generated payment link URL for the transaction (present if integration_mode is link).

Required string length: 1 - 200

An array of related HATEOAS links.

Required array length: 1 - 20 elements
create_time
string<ppaas_date_time_v3>

The date and time that this payment resource was created.

Required string length: 20 - 64
update_time
string<ppaas_date_time_v3>

The date and time that the payment resource was updated.

Required string length: 20 - 64
status
enum<string>
default:ACTIVE

Status of the payment resource.

Available options:
ACTIVE,
INACTIVE
Required string length: 1 - 20
reusable
enum<string>
default:MULTIPLE

Indicates if the payment resource can be used multiple times or only once.

Available options:
MULTIPLE
Required string length: 1 - 20
return_url
string<uri>

URL to which the customer is redirected after completing the transaction.

Required string length: 1 - 1024
line_items
Line Item of Payment Resource · object[]

List of individual item in payment resource.

Required array length: 1 - 20 elements
code_snippets
Code snippets · object

Code snippets holds the code needed to inject payment resources for merchant experience.