Skip to main content
POST
Creates a payment resource for a single-item purchase

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
Pattern: ^[0-9a-zA-Z_-]+$
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
Pattern: ^[A-Za-z0-9/+-]+$
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
Pattern: ^[A-Z0-9_]+$
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
Pattern: ^[A-Z0-9_]+$
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
Pattern: ^[A-Z0-9_]+$
return_url
string<uri>

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

Required string length: 1 - 1024
Pattern: ^.*$
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
Pattern: ^[A-Z0-9_]+$
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
Pattern: ^[A-Z0-9_]+$
id
string
read-only

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

Required string length: 1 - 127
Pattern: ^[A-Z]{3}-[A-Z0-9]+$

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

Required string length: 1 - 200
Pattern: ^.*$

An array of related HATEOAS links.

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

The date and time that this payment resource was created.

Required string length: 20 - 64
Pattern: ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])[T,t]([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]+)?([Zz]|[+-][0-9]{2}:[0-9]{2})$
update_time
string<ppaas_date_time_v3>
read-only

The date and time that the payment resource was updated.

Required string length: 20 - 64
Pattern: ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])[T,t]([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]+)?([Zz]|[+-][0-9]{2}:[0-9]{2})$
status
enum<string>
default:ACTIVE
read-only

Status of the payment resource.

Available options:
ACTIVE,
INACTIVE
Required string length: 1 - 20
Pattern: ^[A-Z0-9_]+$
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
Pattern: ^[A-Z0-9_]+$
return_url
string<uri>

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

Required string length: 1 - 1024
Pattern: ^.*$
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
read-only

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