Register PayPal as a payment method
By registering you allow the user to use PayPal as a payment method. The payment method ID is optional when posting data. If you provide a valid Billing Agreement ID, the payment method is created directly. Alternatively you can provide all three redirect URLs in which case the backend will create the Billing Agreement for you. Creating a Billing Agreement is a 2-step process, thus the payment method will only be created after the user approved it on the PayPal website. The approval URL in the response will point you to the correct page. After the user takes action the user is redirected to one of the three redirect URLs provided by you.
Responses
-
Created
-
Already exists
-
Bad request
-
OAuth token missing or invalid or a linked identity is missing.
Linked identity missing is a special case where you need to make sure that the user has additionally logged in / authorized with a third-party.
This is not relevant for most use-cases.
The specific error code that identifies a missing linked identity is
missing-linked-identity
Example:
{ "errors": [ { "id": "cbgmhslmp1o9or9kh1p0", "title": "Missing linked identity for authorized access", "detail": "Linked identity is needed to access this resource, please check why the user does not have a linked identity", "status": "401", "code": "missing-linked-identity" } ] }
-
The specified accept header is invalid
-
Resource conflicts
-
The specified content type header is invalid
-
The request was well-formed but was unable to be followed due to semantic errors. The following codes may be seen:
provider:card-not-usable
: The card is rejected by the payment provider
-
Internal server error
curl \
--request POST 'https://api.pace.cloud/pay/2025-1/payment-methods/paypal' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/vnd.api+json"
{
"data": {
"id": "2a1319c3-c136-495d-b59a-47b3246d08af",
"type": "paymentMethod",
"attributes": {
"kind": "paypal",
"successURL": "https://example.com/success",
"failureURL": "https://example.com/failure",
"canceledURL": "https://example.com/canceled"
}
}
}
{
"data": {
"id": "fc900b1f-97fc-4c9c-92de-e6d2f2dcc554",
"type": "paymentMethod",
"attributes": {
"kind": "paypal",
"approvalURL": "https://www.paypal.com/agreements/approve?ba_token=BA-0S67615936363915B"
}
}
}
{
"errors": [
{
"id": "string",
"links": {
"about": "string"
},
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}
{
"errors": [
{
"id": "string",
"links": {
"about": "string"
},
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}
{
"errors": [
{
"id": "string",
"links": {
"about": "string"
},
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}
{
"errors": [
{
"id": "string",
"links": {
"about": "string"
},
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}
{
"errors": [
{
"id": "string",
"links": {
"about": "string"
},
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}
{
"errors": [
{
"id": "string",
"links": {
"about": "string"
},
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}
{
"errors": [
{
"id": "string",
"links": {
"about": "string"
},
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}