customer_payment_sources

Create a customer payment source

Changed on

Create a customer payment source

post/customer_payment_sources

Request

  • Base URL
    https://{your_organization_slug}.commercelayer.io/api
  • URL
    https://{your_organization_slug}.commercelayer.io/api/customer_payment_sources
  • Auth
    HTTP bearer

Request body

Example request

{
  "data": {
    "attributes": {
      "customer_token": "cus_xxxyyyzzz",
      "payment_source_token": "pm_xxxyyyzzz",
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "customer": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "payment_method": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "payment_source": {
        "data": {
          "id": "XAyRWNUzyN",
          "attributes": {
            "public_key": "xxxx-yyyy-zzzz",
            "payment_methods": {
              "foo": "bar"
            },
            "payment_request_data": {
              "foo": "bar"
            },
            "payment_request_details": {
              "foo": "bar"
            },
            "payment_response": {
              "foo": "bar"
            },
            "balance": 1000,
            "expires_at": "2018-01-02T12:00:00.000Z",
            "closed_at": "2018-01-02T12:00:00.000Z",
            "payment_instrument": {
              "issuer": "cl bank",
              "card_type": "visa"
            },
            "created_at": "2018-01-01T12:00:00.000Z",
            "updated_at": "2018-01-01T12:00:00.000Z",
            "reference": "ANY-EXTERNAL-REFEFERNCE",
            "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
            "metadata": {
              "foo": "bar"
            }
          },
          "relationships": {
            "order": {
              "data": {
                "id": "XAyRWNUzyN"
              }
            },
            "payment_gateway": {
              "data": {
                "id": "XAyRWNUzyN"
              }
            },
            "event_stores": {
              "data": {
                "id": "XAyRWNUzyN"
              }
            }
          }
        }
      }
    }
  }
}

Response

The created customer payment source object

Changes

    • breaking

      added the new required request property ///

    • breaking

      added the new required request property ///

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property ///////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property //////// was restricted to a list of enum values

    • breaking

      request property / was restricted to a list of enum values

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property /////////

    • warning

      removed the request property //////////

    • warning

      removed the request property //////////

    • warning

      removed the request property ///

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property /////////

    • info

      added the new optional request property //////////

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property ///////// became nullable

    • info

      the request property // became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property /////// became optional

    • info

      the request property default value adyen_payments was removed

    • info

      the request property default value braintree_payments was removed

    • info

      the request property default value checkout_com_payments was removed

    • info

      the request property default value customer_payment_sources was removed

    • info

      the request property default value external_payments was removed

    • info

      the request property default value klarna_payments was removed

    • info

      the request property default value paypal_payments was removed

    • info

      the request property default value stripe_payments was removed

    • info

      the request property default value wire_transfers was removed

    • info

      added the new adyen_payments enum value to the request property ////////

    • info

      added the new approved enum value to the request property /////////

    • info

      added the new braintree_payments enum value to the request property ////////

    • info

      added the new checkout_com_payments enum value to the request property ////////

    • info

      added the new created enum value to the request property /////////

    • info

      added the new customer_payment_sources enum value to the request property /

    • info

      added the new external_payments enum value to the request property ////////

    • info

      added the new klarna_payments enum value to the request property ////////

    • info

      added the new paypal_payments enum value to the request property ////////

    • info

      added the new stripe_payments enum value to the request property ////////

    • info

      added the new wire_transfers enum value to the request property ////////

    • info

      added to the // request property oneOf list

    • info

      added the media type application/vnd.api+json for the response with the status