Change subscription buyer

Moves a buyer's inscription from their current subscription to a different subscription in the same company — e.g. an upgrade/downgrade between plans — without losing their payment history. The source Subscription Buyer is set to finished and a new one is created as active on the target subscription, carrying over the buyer's active card and billing cycle.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Possible Rejections

Two different response shapes are used — don't assume error.message works everywhere:

  • 400 / 401 / 404{"error": {"code": <status>, "message": "..."}}
  • 409{"message": "..."}no error wrapper, no code.
#CheckHTTPResponse bodyNotes
1Source subscription_buyer_id exists404{"error": {"code": 404, "message": "Record not found."}}
2Source Subscription Buyer belongs to your company401{"error": {"code": 401, "message": "Invalid credentials."}}Cross-tenant access reads as an auth failure, not a 404.
3Source subscription is Zafepay-native (not shopify, jumpseller, woocommerce)400{"error": {"code": 400, "message": "Only Zafepay subscription buyers can be changed."}}Buyers enrolled through an e-commerce integration can't be migrated this way.
4Source status is one of active, indebt, paused, problem_on_charge, or finished400{"error": {"code": 400, "message": "<status> subscription_buyers cannot be changed."}}Rejects pending, canceled, active_pending, etc.
5subscription_id param present400{"error": {"code": 400, "message": "Missing 'subscription_id' param"}}
6Target subscription_id exists404{"error": {"code": 404, "message": "Record not found."}}
7Target subscription belongs to your company401{"error": {"code": 401, "message": "Invalid credentials."}}
8aSource is not already finished409{"message": "The subscription buyer is already finished."}Hit if you retry a call that already succeeded.
8bSource has no installment processing_payment/processing_refund409{"message": "Subscription Buyer has an installment in processing status."}Wait for the in-flight installment to settle, then retry.
8csubscription_id differs from the source's current subscription409{"message": "The buyer already belongs to the target subscription."}
8dBuyer has no other active Subscription Buyer already on the target409{"message": "The buyer already has an active subscription buyer in the target subscription."}
8eTarget's inscriptions_limit (if set) isn't already reached409{"message": "Inscriptions limit reached for the target subscription."}
9invoice_information satisfies the target's invoice configuration (only checked when the company has the TuFacturador integration and the target emits documents)400{"error": {"code": 400, "message": "Invoice information is required when the service emits documents"}} or {"error": {"code": 400, "message": "Invoice emission requires: <missing fields>"}}See the invoicing documentation for which fields are required per document type.
10invoice_information/shipping_address pass model validation (e.g. commune is a real Chilean commune)400{"error": {"code": 400, "message": "Validation failed: ..."}}Fails after step 9 passes, once the migration is actually being persisted — still rolls back the whole migration.
11extra_fields match the target subscription's configured extra fields (unknown key, missing mandatory field, invalid selector value)400{"error": {"code": 400, "message": "..."}}Same extra_fields validation used by create/update — see that documentation for the full set of messages.

Steps 1–8 run before anything is created or changed — the source Subscription Buyer is untouched on any of those failures. Steps 9–11 run inside the same database transaction as the actual migration: if any of them fail, the whole migration (source status, card, invoice/shipping data, new record) is rolled back — the source is left exactly as it was, and no new Subscription Buyer is created.

Request Body

Content-Type: application/json

FieldTypeRequiredDescription
subscription_idstringYesId of the target Subscription.
extra_fieldsJSON stringNoExtra fields answers carried onto the new Subscription Buyer.
invoice_informationobjectConditionalRequired only when the target subscription emits documents and the company has the TuFacturador integration. Fields: rut, business_name, activity, address, commune, region, email. Which fields are required depends on the target's invoice configuration — see the invoicing documentation.
shipping_addressobjectNoIf sent, overwrites the buyer's shipping address. Fields: region, address1, address2, country, commune, phone.

Response Schema (200 OK)

Returns the new Subscription Buyer:

FieldTypeExample
idstringe1a2cdc9-1ad5-4947-b641-84a95675d063
buyer.idstring0d27afe0-7a02-41e1-9494-a955c21c0a3a
buyer.created_atstring2023-10-10T12:35:13
buyer.emailstring[email protected]
buyer.external_idstringcustomer003
buyer.namestringJhon Smith
buyer.updated_atstring2023-10-10T12:40:11
created_atstring2023-10-10T16:04:54
current_installment.amountinteger40990
current_installment.due_datestring2023-10-10
current_installment.currencystringCLP
current_installment.statusstringpending
external_idstringsb001
extra_fields.Rutstring22.222.222-2
payment_urlstringhttps://staging.zafepay.com/subscription_buyers/da7b6q1b-c744-4c2e-9749-f935a4ce9dab
statusstringactive
subscription_idstringa3a50c65-0dbc-4fd9-9735-b3c36feb37ea
updated_atstring2023-10-10T21:39:07

📘

The old Subscription Buyer is not deleted — it's set to finished, with a note recording which subscription it moved to, and the new one's parent_id points back to it so you can trace the chain.

Body Params
string
required

Id of the target Subscription.

json

Extra fields answers carried onto the new Subscription Buyer.

string

Required only when the target subscription emits documents and the company has the TuFacturador integration. Fields: rut, business_name, activity, address, commune, region, email. Which fields are required depends on the target's invoice configuration — see the invoicing documentation.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json