Register PayPal as a payment method

POST /payment-methods/paypal

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.

application/vnd.api+json

Body Required

  • data object
    Hide data attributes Show data attributes object
    • id string(uuid)

      The ID of this payment method.

    • type string Required

      Value is paymentMethod.

    • Hide attributes attributes Show attributes attributes object
      • kind string Required

        Value is paypal.

      • successURL string(url) Required

        URL that the user is redirected to after successfully creating the payment method in the backend. Must be provided if the backend should create the Billing Agreement.

      • failureURL string(url) Required

        URL that the user is redirected to after creating the payment method in the backend failes. Must be provided if the backend should create the Billing Agreement.

      • canceledURL string(url) Required

        URL that the user is redirected to after creating the payment method in the backend was canceled by the user. Must be provided if the backend should create the Billing Agreement.

Responses

  • 201 application/vnd.api+json

    Created

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • type string

        Value is paymentMethod.

      • id string(uuid)

        Payment method ID

      • Hide attributes attributes Show attributes attributes object
        • kind string

          one of sepa, creditcard, paypal, paydirekt, dkv, applepay, ...

        • status string

          The desired status for a payment method is verified, this means the method is ready to use. A payment method that has the status created has yet to be verified. This is the case for payment methods, which have an asynchronous verification process, e.g., paydirekt (waiting for an email).

          Values are created, verified, pending, or unacceptable.

        • PACE resource name(s) to payment method vendor

        • twoFactor boolean

          indicates if the payment method kind requires two factors later on

        • approvalURL string(url)

          URL for the user to call in order to approve this payment method.

        • alias string

          Customer chosen alias for the payment method

        • implicit boolean

          Implicit (true) payment methods are read-only and cannot be deleted, e.g., ApplePay

        • pacePay boolean

          Identifies if the payment method is a PACE payment method (true) or a broker method (false)

        • Hide mandatoryAuthorisationAttributes attributes Show mandatoryAuthorisationAttributes attributes object
        • expiry string(date-time)

          Expiry date of the payment method. If empty or not present the payment method does not have an expiry date.

        • managed boolean

          Managed (true) payment methods are read-only and cannot be deleted other than by the client (oauth/oidc) that created them.

        • Indicates if the payment method is eligible for discounts.

      • meta object
        Hide meta attribute Show meta attribute object
        • Merchant name if the request was made in a way that a merchant name can be determined. For example if requesting payment methods for a specific gas station, it is the merchant name at that gas station.

      • Hide relationships attributes Show relationships attributes object
        • Hide paymentMethodVendor attribute Show paymentMethodVendor attribute object
          • data object
            Hide data attributes Show data attributes object
            • type string

              Value is paymentMethodVendor.

            • id string(uuid)
        • Hide paymentMethodKind attribute Show paymentMethodKind attribute object
          • data object
            Hide data attributes Show data attributes object
            • type string

              Value is paymentMethodKind.

            • id string(uuid)
        • Hide paymentTokens attribute Show paymentTokens attribute object
          • data array[object]
            Hide data attributes Show data attributes object
            • type string

              Value is paymentToken.

            • id string(uuid)
  • Already exists

    Hide headers attribute Show headers attribute
    • Location string(url)

      Location of the already existing payment method

  • 400 application/vnd.api+json

    Bad request

    Hide response attribute Show response attribute object
    • errors array[object]
      Hide errors attributes Show errors attributes object
      • id string

        A unique identifier for this particular occurrence of the problem.

      • status string

        the HTTP status code applicable to this problem, expressed as a string value.

      • code string

        an application-specific error code, expressed as a string value.

      • title string

        A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.

      • detail string

        a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.

      • source object

        An object containing references to the source of the error.

        Hide source attributes Show source attributes object
        • pointer string

          A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].

        • A string indicating which URI query parameter caused the error.

      • meta object

        a meta object containing non-standard meta-information about the error.

  • 401 application/vnd.api+json

    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"
              }
          ]
      }
    
    Hide response attribute Show response attribute object
    • errors array[object]
      Hide errors attributes Show errors attributes object
      • id string

        A unique identifier for this particular occurrence of the problem.

      • status string

        the HTTP status code applicable to this problem, expressed as a string value.

      • code string

        an application-specific error code, expressed as a string value.

      • title string

        A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.

      • detail string

        a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.

      • source object

        An object containing references to the source of the error.

        Hide source attributes Show source attributes object
        • pointer string

          A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].

        • A string indicating which URI query parameter caused the error.

      • meta object

        a meta object containing non-standard meta-information about the error.

  • 406 application/vnd.api+json

    The specified accept header is invalid

    Hide response attribute Show response attribute object
    • errors array[object]
      Hide errors attributes Show errors attributes object
      • id string

        A unique identifier for this particular occurrence of the problem.

      • status string

        the HTTP status code applicable to this problem, expressed as a string value.

      • code string

        an application-specific error code, expressed as a string value.

      • title string

        A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.

      • detail string

        a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.

      • source object

        An object containing references to the source of the error.

        Hide source attributes Show source attributes object
        • pointer string

          A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].

        • A string indicating which URI query parameter caused the error.

      • meta object

        a meta object containing non-standard meta-information about the error.

  • 409 application/vnd.api+json

    Resource conflicts

    Hide response attribute Show response attribute object
    • errors array[object]
      Hide errors attributes Show errors attributes object
      • id string

        A unique identifier for this particular occurrence of the problem.

      • status string

        the HTTP status code applicable to this problem, expressed as a string value.

      • code string

        an application-specific error code, expressed as a string value.

      • title string

        A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.

      • detail string

        a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.

      • source object

        An object containing references to the source of the error.

        Hide source attributes Show source attributes object
        • pointer string

          A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].

        • A string indicating which URI query parameter caused the error.

      • meta object

        a meta object containing non-standard meta-information about the error.

  • 415 application/vnd.api+json

    The specified content type header is invalid

    Hide response attribute Show response attribute object
    • errors array[object]
      Hide errors attributes Show errors attributes object
      • id string

        A unique identifier for this particular occurrence of the problem.

      • status string

        the HTTP status code applicable to this problem, expressed as a string value.

      • code string

        an application-specific error code, expressed as a string value.

      • title string

        A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.

      • detail string

        a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.

      • source object

        An object containing references to the source of the error.

        Hide source attributes Show source attributes object
        • pointer string

          A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].

        • A string indicating which URI query parameter caused the error.

      • meta object

        a meta object containing non-standard meta-information about the error.

  • 422 application/vnd.api+json

    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
    Hide response attribute Show response attribute object
    • errors array[object]
      Hide errors attributes Show errors attributes object
      • id string

        A unique identifier for this particular occurrence of the problem.

      • status string

        the HTTP status code applicable to this problem, expressed as a string value.

      • code string

        an application-specific error code, expressed as a string value.

      • title string

        A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.

      • detail string

        a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.

      • source object

        An object containing references to the source of the error.

        Hide source attributes Show source attributes object
        • pointer string

          A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].

        • A string indicating which URI query parameter caused the error.

      • meta object

        a meta object containing non-standard meta-information about the error.

  • 500 application/vnd.api+json

    Internal server error

    Hide response attribute Show response attribute object
    • errors array[object]
      Hide errors attributes Show errors attributes object
      • id string

        A unique identifier for this particular occurrence of the problem.

      • status string

        the HTTP status code applicable to this problem, expressed as a string value.

      • code string

        an application-specific error code, expressed as a string value.

      • title string

        A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.

      • detail string

        a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.

      • source object

        An object containing references to the source of the error.

        Hide source attributes Show source attributes object
        • pointer string

          A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].

        • A string indicating which URI query parameter caused the error.

      • meta object

        a meta object containing non-standard meta-information about the error.

POST /payment-methods/paypal
curl \
 -X POST https://api.pace.cloud/pay/2024-3/payment-methods/paypal \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/vnd.api+json"
Request examples
{
  "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"
    }
  }
}
Response examples (201)
{
  "data": {
    "id": "fc900b1f-97fc-4c9c-92de-e6d2f2dcc554",
    "type": "paymentMethod",
    "attributes": {
      "kind": "paypal",
      "approvalURL": "https://www.paypal.com/agreements/approve?ba_token=BA-0S67615936363915B"
    }
  }
}
Response examples (400)
{
  "errors": [
    {
      "id": "string",
      "links": {
        "about": "string"
      },
      "status": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      },
      "meta": {}
    }
  ]
}
Response examples (401)
{
  "errors": [
    {
      "id": "string",
      "links": {
        "about": "string"
      },
      "status": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      },
      "meta": {}
    }
  ]
}
Response examples (406)
{
  "errors": [
    {
      "id": "string",
      "links": {
        "about": "string"
      },
      "status": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      },
      "meta": {}
    }
  ]
}
Response examples (409)
{
  "errors": [
    {
      "id": "string",
      "links": {
        "about": "string"
      },
      "status": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      },
      "meta": {}
    }
  ]
}
Response examples (415)
{
  "errors": [
    {
      "id": "string",
      "links": {
        "about": "string"
      },
      "status": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      },
      "meta": {}
    }
  ]
}
Response examples (422)
{
  "errors": [
    {
      "id": "string",
      "links": {
        "about": "string"
      },
      "status": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      },
      "meta": {}
    }
  ]
}
Response examples (500)
{
  "errors": [
    {
      "id": "string",
      "links": {
        "about": "string"
      },
      "status": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      },
      "meta": {}
    }
  ]
}