Skip to content
FreeTicketDocs
Esc
↑↓navigate↵open⌘Jpreview

Charge with the MercadoPago Payment Brick token

Requires the X-Customer-Session header. The enterprise service API key is OPTIONAL (with a key, results are additionally scoped to the workspace pinned to it). Receives the token the Payment Brick produced on the landing page’s domain and charges through the Orders API using the sale amount (never one sent by the client); payer.email travels in the body but is ignored — the payer is ALWAYS the sale’s. status is approved, pending (normal, may require additional authentication from the bank) or rejected (business decline; the reason is in message) — all three are returned with 200. With rejected, saleAlive tells what happened to the purchase: false = it was cancelled and a new one must be started; true = this payment was declined but the purchase is still pending because another payment is in progress on it (do not start a new purchase: wait and check the order). Responds 409 with code PAYMENT_UNAVAILABLE if the reservation expired, the sale is no longer pending, a payment attempt is in flight with another gateway, the event only charges through Bold, or MercadoPago returned an error that cannot be classified as a decline. The sale must belong to the session’s buyer (and, with a key, to the workspace pinned to it): anything else is 404. {id} accepts the sale id or its reference. Limited to 10 attempts per minute per buyer (429 with Retry-After).

POST/customer/orders/{id}/payment/card
Authorization
AuthorizationAPI key · headerrequired

API key prefixed with Bearer . Alternative: the x-api-key header with the raw key. Available scopes: read and write (see /.well-known/oauth-protected-resource).

or
x-api-keyAPI key · headerrequired

Raw API key (without Bearer ), alternative to Authorization.

Path parameters
idstringrequired
Header parameters
X-Workspace-Idstring

Active workspace to operate on. Optional: when omitted, the default workspace of the user who owns the key is used (pickActiveOrg).

X-Purchase-Sessionstring

Purchase session id (POST /customer/purchase-sessions). Required when the event's workspace enforces a single purchase session; if present, it is always validated. The requirement is decided by the EVENT, not the API key: it applies if the owning workspace, a linked artist or a catalog seller of the show has the flag, with or without a key. Rejections (409; uppercase error.code and the slug in error.details.reason): PURCHASE_SESSION_REQUIRED (missing, or belongs to another buyer or another event date), PURCHASE_SESSION_SUPERSEDED (another tab or device replaced it), PURCHASE_SESSION_EXPIRED (the map clock ran out before the order was created), PURCHASE_SESSION_BUSY (an order is already in flight with this session) and, on POST /customer/orders with seats, HOLD_TOKEN_MISMATCH (the holdToken is not the session's, or belongs to a replaced session or another buyer even if the header is absent). Payment POSTs accept the buyer's live session or the session that created THAT order, as long as no other session has been opened since. Rejecting a new payment NEVER affects a payment already in flight.

Request body
requiredapplication/json
tokenstringrequired

Card token returned by the Payment Brick when tokenizing.

min length 1
paymentMethodIdstringrequired

payment_method_id returned by the Brick (e.g. visa, debmaster).

min length 1
installmentsintegerrequired
min 1 · max 9007199254740991 · default: 1
issuerIdstring

issuer_id returned by the Brick. Some BINs require it.

payerobject
Show properties
emailstring

Ignored: the charge ALWAYS uses the sale's email, never one sent by the client.

identificationobject
Show properties
typestringrequired
numberstringrequired
Responses
200

OK

dataCustomerOrderMercadoPagoChargeResultrequired
Show properties
statusstringrequired

pending is normal: it may require additional authentication from the bank. rejected is a business decline (funds, card details, …) — the buyer can retry with another card.

Allowed:approvedpendingrejected
referencestringrequired
messagestring

Human-readable message for the buyer. Only present with rejected.

saleAliveboolean

Only present with rejected. false: the purchase was cancelled and its tickets (and seats) went back to inventory — a new purchase must be started. true: THIS payment was declined but the purchase is still pending because another payment is in progress on it (e.g. a PSE payment waiting on the bank); do NOT start a new purchase: show the message, wait, and check the order status.

401

Missing or invalid credential.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
403

Insufficient role or resource not accessible.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
404

Resource does not exist or is out of scope.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
409

Conflict: the resource does not allow this operation in its current state.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
422

Operation error.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
429

Too many requests: rate limit exceeded.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
retryablebooleanrequired
detailsany
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://admin.appfreeticket.com/api/v1/customer/orders/string/payment/card' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "string",
  "paymentMethodId": "string",
  "installments": 1,
  "issuerId": "string",
  "payer": {
    "email": "string",
    "identification": {
      "type": "string",
      "number": "string"
    }
  }
}'
Response
{
  "data": {
    "status": "approved",
    "reference": "string",
    "message": "string",
    "saleAlive": true
  }
}