Check the status

After the return, your server uses the token to confirm whether the enrollment was authorized, that is, whether the cardholder completed the autopay on your site.

Check

POST {BASE_URL}/restpatpass/v1/services/status

The request is authenticated with the Authorization and Commercecode headers, as explained in Authentication.

  • Name
    token
    Type
    string
    is Required
    REQUIRED
    Description

    The token you received when requesting the enrollment and that PAR returned to you in j_token.

Request

POST
/restpatpass/v1/services/status
curl --request POST \
  --url '{BASE_URL}/restpatpass/v1/services/status' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: {YOUR_SECRET_KEY}' \
  --header 'Commercecode: 1234567890' \
  --data '{"token": "{TOKEN}"}'

Response

PAR answers 200 whether the enrollment was authorized or not:

Response

{
  "authorized": true,
  "voucherUrl": "{BASE_URL}/nuevo-ic-rest/tokenVoucherLogin"
}
  • Name
    authorized
    Type
    boolean
    is Required
    REQUIRED
    Description

    true if the cardholder started the session with that token and completed the enrollment of an autopay on the site of your commerce code.

  • Name
    voucherUrl
    Type
    string | null
    is Required
    REQUIRED
    Description

    URL of the autopay voucher. Only present when authorized is true.

authorized is false when the token does not exist, has not been used to log in yet, was revoked, belongs to another merchant or site, or when the cardholder abandoned the enrollment without completing it. PAR does not distinguish between these cases so as not to reveal information about other partners' tokens.

authorized confirms that the autopay was enrolled, not its current status. If your site requires autopays to be approved, it may be pending approval; and the cardholder may cancel it later from PAR without this response changing.