CSG Callbacks

V1

This representation is not public and is for internal use only.


Endpoints

Verb Endpoint Description
POST /v1/order/fulfilled-successfully Notifies AMC systems of a CSG-fulfilled order

Order Fulfilled Successfully Request


Order Fulfilled Successfully Request Properties

Name Description
contextData An object containing data about the context of the activity.
order An object containing data about the order.
products An array of product objects.
subscriber An object containing data about the CSG subscriber.
transaction An object containing data about the order transaction.

Context Data


Context Data Properties

Name Description
assignedGroupId The int ID for the CSG assigned group.
businessUnitId The int ID for the CSG business unit.
complete A boolean indicating whether or not the activity is complete.
currentDateTime A string representing the current date/time.
errorCode The int ID for the CSG or AMC rule.
errorDetails A string describing the error that occurred while processing the callback.
esimatedCompletionDatetime A string representing the estimated completion date/time. Note: The mispelling is intentional, matching the CSG-defined property name.
newState An int indicating the current/post-processing state of the activity.
  • Open = 1
  • Complete = 6
  • Error = 9
previousState An int indicating the previous state of the activity.
  • Open = 1
  • Complete = 6
  • Error = 9
priority An int indicating the priority of the activity.
  • Standard = 3
success A boolean indicating whether or not the activity is successful.
workflowInstanceId The int ID for the CSG workflow instance.

Order


Order Properties

Name Description
orderDatetime A string representing the order's date/time.
orderItems An array of order item objects.

Order Item


Order Item Properties

Name Description
amount The decimal purchase amount, post-discounts.
id The int ID for the CSG order item.
originalAmount The decimal purchase amount, pre-discounts.
pricingPlanId The int ID for the CSG pricing plan applied to the order item.
productId The int ID for the CSG product that corresponds to the order item.

Product


Product Properties

Name Description
id The int ID for the CSG product.
externalReferences An array of external reference objects.

External Reference


External Reference Properties

Name Description
externalReferenceId The string ID for the kind of value being sent.
  • AMC_TITLE_ID
  • AMC_IMDB
  • TMS EXTREF
  • AMC_EIDR
  • AMC_ISAN
  • AMC_Slug
externalReferenceValue The value corresponding to the external reference ID. Note: The AMC TitleID will be stored in one of these objects, if available.

Subscriber


Subscriber Properties

Name Description
externalReferenceId The int ID of the AMC account.

Transaction


Transaction Properties

Name Description
items An array of transaction item objects.
paymentAmounts An array of payment amount objects.
purchaseOrder An object containing data about the purchase order.

Transaction Item


Transaction Item Properties

Name Description
amount The decimal amount transacted.
externalBillTransaction An object containing data about the external bill transaction data.
transactionType An int indicating the type of transaction representated.
  • Sale = 3
type An int indicating the type of payment represented.
  • External Bill = 4

External Bill Transaction


External Bill Transaction Properties

Name Description
externalReferenceId Note: The AMC MerchantTransactionToken will be stored here if the transaction item has a type of "External Bill" and a transaction type of "Sale".

Transaction Payment Amount


Transaction Payment Amount Properties

Name Description
amount The decimal amount transacted.
paymentInstrument An object containing data about the payment instrument used.

Payment Instrument


Payment Instrument Properties

Name Description
externalBillData An object containing external data about the payment instrument.
type An int indicating the type of payment instrument.
  • External Bill = 4

External Bill Data


External Bill Data Properties

Name Description
externalBillData Note: The AMC TenderTypeID will be stored here, if the payment instrument type is "External Bill".

Purchase Order


Purchase Order Properties

Name Description
created A string representing the purchase order creation date/time.
distributionChannel An int ID of the channel from which this purchase order originated. Note: Orders originating from AMC Web will not be recorded, as we should already have them.
  • Android = 1016
  • Android = 1062
  • Android = 590
  • Android = 688
  • Download Manager = 1055
  • Download Manager = 1066
  • Download Manager = 596
  • Download Manager = 692
  • iOS = 1017
  • iOS = 1061
  • iOS = 592
  • iOS = 695
  • LGWebOS = 1054
  • LGWebOS = 1064
  • LGWebOS = 594
  • LGWebOS = 690
  • Roku = 1052
  • Roku = 1063
  • Roku = 593
  • Roku = 689
  • SamsungTizen = 1053
  • SamsungTizen = 1065
  • SamsungTizen = 595
  • SamsungTizen = 691
  • AMC Web = 1025
  • AMC Web = 1060
  • AMC Web = 591
  • AMC Web = 694
  • XboxOne = 1058
  • XboxOne = 1067
  • XboxOne = 597
  • XboxOne = 693
items An array of purchase order item objects.
totals An object containing data about the purchase order totals.

Purchase Order Item


Purchase Order Item Properties

Name Description
appliedItems An array of purchase order item objects. Note: The same representation schema is used for an item as its applied items.
creditableAmount The decimal amount available for credit.
discountId The int ID of the discount, if the item type is a discount.
orderItemId The int ID of the corresponding order item.
transactedTotalAmount The decimal amount transacted, including all applied items.
type An int indicating the type of purchase order item.
  • County Tax = 6
  • Federal Tax = 4
  • Local Tax = 7
  • State Tax = 5
  • Coupon Discount = 24
  • Discount = 8
  • Discretionary Discount = 21
  • Episodic Purchase Discount = 30
  • Global Discount = 25
  • Instant Discount = 26
  • Pricing Plan Discount = 22
  • Product Purchase Discount = 23
  • Quantity Discount = 29
  • Shipping And Handling Discount = 27
  • A La Carte Purchase = 31
  • Balance Account Charge = 15
  • Balance Account Purchase = 14
  • Gift Card Purchase = 13
  • One-time Instant Purchase = 1
  • One-time Renewal Purchase = 9
  • Pro-rated Purchase = 18
  • Subscription Instant Purchase = 11
  • Subscription Renewal Purchase = 12
  • Termination Fee = 10

Purchase Order Totals


Purchase Order Totals Properties

Name Description
totalAmount The decimal balance of the total purchase order.


Errors

Code Description
9600 Invalid tag.
9601 Cannot extract file.
9602 Data ingestion failed.
9603 Failed to insert data entity.
9605 Invalid AMC title ID.
9606 Invalid AMC tender ID.
9607 Invalid AMC transaction token.
9608 Missing or invalid product.
9612 Invalid AMC account ID.
9615 Service communication exception occurred.
9616 Invalid number of purchase order items.
9617 Missing or invalid order item.
9618 Missing or invalid on-demand product.
9699 Missing request payload.

Unknown errors should be handled by your default 400 or 500 handler as appropriate.


Examples

Order Fulfilled Successfully
POST  /v1/order/fulfilled-successfully

Request Required Headers

Content-Type  application/json
X-AMC-Vendor-Key {CsgVendorKey}

Request

{
  "contextData": {
    "assignedGroupId": 321,
    "currentDateTime": "2019-02-14T19:24:36.2446842Z",
    "esimatedCompletionDatetime": "2019-02-14T19:24:36.2446842Z"
  },
  "order": {
    "orderDatetime": "2019-02-14T19:24:36.2386862Z",
    "orderItems": [
      {
        "amount": 9.99,
        "id": 1450828394,
        "originalAmount": 9.99,
        "pricingPlanId": 44241,
        "productId": 683038
      }
    ]
  },
  "products": [
    {
      "externalReferences": [
        {
          "externalReferenceId": "AMC_TITLE_ID",
          "externalReferenceValue": "2049"
        }
      ],
      "id": 683038
    }
  ],
  "subscriber": {
    "externalReferenceId": "21319"
  },
  "transaction": {
    "items": [
      {
        "amount": 10.79,
        "externalBillTransaction": {
          "externalReferenceId": "7ae21618"
        },
        "transactionType": 3,
        "type": 4
      }
    ],
    "paymentAmounts": [
      {
        "amount": 10.79,
        "paymentInstrument": {
          "externalBill": {
            "externalBillData": "270"
          },
          "type": 4
        }
      }
    ],
    "purchaseOrder": {
      "created": "2019-02-14T19:24:36.2436862Z",
      "distributionChannel": 1016,
      "items": [
        {
          "appliedItems": [
            {
              "transactedTotalAmount": 0.8,
              "type": 5
            }
          ],
          "creditableAmount": 9.99,
          "orderItemId": 1450828394,
          "transactedTotalAmount": 10.79,
          "type": 1
        }
      ],
      "totals": {
        "totalAmount": 10.79
      }
    }
  }
}

Response

{
  "AssignedGroupId": 35,
  "BusinessUnitId": 0,
  "Complete": true,
  "CurrentDateTime": "2019-04-08T17:15:19.593Z",
  "EsimatedCompletionDatetime": "2019-04-08T17:15:19.593Z",
  "NewState": 6,
  "PreviousState": 1,
  "Priority": 3,
  "Success": true,
  "WorkflowInstanceId": 0
}