Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Membership Payment Methods

Membership payment methods are used to charge invoices and to let members buy time passes, booking passes etc. A membership payment method is always connected to one of the payment methods set up for the space.

When selecting a payment method for a member using the Cobot web interface, users have to submit their card/bank details directly to the processor's site/api via a web form or a JavaScript call. This form/call usually returns a token that is connected to the submitted card/account, which is what Cobot stores in order to process payments.

When assigning a payment method via the API, you need to implement the flow to submit the payment details yourself, and only send the resulting token(s) to Cobot.

Right now this endpoint is only implemented for Stripe and Gocardless. Contact us if you need support for other processors.

PUT https://:subdomain.cobot.me/api/memberships/:membership_id/payment_method
Authentication required
yes, additionally user must be a space admin
Scope required
write_membership_payment_method
PUT https://co-up.cobot.me/api/memberships/dce8ca410400c427cb4a3262e6874c9f/payment_method

Body:

{
  "payment_method_id": "a7vb410400c427cb4a3262e6874c9fa63",
  "customer_id": "12345"
}
payment_method_id
id of a Stripe payment method set up for the space
customer_id
Stripe customer id

Response:

{
  "payment_method_id": "a7vb410400c427cb4a3262e6874c9fa63",
  "customer_id": "12345"
}

Body:

{
  "payment_method_id": "a7vb410400c427cb4a3262e6874c9fa63",
  "mandate": "12345"
}
payment_method_id
id of a Gocardless payment method set up for the space
mandate
Mandate id returned by Gocardless when completting their redirect flow

Response:

{
  "payment_method_id": "a7vb410400c427cb4a3262e6874c9fa63",
}

In case something goes wrong at Stripe (status 422):

{
  "errors": ["something went wrong"]
}

back to index