Fanatics EcoSystem
  • Fanatics ID
  • Loyalty
  • Home
  • Environments
  • V1 Features
    • Lookup
    • Bulk Bonus FanCash Earn
    • Earn
    • Auth
    • Capture
    • Void
    • Refund
  • V2 Features
    • Add
Powered by GitBook
On this page
  1. V2 Features

Add

PreviousV2 Features

Last updated 11 hours ago

This endpoint will add FanCash using the v2 contract. Currently it only supports transactions with short expirations which will be inserted as Bonus FanCash until the new ledger supports variable expirations.

Preconditions

  • This API only supports user access auth tokens.

  • User access tokens are returned from the step of the SSO auth process.

Required Scopes

fancash_v2:earn_expirable

Request

URL

/v2/fancash/add

Headers

Name
Required
Description

Authorization

a user Bearer token for accessing the API.

Data

Request Object

Name
Required
Description

txns

an array of transaction objects as defined below. we have a max number of 200 transactions in a call.

Transaction Object

Name
Required
Description

amount

dollar amount of FanCash written as a string NOT a number. supports fractional dollar amounts up to six decimal places.

external_id

unique identifier for this transaction within the systems of the caller of the API. If you have a unique id (ideally a uuid) on your side for this transaction you should use that (order id for example). If not, It is recommended to generate and store a uuid for your own records and to add this uuid to the request in this field. Please note, we use this id for idempotency. If you send the same id more than once it will be rejected.

expiry_date

expiration date for the fancash. formatted as an RFC 3339 date string. we currently do not support expirations greater than 90 days in the future.

Response

Normal Response Data

Name
Description

txns

an array of transaction objects as defined below.

Transaction Object

Name
Description

account_tenant_fanid

unique identifier representing the user in a non-Fanatics system. each vendor will have their own account_tenant_fan_id for a user. this value is a property of the ID Token returned in the SSO login process.

result

ok if the transaction was processed successfully otherwise nok

txn_id

unique identifier for the FanCash transaction within the Fanatics system.

external_id

the unique identifier you sent to us as the external_id.

Error Response Data

Error Response Wrapper

Property
Description

errors

array containing error response entries

rc

randomly generated identifier allowing call tracing within Fanatics. When reporting repeated errors or coordinating issue resolution with Fanatics, this value will assist in diagnosing any issues.

timestamp

processing timestamp in Zulu time of Fanatics API server using ISO 8601 format (https://datatracker.ietf.org/doc/html/rfc3339#section-5.6). Useful for issue resolution with Fanatics as log data is partitioned by date and time.

Error Response Wrapper -> Errors -> item

Property
Description

code

Fanatics error code for the specific error; this is generally not an http status code. Code values are generally stable for the API.

message

additional textual information describing the error. This is useful in debugging, but should not be checked programmatically

Full Spec

Code Exchange
  • Preconditions
  • Required Scopes
  • Request
  • URL
  • Headers
  • Data
  • Response
  • Error Response Data
  • Full Spec
  • POSTV2 FanCash add.

V2 FanCash add.

post

This endpoint add FanCash using the v2 contract. Currently it only supports transactions with short expirations which will be inserted as Bonus FanCash until the new ledger supports variable expirations. This also only supports user tokens (not s2s) for now. Requires the fancash_v2:earn_expirable permission.

Header parameters
AuthorizationstringRequired

User Bearer Token

Body
Responses
201
Created
application/json
400
[FAIL] Bad request
application/json
401
[FAIL] Unauthorized
application/json
429
[FAIL] Rate Limited
application/json
500
[FAIL] Internal error
application/json
post
POST /v2/fancash/add HTTP/1.1
Host: 
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 70

{
  "txns": [
    {
      "amount": "10.00",
      "expiry_date": "2022-07-07T20:53:07.070Z"
    }
  ]
}
{
  "txns": [
    {
      "account_tenant_fanid": "text",
      "result": "ok/nok",
      "txn_id": "text"
    }
  ]
}