OneBasket

Update the payment method

POST
/subscriptions/subscription/{subscriptionId}/update-payment-method

Changes the saved payment method that renewals of one subscription are charged to.

The body contains a signed payment method id. The payment provider API of the store returns it after the contact has authorised a new payment method. OneBasket checks the signature and checks that the payment method belongs to the contact in the bearer token. A value that fails either check returns 400.

After the request succeeds, List subscriptions returns the subscription with the new paymentMethodId.

Authorization

BearerAuth ApiKeyAuth
AuthorizationBearer <token>

In: header

x-api-key<token>

In: header

Path Parameters

subscriptionId*string

The id of a subscription of the contact, from List subscriptions.

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/problem+json

application/problem+json

curl -X POST "https://example.com/subscriptions/subscription/497f6eca-6276-4993-bfeb-53cbbbba6f08/update-payment-method" \  -H "Content-Type: application/json" \  -d '{    "signedPaymentMethodId": "string"  }'
Empty